Skip to main content

External International Delivery

1 API call in this section.

Create International Delivery​

External & Carrier Integrations / Deliveries / 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. If payment is wallet and the fee is positive, the fee is moved from usable wallet balance to reserved without a wallet transaction or payment. Confirmation captures it; draft cancellation releases it.

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. Reservation data does not return currency; integrations use tenant configuration.

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}