Orders
Dispatch order
Choose the pickup address and dispatch: this prices the order, issues its air waybill and charges your account.
POST
/v1/orders/{orderId}/dispatchBearer tokenIdempotency-KeyReturns JSONSuccess 200
The order moves to Ready for Pickup. A prepaid account is charged from the wallet and a postpaid account on credit, whatever the payment mode (cash on delivery included — the COD amount is paid out to you later, less the handling fee). If the balance or credit is not enough, the call is refused with dispatch_refused and nothing changes. Calling again for an order that is already dispatched is safe: you get the same order back with outcome already_dispatched. A demo order is priced and numbered the same way but nothing is charged.
Request
Headers
| Field | Type | Description |
|---|---|---|
Authorizationrequired | string | The access token from Get token, as "Bearer <token>". |
Content-Typerequired | string | Always application/json when a body is sent. |
Idempotency-Keyoptional | string | Optional. Your own unique value for this action (up to 200 characters). Sending the same call again with the same value returns the first result and does nothing a second time. |
Path parameters
| Field | Type | Description |
|---|---|---|
orderIdrequired | string | The order's id (the UUID, not the short Order ID). |
Request body
| Field | Type | Description |
|---|---|---|
pickupAddressIdrequired | string | Where the shipment is collected from, from List pickup addresses. |
pickupRequestedFromoptional | string | Start of the pickup window you ask for (ISO 8601, UTC). |
pickupRequestedTooptional | string | End of the pickup window you ask for (ISO 8601, UTC). |
Example request
curl -X POST "https://api.swiftazu.com/v1/orders/dffcd25d-6eb3-4b90-868c-6deca160ad74/dispatch" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7c2f6f0a-3f55-4f0e-9a51-2a1e3b6c9d10" \
-d '{
"pickupAddressId": "899caca3-0471-423e-9a90-0add12d7355b"
}'Response
Example response · 200
{
"id": "dffcd25d-6eb3-4b90-868c-6deca160ad74",
"orderId": "SWZORDYFSADMR",
"isDemo": true,
"awbNumber": "DEMONQDJ3W6UDWML",
"status": "ready_for_pickup",
"currency": "AED",
"shippingCharge": "21.60",
"insurancePremium": "5.00",
"customsDutyCharge": null,
"total": "26.60",
"resolvedTier": 1,
"outcome": "dispatched"
}Errors
| HTTP | Code | Meaning |
|---|---|---|
| 404 | order_not_found | No order of yours has this id or air waybill number. |
| 400 | order_not_dispatchable | The order is in a status that cannot be dispatched (for example cancelled). |
| 400 | dispatch_refused | The dispatch was refused: no price for the route, not enough balance or credit, or the pickup address was not found. message says which. |
| 400 | invalid_idempotency_key | The Idempotency-Key header is empty or longer than 200 characters. |
| 409 | idempotency_in_progress | A call with this key is still running. Retry shortly. |
| 409 | idempotency_key_reused | This key was already used for a different call. |
Every call can also return the shared errors listed on the Overview page. Overview