Command 103 — Ship ordersrework
Shipping an order from the purchasing centre to the clinic is POST /order/{orderGID}/num/{orderGPartNum}/send. The call ships what the centre has in stock and moves whatever cannot be shipped yet to a new part of the order. V1’s manual mode — ship exactly the units given per line, or fail — does not exist in V2.
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 /order/{orderGID}/num/{orderGPartNum}/send | Stock Control - Orders → Send products to clinic |
PATCH /order/{orderGID}/num/{orderGPartNum} | Stock Control - Orders → Save |
DELETE /order/{orderGID}/num/{orderGPartNum}/receive | Stock Control - Orders → Orders - Cancel receipt of orders |
GET /order/1/num/0 | Stock Control - Orders → See |
GET /order | Stock Control - Orders → List |
The flow
Section titled “The flow”curl --location 'https://euapi.flowww.net/v1/fwa_external_get.asp?cmd=103&doctor=USER_LOGIN&pass=USER_PASS&country=ES&key=SYSTEM_KEY&ClinicID=1' \ --data-urlencode 'OrderGID=1' \ --data-urlencode 'OrderGPartNum=0' \ --data-urlencode 'OrderDetails[]=1,10' \ --data-urlencode 'OrderDetails[]=2,0' \ --data-urlencode 'OrderAutomatic=1'curl --location 'https://api.flowww.net/v2/order/1/num/0?clinicID=1' \ --header 'Authorization: Bearer <api_key>'Ship only order parts that are accepted (PROCESSED) and not yet shipped.
curl --location --request POST 'https://api.flowww.net/v2/order/1/num/0/send?clinicID=1' \ --header 'Authorization: Bearer <api_key>'curl --location 'https://api.flowww.net/v2/order?clinicID=1&orderState=2' \ --header 'Authorization: Bearer <api_key>'The shipped part now shows SENT_TO_CLINIC, and a new part appears for anything that was out of stock.
Field mapping
Section titled “Field mapping”| API V1 | API V2 | Notes |
|---|---|---|
OrderGID, OrderGPartNum | path segments | — |
OrderAutomatic=1 | POST …/send | Always this mode: ship what is in stock, move the rest to a new part. |
OrderAutomatic=0 + OrderDetails[]=orderID,units | — | Gap: you cannot choose the units to ship per line. Do not change the line units with PATCH …/detail/{orderID} for this: it changes the ordered quantity for good. |
| the shipment itself | POST …/send | Careful: GET on the same path is a different operation — it sends the order to the purchasing centre, which is what the clinic does when it places the order. |
What changes compared with V1
Section titled “What changes compared with V1”| Topic | API V1 | API V2 |
|---|---|---|
| Preconditions | Only accepted orders could be shipped (108004), never more units than ordered (108012). | Not checked. V2 does not check that the part was accepted, nor that it was not shipped already. Always check the order first (step 1) and never repeat the call: shipping twice takes the stock twice. |
| Out of stock | 108004, nothing shipped (manual mode). | What is in stock is shipped; the rest goes to a new part. 400 no-stock only when nothing at all can be shipped. |
| Purchasing centre | — | If the order’s centre is not set up as a purchasing centre, the call does nothing and still answers 200: step 3 shows it. |
| Providers | Lines supplied by an external provider went to their own part, and the provider was emailed. | Same. |
The rest of the cycle
Section titled “The rest of the cycle”- Reception at the clinic:
PATCH /order/{orderGID}/num/{orderGPartNum}with the units received per line. It adds the units to the clinic’s stock and closes the part; any units not received move to a new part. Never call it before the order has been shipped. A closed part answers400559. - Undo a reception:
DELETE /order/{orderGID}/num/{orderGPartNum}/receivetakes the units back out of the clinic’s stock and reopens the order. The API user needs the cancel reception permission (400548otherwise).