Orders
Dispatch in bulk
Dispatch up to 100 orders against one pickup address.
POST
/v1/orders/dispatch/bulkBearer tokenIdempotency-KeyReturns JSONSuccess 200
The answer is always 200 with one result per order. ok: false tells you which orders were not dispatched and why.
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. |
Request body
| Field | Type | Description |
|---|---|---|
orderIdsrequired | string[] | The ids of the orders to dispatch. 1 to 100. |
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/dispatch/bulk" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7c2f6f0a-3f55-4f0e-9a51-2a1e3b6c9d10" \
-d '{
"orderIds": [
"dffcd25d-6eb3-4b90-868c-6deca160ad74",
"30b653a8-e845-425b-85a6-0d2a6f1a5a46"
],
"pickupAddressId": "899caca3-0471-423e-9a90-0add12d7355b"
}'Response
Example response · 200
{
"total": 2,
"dispatched": 1,
"failed": 1,
"results": [
{
"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",
"ok": true
},
{
"id": "30b653a8-e845-425b-85a6-0d2a6f1a5a46",
"orderId": null,
"ok": false,
"outcome": "not_found",
"message": "Order not found."
}
]
}Errors
| HTTP | Code | Meaning |
|---|---|---|
| 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