Receive deliveries from a warehouse system
The warehouse posts what arrived. A short line says whether the rest is still coming.
Which delivery
GET /v1/deliveries?view=due_today lists what the Deliveries page shows for today. The id is the purchase order. Each line you receive is a po_line_id from GET /v1/purchase-orders/{id}.
The two choices
rest expected means the units that did not arrive are still on the way. The order stays open for them. rest not_coming writes them off, the same choice as the screen. received is how many good units arrived. damaged is how many arrived unsellable. A line with nothing to record is skipped.
The request
A demo shop can receive. It cannot email the supplier about a late delivery. That refusal is the same one the screen uses.
curl -sS -X POST https://app.refilloapp.com/api/v1/deliveries/ORDER_ID/receive \
-H "Authorization: Bearer $REFILLO_API_KEY" \
-H "Idempotency-Key: receipt-ORDER_ID-1" \
-H "Content-Type: application/json" \
-d '{"lines":[{"po_line_id":"LINE_ID","received":6,"rest":"expected"}],"note":"One case was short"}'