Warehouse Package Scan
1 API call in this section.
Read-only barcode scan endpoint for warehouse staff. Resolves staged P&D physical parent barcodes and separate operational-return delivery barcodes without processing either order. If an original barcode has an eligible active linked return, the response includes compact delivery and return_delivery plus independently resolved delivery_target and return_target. Every displayed option has a non-null target using only open_receiving_order, open_handoff, or open_delivery. A receiving-order or handoff target is used only when its delivery association belongs to that selected delivery or its P&D family; otherwise the target falls back to open_delivery with the displayed delivery ID and reason delivery_details_available. Mobile shows Delivery and Return as explicit choices and uses only the selected delivery ID and corresponding target. Dismissing the choices does not navigate, assign, receive, hand off, or change status. A direct return scan keeps the return in delivery, exposes its workflow in delivery_target, and includes original_delivery plus an independently resolved original_target. If no eligible active return exists, return_delivery and return_target are null and the existing original scan flow remains unchanged. Linked summaries include id, delivery_code, barcode, status, delivery_flow, is_active, and next_action. Returned items preserve has_exception, has_open_exception, and the latest open_exception, and also expose every current open_exceptions entry plus open_exception_count; the deprecated exception alias is not returned. Persistent execution blocks and missing handoffs are not advertised as executable targets; the displayed delivery instead uses the read-only open_delivery fallback.
Scan Delivery Package
/warehousing/package-scan/{{delivery_barcode}}Scans a P&D package barcode and returns a navigation instruction for the existing warehouse frontend.
When a moving staged P&D outbound or operational-return exception is created, backend also creates one exception-specific pending receiving order with custody awaiting_warehouse_receipt. The driver needs no new return action; warehouse staff scan the same parcel barcode after it is physically brought back. The existing sources failed_delivery_return and delivery_return_handoff both return action=open_receiving_order and reason=failed_delivery_return_ready_to_receive.
Frontend opens entity_id as the normal receiving order and calls PUT /warehousing/receiving-orders/:id with { "status": "received" }. It may send one selected location as item_details[0].bin_id; if omitted, backend uses the active default receiving location and returns bin_id_required_for_received_items when none exists. Successful receipt restores item-level warehouse stock, records one receive movement per parcel item, releases the old driver assignment/capacity, and keeps the delivery exception open. The scan itself is read-only.
Path parameters
| Parameter | Type | Description |
|---|---|---|
delivery_barcodeRequired | string | Variable used inside the request path. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | UUID of the tenant. Optional when available from the authenticated context. Example: |
language | string | Response language. Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/warehousing/package-scan/${DELIVERY_BARCODE}?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": true,3 "action": "open_receiving_order",4 "entity_id": "original-receiving-order-uuid",5 "reason": "package_ready_to_receive",6 "scanned_barcode": "DEL1001",7 "delivery": {8 "id": "original-delivery-uuid",9 "delivery_code": "1001",10 "barcode": "DEL1001",11 "status": "cancelled",12 "delivery_flow": "standard",13 "is_active": false,14 "next_action": "open_receiving_order"15 },16 "delivery_target": {17 "action": "open_receiving_order",18 "entity_id": "original-receiving-order-uuid",19 "reason": "package_ready_to_receive"20 },21 "return_delivery": {22 "id": "return-delivery-uuid",23 "delivery_code": "1050",24 "barcode": "DEL1050",25 "status": "pending",26 "delivery_flow": "operational_return",27 "is_active": true,28 "next_action": "open_receiving_order"29 },30 "return_target": {31 "action": "open_receiving_order",32 "entity_id": "return-receiving-order-uuid",33 "reason": "failed_delivery_return_ready_to_receive"34 },35 "warehouse_context": {},36 "receiving_order": {},37 "items": [],38 "inbound_deliveries": [],39 "outbound_deliveries": [],40 "handoff": null41}