Swiftazu

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}/dispatch
Bearer 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

FieldTypeDescription
AuthorizationrequiredstringThe access token from Get token, as "Bearer <token>".
Content-TyperequiredstringAlways application/json when a body is sent.
Idempotency-KeyoptionalstringOptional. 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

FieldTypeDescription
orderIdrequiredstringThe order's id (the UUID, not the short Order ID).

Request body

FieldTypeDescription
pickupAddressIdrequiredstringWhere the shipment is collected from, from List pickup addresses.
pickupRequestedFromoptionalstringStart of the pickup window you ask for (ISO 8601, UTC).
pickupRequestedTooptionalstringEnd 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

HTTPCodeMeaning
404order_not_foundNo order of yours has this id or air waybill number.
400order_not_dispatchableThe order is in a status that cannot be dispatched (for example cancelled).
400dispatch_refusedThe dispatch was refused: no price for the route, not enough balance or credit, or the pickup address was not found. message says which.
400invalid_idempotency_keyThe Idempotency-Key header is empty or longer than 200 characters.
409idempotency_in_progressA call with this key is still running. Retry shortly.
409idempotency_key_reusedThis key was already used for a different call.

Every call can also return the shared errors listed on the Overview page. Overview