POST
https://developer.digitail.io/api/v1/purchase-orders/{id}/receive
Permissions needed: EDIT_ORDERS.
Marks a pending, draft or backorder purchase order as completed and adds its lines to the clinic's stock, exactly as completing the order in the app does. Quantities, costs and prices are never changed by this call; only the order status and each line's is_received flag.
Omit items (or send an empty body) to receive every line. To receive only some lines, list the ones that did not arrive with is_received: false; lines that are not listed count as received. A finalization_strategy is then required: create_backorder moves the unreceived lines to a new backorder purchase order (returned as related_order), keep_unreceived drops them from this order.
An order that is already completed is rejected with 422.
acceptstringGenerated from available response content types
200<p>The completed purchase order, with its received items and the backorder (if one was created) under <code>related_order</code>.</p>
curl --request POST \
--url https://developer.digitail.io/api/v1/purchase-orders/{id}/receive \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"items": [
{
"id": 1201,
"is_received": false
}
]
}'