Skip to main content

External International Delivery

2 API calls in this section.

This endpoint uses the global External API JSON response contract

success is always boolean, error is null on success or a stable snake_case code on failure, and message is always a localized readable message. Existing delivery, inventory, receiving-order, validation-detail, and other endpoint-specific fields remain unchanged.

Create International Delivery​

External & Carrier Integrations / External International Delivery
POST/external/international-deliveries

Create an international delivery using a warehouse pickup and a delivery address object.

  • Requires X-API-Key authentication.

Key behavior

  • Pickup address is resolved from warehouse_id; do not send pickup_address.

  • Creates inventory items from products.

  • Creates a receiving order tied to the created inventory item(s).

  • Creates the delivery with status draft.

Notes

  • reference_number for the receiving order is auto-generated as RIO-<timestamp>.

  • receiving_orders.status is created as pending.

  • delivery.status is created as draft.

External delivery response enrichment

  • Top-level response includes currency_code. Each delivery object also includes currency_code.

  • delivery.track_order is the public tracking page URL built as {track_url}/tracking?code={delivery_code}; track_url resolves from tenant track_orders.track_url, then the WEB_URL secret, then system external_links.delivery_customer_portal_url, then https://staging-app.ondi.io.

  • delivery.customer_receipt_url is a signed receipt URL when a successful delivery payment receipt exists; otherwise null.

  • delivery.status_updated_at is derived from the latest status_updates[].timestamp, falling back to updated_at.

  • delivery.delivery_services includes description and image_url when available.

  • delivery.proofs is grouped as { pickup: [], delivery: [] } using OnDi proof records.

  • delivery.proof_of_pickup and delivery.proof_of_delivery are aggregate proof summaries when captured, shaped as { signature, photos }.

  • delivery.failure_reason is populated from delivery_failure_reason when present.

  • Top-level delivery_type is not returned; use delivery.delivery_services.delivery_type.

  • Response payment_method is documented as wallet | cash.

Headers

ParameterTypeDescription
X-API-Keystring

Example: {{api_key}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
warehouse_idRequiredstring

Warehouse UUID used as the pickup source.

delivery_addressRequiredobject

Delivery address payload.

delivery_address.latRequirednumber

Delivery latitude.

delivery_address.lngRequirednumber

Delivery longitude.

delivery_address.full_addressRequiredstring

Full delivery address text.

delivery_address.cityOptionalstring

City name.

delivery_address.stateOptionalstring

State or province.

delivery_address.countryOptionalstring

Country name or code.

delivery_address.postal_codeOptionalstring

Postal or ZIP code.

delivery_address.contact_infoOptionalobject

Receiver contact details.

delivery_address.contact_info.full_nameOptionalstring

Receiver full name.

delivery_address.contact_info.phoneOptionalstring

Receiver phone number.

Show 44 more body fields

Additional body parameters

ParameterTypeDescription
delivery_address.contact_info.emailOptionalstring

Receiver email address.

delivery_address.contact_info.tel_phoneOptionalstring

Alternate receiver phone value used by some integrations.

customer_idstring

Required for non-customer callers. For customer/no-role callers it is auto-filled from the authenticated user.

delivery_service_idRequiredstring

Delivery service UUID.

payer_typeRequiredstring

Supported values: sender, receiver.

payment_methodRequiredstring

Accepted values: wallet, cash, cod. cod is normalized to cash.

external_reference_idRequiredstring

External reference. When delivery_external_reference.unique_per_customer=true (default), it must be unique among root orders for the same tenant customer; when false, duplicates are allowed.

order_numberRequiredstring

Customer-facing order number used on shipment labels.

cod_amountOptionalnumber

Cash-on-delivery amount. Use 0 when not applicable.

notesOptionalstring

General delivery / receiving notes.

scheduled_pickup_timeOptionalstring

ISO 8601 datetime for planned pickup.

scheduled_delivery_timeOptionalstring

ISO 8601 datetime for planned delivery.

unit_sizeOptionalnumber

Positive unit size override. If omitted, the backend uses products totals and may derive size from package_details.items.

tracking_providerOptionalstring

Tracking provider identifier.

package_detailsOptionalobject

Parcel-level metadata.

package_details.special_instructionsOptionalstring

Handling / packing notes.

package_details.itemsOptionalarray<object>

Parcel items used for unit-size calculation when needed.

package_details.items[].nameOptionalstring

Item name.

package_details.items[].descriptionOptionalstring

Item description.

package_details.items[].quantityOptionalnumber

Quantity for unit-size calculation. Defaults to 1 when omitted.

package_details.items[].weightOptionalnumber

Item weight.

package_details.items[].lengthOptionalnumber

Item length.

package_details.items[].widthOptionalnumber

Item width.

package_details.items[].heightOptionalnumber

Item height.

productsRequiredarray<object>

Minimum 1 product. Used to create inventory items.

products[].nameRequiredstring

Product name.

products[].skuRequiredstring

SKU.

products[].barcodeRequiredstring

Barcode.

products[].unit_sizeRequirednumber

Unit size for this product line.

products[].quantityRequirednumber

Quantity for this product line.

products[].descriptionOptionalstring

Product description.

products[].brandOptionalstring

Brand name.

products[].modelOptionalstring

Model name or number.

products[].categoryOptionalstring

Product category.

products[].subcategoryOptionalstring

Product subcategory.

senderRequiredobject

Sender details used for labels / inventory linkage.

sender.nameRequiredstring

Sender name.

sender.phoneRequiredstring

Sender phone number.

sender.full_addressOptionalstring

Sender full address. Recommended; omitted values fall back to an empty string in label data.

expected_arrival_dateOptionalstring

Receiving order ETA date (YYYY-MM-DD).

receiving_detailsOptionalobject

Free-form receiving order metadata. Example keys: carrier, incoterms.

actual_arrival_dateOptionalstring | null

Present in the sample payload, but not currently consumed by the external handler.

received_byOptionalstring | null

Present in the sample payload, but not currently consumed by the external handler.

supplier_idOptionalstring | null

Supplier identifier passed into receiving-order creation.

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/external/international-deliveries" \2  --header "X-API-Key: ${ONDI_TENANT_API_KEY}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "warehouse_id": "{{warehouse_id}}",6  "delivery_address": {7    "lat": {{delivery_lat}},8    "lng": {{delivery_lng}},9    "full_address": "{{delivery_full_address}}",10    "city": "{{delivery_city}}",11    "state": "{{delivery_state}}",12    "country": "{{delivery_country}}",13    "postal_code": "{{delivery_postal_code}}",14    "contact_info": {15      "full_name": "{{receiver_name}}",16      "phone": "{{receiver_phone}}",17      "email": "{{receiver_email}}",18      "tel_phone": "{{receiver_tel}}"19    }20  },21  "customer_id": "{{customer_id}}",22  "delivery_service_id": "{{delivery_service_id}}",23  "payer_type": "sender",24  "payment_method": "wallet",25  "external_reference_id": "{{external_reference_id}}",26  "order_number": "{{order_number}}",27  "cod_amount": 0,28  "notes": "International shipment",29  "scheduled_pickup_time": "2024-01-15T10:00:00Z",30  "scheduled_delivery_time": "2024-01-20T18:00:00Z",31  "unit_size": 1,32  "tracking_provider": "internal",33  "package_details": {34    "special_instructions": "International shipment - handle with care",35    "items": [36      {37        "name": "{{item_name}}",38        "description": "{{item_description}}",39        "quantity": 1,40        "weight": 2.5,41        "length": 30,42        "width": 20,43        "height": 1544      }45    ]46  },47  "products": [48    {49      "name": "Widget A",50      "sku": "WIDGET-A",51      "barcode": "1234567890123",52      "unit_size": 1,53      "quantity": 2,54      "description": "Blue widget",55      "brand": "Acme",56      "model": "A1",57      "category": "Widgets",58      "subcategory": "Standard"59    },60    {61      "name": "Gadget B",62      "sku": "GADGET-B",63      "barcode": "9876543210987",64      "unit_size": 1,65      "quantity": 166    }67  ],68  "sender": {69    "name": "{{sender_name}}",70    "phone": "{{sender_phone}}",71    "full_address": "{{sender_full_address}}"72  },73  "expected_arrival_date": "2024-01-19",74  "receiving_details": {75    "carrier": "DHL",76    "incoterms": "DAP"77  },78  "actual_arrival_date": null,79  "received_by": null,80  "supplier_id": null81}'

Replace {{placeholders}} with your own values before sending.

Response examples

201Created
Response body
json
1{2  "success": true,3  "error": null,4  "message": "Delivery created successfully",5  "delivery": {6    "id": "DEL-000001",7    "delivery_code": "DEL-000001"8  },9  "pickup_address_id": "warehouse-address-uuid",10  "delivery_address": {11    "id": "address-uuid",12    "full_address": "456 Broadway..."13  },14  "inventory_item": {15    "id": "item-uuid-1",16    "sku": "WIDGET-A",17    "name": "Widget A"18  },19  "receiving_order": {20    "id": "ro-uuid",21    "reference_number": "RIO-1700000000000",22    "status": "pending"23  }24}

Create International Delivery​

External & Carrier Integrations / External International Delivery
POST/external/international-deliveries

Create an international delivery using a warehouse pickup and a delivery address object.

  • Requires X-API-Key authentication.

Key behavior

  • Pickup address is resolved from warehouse_id; do not send pickup_address.

  • Creates inventory items from products.

  • Creates a receiving order tied to the created inventory item(s).

  • Creates the delivery with status draft.

Notes

  • reference_number for the receiving order is auto-generated as RIO-<timestamp>.

  • receiving_orders.status is created as pending.

  • delivery.status is created as draft.

Headers

ParameterTypeDescription
X-API-Keystring

Example: {{api_key}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
warehouse_idRequiredstring

Warehouse UUID used as the pickup source.

delivery_addressRequiredobject

Delivery address payload.

delivery_address.latRequirednumber

Delivery latitude.

delivery_address.lngRequirednumber

Delivery longitude.

delivery_address.full_addressRequiredstring

Full delivery address text.

delivery_address.cityOptionalstring

City name.

delivery_address.stateOptionalstring

State or province.

delivery_address.countryOptionalstring

Country name or code.

delivery_address.postal_codeOptionalstring

Postal or ZIP code.

delivery_address.contact_infoOptionalobject

Receiver contact details.

delivery_address.contact_info.full_nameOptionalstring

Receiver full name.

delivery_address.contact_info.phoneOptionalstring

Receiver phone number.

Show 44 more body fields

Additional body parameters

ParameterTypeDescription
delivery_address.contact_info.emailOptionalstring

Receiver email address.

delivery_address.contact_info.tel_phoneOptionalstring

Alternate receiver phone value used by some integrations.

customer_idstring

Required for non-customer callers. For customer/no-role callers it is auto-filled from the authenticated user.

delivery_service_idRequiredstring

Delivery service UUID.

payer_typeRequiredstring

Supported values: sender, receiver.

payment_methodRequiredstring

Accepted values: wallet, cash, cod. cod is normalized to cash.

external_reference_idRequiredstring

External reference. When delivery_external_reference.unique_per_customer=true (default), it must be unique among root orders for the same tenant customer; when false, duplicates are allowed.

order_numberRequiredstring

Customer-facing order number used on shipment labels.

cod_amountOptionalnumber

Cash-on-delivery amount. Use 0 when not applicable.

notesOptionalstring

General delivery / receiving notes.

scheduled_pickup_timeOptionalstring

ISO 8601 datetime for planned pickup.

scheduled_delivery_timeOptionalstring

ISO 8601 datetime for planned delivery.

unit_sizeOptionalnumber

Positive unit size override. If omitted, the backend uses products totals and may derive size from package_details.items.

tracking_providerOptionalstring

Tracking provider identifier.

package_detailsOptionalobject

Parcel-level metadata.

package_details.special_instructionsOptionalstring

Handling / packing notes.

package_details.itemsOptionalarray<object>

Parcel items used for unit-size calculation when needed.

package_details.items[].nameOptionalstring

Item name.

package_details.items[].descriptionOptionalstring

Item description.

package_details.items[].quantityOptionalnumber

Quantity for unit-size calculation. Defaults to 1 when omitted.

package_details.items[].weightOptionalnumber

Item weight.

package_details.items[].lengthOptionalnumber

Item length.

package_details.items[].widthOptionalnumber

Item width.

package_details.items[].heightOptionalnumber

Item height.

productsRequiredarray<object>

Minimum 1 product. Used to create inventory items.

products[].nameRequiredstring

Product name.

products[].skuRequiredstring

SKU.

products[].barcodeRequiredstring

Barcode.

products[].unit_sizeRequirednumber

Unit size for this product line.

products[].quantityRequirednumber

Quantity for this product line.

products[].descriptionOptionalstring

Product description.

products[].brandOptionalstring

Brand name.

products[].modelOptionalstring

Model name or number.

products[].categoryOptionalstring

Product category.

products[].subcategoryOptionalstring

Product subcategory.

senderRequiredobject

Sender details used for labels / inventory linkage.

sender.nameRequiredstring

Sender name.

sender.phoneRequiredstring

Sender phone number.

sender.full_addressOptionalstring

Sender full address. Recommended; omitted values fall back to an empty string in label data.

expected_arrival_dateOptionalstring

Receiving order ETA date (YYYY-MM-DD).

receiving_detailsOptionalobject

Free-form receiving order metadata. Example keys: carrier, incoterms.

actual_arrival_dateOptionalstring | null

Present in the sample payload, but not currently consumed by the external handler.

received_byOptionalstring | null

Present in the sample payload, but not currently consumed by the external handler.

supplier_idOptionalstring | null

Supplier identifier passed into receiving-order creation.

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/external/international-deliveries" \2  --header "X-API-Key: ${ONDI_TENANT_API_KEY}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "warehouse_id": "{{warehouse_id}}",6  "delivery_address": {7    "lat": {{delivery_lat}},8    "lng": {{delivery_lng}},9    "full_address": "{{delivery_full_address}}",10    "city": "{{delivery_city}}",11    "state": "{{delivery_state}}",12    "country": "{{delivery_country}}",13    "postal_code": "{{delivery_postal_code}}",14    "contact_info": {15      "full_name": "{{receiver_name}}",16      "phone": "{{receiver_phone}}",17      "email": "{{receiver_email}}",18      "tel_phone": "{{receiver_tel}}"19    }20  },21  "customer_id": "{{customer_id}}",22  "delivery_service_id": "{{delivery_service_id}}",23  "payer_type": "sender",24  "payment_method": "wallet",25  "external_reference_id": "{{external_reference_id}}",26  "order_number": "{{order_number}}",27  "cod_amount": 0,28  "notes": "International shipment",29  "scheduled_pickup_time": "2024-01-15T10:00:00Z",30  "scheduled_delivery_time": "2024-01-20T18:00:00Z",31  "unit_size": 1,32  "tracking_provider": "internal",33  "package_details": {34    "special_instructions": "International shipment - handle with care",35    "items": [36      {37        "name": "{{item_name}}",38        "description": "{{item_description}}",39        "quantity": 1,40        "weight": 2.5,41        "length": 30,42        "width": 20,43        "height": 1544      }45    ]46  },47  "products": [48    {49      "name": "Widget A",50      "sku": "WIDGET-A",51      "barcode": "1234567890123",52      "unit_size": 1,53      "quantity": 2,54      "description": "Blue widget",55      "brand": "Acme",56      "model": "A1",57      "category": "Widgets",58      "subcategory": "Standard"59    },60    {61      "name": "Gadget B",62      "sku": "GADGET-B",63      "barcode": "9876543210987",64      "unit_size": 1,65      "quantity": 166    }67  ],68  "sender": {69    "name": "{{sender_name}}",70    "phone": "{{sender_phone}}",71    "full_address": "{{sender_full_address}}"72  },73  "expected_arrival_date": "2024-01-19",74  "receiving_details": {75    "carrier": "DHL",76    "incoterms": "DAP"77  },78  "actual_arrival_date": null,79  "received_by": null,80  "supplier_id": null81}'

Replace {{placeholders}} with your own values before sending.

Response examples

201Created
Response body
json
1{2  "success": true,3  "error": null,4  "message": "Delivery created successfully",5  "delivery": {6    "id": "DEL-INT-000001",7    "status": "draft",8    "tenant_id": "tenant-uuid",9    "external_reference_id": "EXT-REF-INT-123",10    "customer_id": "customer-uuid",11    "delivery_service_id": "service-uuid",12    "payer_type": "sender",13    "payment_method": "wallet",14    "delivery_fee": 45,15    "cod_amount": 0,16    "notes": "International shipment",17    "unit_size": 1,18    "tracking_provider": "internal",19    "carrier_type": "internal",20    "pickup_warehouse_id": "warehouse-uuid",21    "dropoff_warehouse_id": null,22    "pickup_location_id": "warehouse-address-uuid",23    "delivery_location_id": "address-uuid",24    "receiver_user_id": null,25    "assigned_carrier_id": null,26    "assigned_to_user_id": null,27    "package_details": {28      "special_instructions": "International shipment - handle with care",29      "items": [30        {31          "name": "Item 1",32          "description": "Widget",33          "quantity": 1,34          "weight": 2.535        }36      ]37    },38    "scheduled_pickup_time": "2024-01-15T10:00:00Z",39    "scheduled_delivery_time": "2024-01-20T18:00:00Z",40    "started_at": null,41    "picked_up_at": null,42    "delivered_at": null,43    "cancelled_at": null,44    "delivery_failure_reason": null,45    "created_at": "2024-01-15T08:00:00Z",46    "updated_at": "2024-01-15T08:00:00Z",47    "barcode": "DEL-INT-000001",48    "delivery_code": "DEL-INT-000001"49  },50  "pickup_address_id": "warehouse-address-uuid",51  "delivery_address": {52    "id": "address-uuid",53    "full_address": "456 Broadway, New York, NY 10013",54    "latitude": 40.7589,55    "longitude": -73.9851,56    "city": "New York",57    "state": "NY",58    "country": "US",59    "postal_code": "10013",60    "contact_info": {61      "full_name": "Jane Receiver",62      "phone": "+1-555-0200",63      "email": "[email protected]"64    }65  },66  "inventory_item": {67    "id": "item-uuid-1",68    "sku": "WIDGET-A",69    "name": "Widget A"70  },71  "receiving_order": {72    "id": "ro-uuid",73    "reference_number": "RIO-1700000000000",74    "status": "pending"75  }76}