Skip to main content

Package Transfers

5 API calls in this section.

List Package Transfers

Warehousing / Package Transfers
GET/warehousing/package-transfers?tenant_id={{tenant_id}}&mode=&source_warehouse_id=&destination_warehouse_id=&page=1&limit=20

Retrieves a paginated list of warehouse-to-warehouse package transfers (waybills with origin and destination as warehouses). Authentication: Requires valid token with view or manage permissions.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/warehousing/package-transfers?tenant_id={{tenant_id}}&mode=&source_warehouse_id=&destination_warehouse_id=&page=1&limit=20" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json"

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required)

modeOptional
query string

Filter by mode: delivery_operation (optional, shows waybill-based transfers)

source_warehouse_idOptional
query string

Filter by source warehouse (optional)

destination_warehouse_idOptional
query string

Filter by destination warehouse (optional)

pageOptional
query string

1

Page number (optional, default: 1)

limitOptional
query string

20

Items per page (optional, default: 20)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success200OK
Response body
json
1{2  "success": true,3  "message": "Package transfers retrieved successfully",4  "package_transfers": [5    {6      "id": "waybill-uuid-1",7      "waybill_number": "WB00001",8      "status": "drafted",9      "notes": "Batch transfer to branch warehouse",10      "origin_warehouse": {11        "id": "wh-source-uuid",12        "name": "Main Warehouse",13        "code": "WH-A"14      },15      "destination_warehouse": {16        "id": "wh-dest-uuid",17        "name": "Branch Warehouse",18        "code": "WH-B"19      },20      "created_at": "2026-05-22T11:00:00Z",21      "sealed_at": null,22      "dispatched_at": null,23      "received_at": null24    }25  ],26  "page": 1,27  "limit": 20,28  "total": 1,29  "stats": {30    "total": 1,31    "drafted": 1,32    "sealed": 0,33    "dispatched": 0,34    "received": 0,35    "closed": 0,36    "cancelled": 037  }38}

Create Package Transfer - System Only

Warehousing / Package Transfers
POST/warehousing/package-transfers?tenant_id={{tenant_id}}

Marks packages as transferred to another warehouse without creating delivery operations. Use when the movement already happened or doesn't need delivery tracking. Authentication: Requires 'manage:operations:tenant' or 'manage:module:warehouse' permission. Request Body: - mode (required): Must be "system_only" - source_warehouse_id (required): UUID of the source warehouse - destination_warehouse_id (required): UUID of the destination warehouse - package_barcodes (required): Array of package barcodes or delivery codes - notes (optional): Transfer notes Behavior: - Resolves barcodes to deliveries (tries barcode first, then delivery_code) - Updates pickup_warehouse_id and dropoff_warehouse_id on each delivery - Does NOT create a waybill, delivery order, or driver assignment

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/warehousing/package-transfers?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "mode": "system_only",7  "source_warehouse_id": "{{source_warehouse_id}}",8  "destination_warehouse_id": "{{destination_warehouse_id}}",9  "package_barcodes": [10    "PKG-1001",11    "PKG-1002"12  ],13  "notes": "Moved manually by warehouse team"14}'
Request body
json
1{2  "mode": "system_only",3  "source_warehouse_id": "{{source_warehouse_id}}",4  "destination_warehouse_id": "{{destination_warehouse_id}}",5  "package_barcodes": [6    "PKG-1001",7    "PKG-1002"8  ],9  "notes": "Moved manually by warehouse team"10}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required)

Request body fields

modeExample
string

Example field from the request body.

source_warehouse_idExample
string

Example field from the request body.

destination_warehouse_idExample
string

Example field from the request body.

package_barcodesExample
array<string>

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success - System Transfer201Created
Response body
json
1{2  "success": true,3  "message": "Packages transferred successfully",4  "transfer_id": "transfer-uuid-1",5  "transferred_count": 2,6  "delivery_ids": [7    "del-uuid-1",8    "del-uuid-2"9  ],10  "mode": "system_only",11  "rejected": []12}
Error - No Deliveries Found404Not Found
Response body
json
1{2  "success": false,3  "message": "No deliveries found for barcodes"4}
Error - Same Warehouse400Bad Request
Response body
json
1{2  "success": false,3  "message": "Source and destination must differ"4}

Create Package Transfer - Single Delivery Operation

Warehousing / Package Transfers
POST/warehousing/package-transfers?tenant_id={{tenant_id}}

Creates a delivery operation for a single package transfer between warehouses. Sets the delivery's pickup/dropoff warehouses so it can be assigned to a driver via the delivery module. Request Body: - mode (required): Must be "delivery_operation" - operation_type (optional): "single_delivery" (auto-detected if 1 barcode) - source_warehouse_id (required): Source warehouse UUID - destination_warehouse_id (required): Destination warehouse UUID - package_barcodes (required): Array with 1 barcode Behavior: - Sets pickup_warehouse_id and dropoff_warehouse_id on the delivery - Delivery is now ready for driver assignment in the delivery module - No waybill is created for single packages

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/warehousing/package-transfers?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "mode": "delivery_operation",7  "operation_type": "single_delivery",8  "source_warehouse_id": "{{source_warehouse_id}}",9  "destination_warehouse_id": "{{destination_warehouse_id}}",10  "package_barcodes": [11    "PKG-1001"12  ]13}'
Request body
json
1{2  "mode": "delivery_operation",3  "operation_type": "single_delivery",4  "source_warehouse_id": "{{source_warehouse_id}}",5  "destination_warehouse_id": "{{destination_warehouse_id}}",6  "package_barcodes": [7    "PKG-1001"8  ]9}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required)

Request body fields

modeExample
string

Example field from the request body.

operation_typeExample
string

Example field from the request body.

source_warehouse_idExample
string

Example field from the request body.

destination_warehouse_idExample
string

Example field from the request body.

package_barcodesExample
array<string>

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success - Single Delivery201Created
Response body
json
1{2  "success": true,3  "message": "Delivery transfer created successfully",4  "transfer_id": "transfer-uuid-2",5  "mode": "delivery_operation",6  "operation_type": "single_delivery",7  "delivery_ids": [8    "del-uuid-1"9  ],10  "rejected": []11}

Create Package Transfer - Waybill Operation

Warehousing / Package Transfers
POST/warehousing/package-transfers?tenant_id={{tenant_id}}

Creates a waybill-based delivery operation for multiple packages transferring between warehouses. All deliveries are linked to a new waybill which is then managed by the delivery module (seal → assign driver → dispatch → receive → close). Request Body: - mode (required): Must be "delivery_operation" - operation_type (optional): "waybill" (auto-detected if >1 barcode) - source_warehouse_id (required): Source warehouse UUID - destination_warehouse_id (required): Destination warehouse UUID - package_barcodes (required): Array of barcodes (min 1) - notes (optional): Notes for the waybill Behavior: - Sets pickup/dropoff warehouses on all deliveries - Creates a waybill with origin_type=warehouse and destination_type=warehouse - PostgreSQL atomically generates waybill_number in WB00001 format - Links all deliveries to the waybill via waybill_id - Waybill starts in 'drafted' status - Delivery module handles the rest: seal → assign driver → dispatch → receive → close

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/warehousing/package-transfers?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "mode": "delivery_operation",7  "operation_type": "waybill",8  "source_warehouse_id": "{{source_warehouse_id}}",9  "destination_warehouse_id": "{{destination_warehouse_id}}",10  "package_barcodes": [11    "PKG-1001",12    "PKG-1002",13    "PKG-1003"14  ],15  "notes": "Batch transfer to branch"16}'
Request body
json
1{2  "mode": "delivery_operation",3  "operation_type": "waybill",4  "source_warehouse_id": "{{source_warehouse_id}}",5  "destination_warehouse_id": "{{destination_warehouse_id}}",6  "package_barcodes": [7    "PKG-1001",8    "PKG-1002",9    "PKG-1003"10  ],11  "notes": "Batch transfer to branch"12}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required)

Request body fields

modeExample
string

Example field from the request body.

operation_typeExample
string

Example field from the request body.

source_warehouse_idExample
string

Example field from the request body.

destination_warehouse_idExample
string

Example field from the request body.

package_barcodesExample
array<string>

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success - Waybill Created201Created
Response body
json
1{2  "success": true,3  "message": "Waybill transfer created successfully",4  "transfer_id": "transfer-uuid-3",5  "mode": "delivery_operation",6  "operation_type": "waybill",7  "delivery_ids": [8    "del-uuid-1",9    "del-uuid-2",10    "del-uuid-3"11  ],12  "waybill_id": "waybill-uuid-1",13  "waybill_number": "WB00001",14  "status": "drafted",15  "rejected": []16}
Error - Waybill Creation Failed500Internal Server Error
Response body
json
1{2  "success": false,3  "code": "waybill_creation_failed",4  "message": "Unable to create the Waybill. Please try again.",5  "data": null6}
Error - Source Warehouse Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Source warehouse not found"4}
Error - Insufficient Permissions403Forbidden
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}

Validate Package Barcodes

Warehousing / Package Transfers
POST/warehousing/package-transfers/validate?tenant_id={{tenant_id}}

Validates package barcodes before creating a transfer. Checks if barcodes resolve to deliveries and whether those deliveries are eligible for transfer. Request Body: - source_warehouse_id (optional): Source warehouse UUID for validation - package_barcodes (required): Array of barcodes to validate

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/warehousing/package-transfers/validate?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "source_warehouse_id": "{{source_warehouse_id}}",7  "package_barcodes": [8    "PKG-1001",9    "PKG-1002",10    "PKG-9999"11  ]12}'
Request body
json
1{2  "source_warehouse_id": "{{source_warehouse_id}}",3  "package_barcodes": [4    "PKG-1001",5    "PKG-1002",6    "PKG-9999"7  ]8}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required)

Request body fields

source_warehouse_idExample
string

Example field from the request body.

package_barcodesExample
array<string>

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success - Validation Result200OK
Response body
json
1{2  "success": true,3  "valid": [4    {5      "barcode": "PKG-1001",6      "delivery_id": "del-uuid-1",7      "delivery_code": "DEL-001",8      "status": "staged_at_warehouse",9      "current_warehouse_id": "wh-uuid-1"10    },11    {12      "barcode": "PKG-1002",13      "delivery_id": "del-uuid-2",14      "delivery_code": "DEL-002",15      "status": "staged_at_warehouse",16      "current_warehouse_id": "wh-uuid-1"17    }18  ],19  "invalid": [20    {21      "barcode": "PKG-9999",22      "reason": "not_found"23    }24  ],25  "total_scanned": 3,26  "valid_count": 2,27  "invalid_count": 128}
Error - Missing Barcodes400Bad Request
Response body
json
1{2  "success": false,3  "message": "package_barcodes_required"4}