Command 40 — Create budgetsmulti-step
V1 took the whole budget as one Budgetdata JSON string inside a urlencoded field, checked it all and saved it in one go. V2 splits it into a header and its lines, each saved on its own, and prices the lines with the clinic’s tariff and discounts.
Permissions
Section titled “Permissions”V2 checks an app permission on every call — V1 checked none — and a call whose permission is missing answers 400 with errorCode 15, the same status as an invalid payload (see 4.4). Grant these to the API user before porting the command; the names are the ones of the permission tree in flowww.
| Call | Permission |
|---|---|
POST /budget/{budgetGID}/detail/product/{productID} | Sales - Quotes → Add product |
GET /budget/{budgetGID} | Sales - Quotes → Edit |
PUT /budget/{budgetGID}/detail/{budgetID} | Sales - Quotes → Edit price |
PUT /budget/{budgetGID} | Sales - Quotes → Save |
POST /budget | Sales - Quotes → Create |
GET /tariff/{productGID}/product | Tariffs - Products → Products - List |
DELETE /budget/{budgetGID} | Sales - Quotes → Delete |
POST /budget/{id}/clone | Clients - Odontogram → Clone budget |
GET /budget | Sales - Quotes → List |
The flow
Section titled “The flow”- 1
POST /budget?clinicID={n}
{"BudgetGClientID": id}→201 {"BudgetGID": 109}
ClientIDandClinicIDofBudgetdata - 2
POST /budget/{budgetGID}/detail/product/{productID}
Once per line, with{"BudgetUnits": n, "BudgetProductComments": "…"}→200with an empty body
Products[]ofBudgetdata - 3
GET /budget/{budgetGID}
Read the line ids (Details[].BudgetID) and the prices the tariff applied
No V1 equivalent - 4
PUT /budget/{budgetGID}/detail/{budgetID}
Only for a price other than the tariff’s:{"BudgetPrice": p}, VAT included
ProductPrice - 5
PUT /budget/{budgetGID}
Completes the header, always whole: date, validity, doctor, notes
ValidityDate,DoctorID,Comments,Status
The same budget, call by call:
curl --location 'https://euapi.flowww.net/v1/fwa_external_get.asp?cmd=40&doctor=USER_LOGIN&pass=USER_PASS&country=ES&key=SYSTEM_KEY' \ --data-urlencode 'Budgetdata={"ClientID": 93271, "ClinicID": 1, "ValidityDate": "2026-06-23", "DoctorID": 238, "Status": 0, "Comments": "Annual treatment", "Products": [{"ProductID": 2983, "VoucherID": 0, "PackID": 0, "SubscriptionID": 0, "ProductUnits": 1, "ProductPrice": 1000, "Comments": ""}]}'Note ValidityDate in yyyy-mm-dd.
curl --location 'https://api.flowww.net/v2/budget?clinicID=1' \ --header 'Authorization: Bearer <api_key>' \ --header 'Content-Type: application/json' \ --data '{"BudgetGClientID": 93271}'
→ 201 {"BudgetGID": 109}curl --location 'https://api.flowww.net/v2/budget/109/detail/product/2983?clinicID=1' \ --header 'Authorization: Bearer <api_key>' \ --header 'Content-Type: application/json' \ --data '{"BudgetUnits": 1, "BudgetProductComments": ""}'
→ 200 with an empty body: the id of the line is not returned.curl --location 'https://api.flowww.net/v2/budget/109?clinicID=1' \ --header 'Authorization: Bearer <api_key>'Each line in Details[] carries its BudgetID.
curl --location --request PUT 'https://api.flowww.net/v2/budget/109/detail/{BudgetID}?clinicID=1' \ --header 'Authorization: Bearer <api_key>' \ --header 'Content-Type: application/json' \ --data '{"BudgetPrice": 1210.00}'curl --location --request PUT 'https://api.flowww.net/v2/budget/109?clinicID=1' \ --header 'Authorization: Bearer <api_key>' \ --header 'Content-Type: application/json' \ --data '{ "BudgetGDate": "23/03/2026", "BudgetGValidity": "23/06/2026", "BudgetGDoctorID": 238, "BudgetGNotes": "Annual treatment" }'Send the same clinicID on every call: lines can only be added from the clinic the budget belongs to.
Cleaning up after a failure
Section titled “Cleaning up after a failure”A budget is built in several calls too, and one that stops half-way stays in the client’s record as a pending quote — with whatever lines it had got.
DELETE /budget/{budgetGID} removes it whole, lines included. You have its id from step 1, so there is nothing to look up.
curl --location --request DELETE 'https://api.flowww.net/v2/budget/109?clinicID=1' --header 'Authorization: Bearer <api_key>'It is not the way to undo a sold budget: once it has become a ticket, see command 43 and the cleanup of command 19.
Field mapping
Section titled “Field mapping”V1 (Budgetdata) | API V2 | Notes |
|---|---|---|
ClientID | BudgetGClientID (POST /budget) | The only mandatory field to create the budget. V2 does not check that the client exists: use the current id (merged clients are not translated). |
ClinicID | ?clinicID= | The budget is created in that clinic. V1 could fall back to the clinic’s default clinic for online sales or to the client’s clinic. |
ValidityDate | BudgetGValidity (PUT /budget/{id}) | Format changes: yyyy-mm-dd → dd/MM/yyyy. |
DoctorID | BudgetGDoctorID | V2 also has BudgetGUserID for the salesperson (the API user by default). |
Status | BudgetGStatus | Same 0–3 values, plus 4 Discarded and 5 Expired. Send the status as a number. See the warnings below. |
Comments (header) | BudgetGNotes | — |
Products[].ProductID / VoucherID / PackID / SubscriptionID | {productID} in the path | The four mutually exclusive ids collapse into one: the product id of the line, whatever its type, from the tariff of the clinic you call from. V1 translated it to the clinic’s tariff; V2 does not. Find it with GET /tariff/{productGID}/product. |
Products[].ProductUnits | BudgetUnits | Greater than 0. |
Products[].ProductPrice | BudgetPrice (PUT …/detail/{budgetID}) | VAT included in V2; V1 took the price without VAT. Multiply by (1 + VAT) when porting. Only needed when the price differs from the tariff. |
Products[].Comments | BudgetProductComments | — |
| — | BudgetProductUserID, BudgetGDate, BudgetGTitle | New. |
What changes compared with V1
Section titled “What changes compared with V1”| Topic | API V1 | API V2 |
|---|---|---|
| Atomicity | All or nothing: at least one line, every line with price and units, otherwise nothing was saved. | Each call is saved on its own. A failure in step 2 leaves a budget with fewer lines — or none — behind. |
| Prices | The price you sent, as is, with no automatic discounts. | The tariff price, with the clinic’s automatic discounts and advanced promotions applied. Set a price by hand only when you need to (step 4). |
| Manual prices | Always allowed. | Only when the clinic allows editing budget prices by hand. If it does not, step 4 answers 200 but the price does not change. Check the line with step 3. |
| The header | Sent once, with the budget. | PUT /budget/{id} replaces the whole header: a field you omit is cleared (validity, notes, doctor) and BudgetGDate is mandatory. Always send all of it. |
| Email to the client | Never sent. | Saving the header can email the budget to the client when the clinic has email the budget when it is updated enabled. |
| Internal products | Allowed. | Not allowed on a budget line. |
Errors
Section titled “Errors”| Step | Answer | Meaning | What to do |
|---|---|---|---|
1 | 400 166 | Missing client id. | Send BudgetGClientID. |
2 | 400 169 | Product not found in the clinic’s tariff, disabled, of a type not allowed on a budget, budget from another clinic, or a subscription with units other than 1. | Check the product and the clinicID. |
2 | 400 520 | Units must be greater than 0. | Fix the units. |
2 | 400 493 | The budget has advances and can no longer be changed. | — |
4 | 200 | Also when the price was not changed (see above). | Check with step 3. |
5 | 404 168 | The header could not be saved: BudgetGDate missing, budget sold, or not found. | Send the whole header. |
5 | 404 493 | The budget has advances and can no longer be changed. | — |
| any | 409 16 | The request could not be processed. | Check the ids. |
If the flow fails half-way, delete the incomplete budget with DELETE /budget/{budgetGID} (it fails with 513 if the budget is accepted or sold and 493 if it has advances), or complete it on retry — do not create a new one.
V2 adds per-line tools V1 never had: discounts (POST …/detail/{budgetID}/discount), promotions and promo codes, cloning (POST /budget/{id}/clone), printing and export.