V1 · Overview
Merchant API
Connect your own system (a website, a warehouse system, a script) to your shipping company. Everything you can do in the merchant portal, you can do through this API: create customers and orders, get a price, dispatch, print labels, track shipments, and read your wallet and settlements.
Quick start
- In the merchant portal, open Integrations and create an Application. You get a client ID and a client secret. The secret is shown once, so copy it.
- Exchange them for an access token with Get token. Get token
- Send the token on every other call in the Authorization header.
- Every new Application starts in Demo mode. Build and test there, then ask your shipping company to move it to Live.
curl -X POST "https://api.swiftazu.com/v1/oauth/token" \
-H "Content-Type: application/json" \
-d '{ "client_id": "app_f4161f3498e4205e316202cd", "client_secret": "YOUR_CLIENT_SECRET" }'curl "https://api.swiftazu.com/v1/orders?page=1&pageSize=25" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Base address
All paths in these docs start at this address. Use HTTPS only.
https://api.swiftazu.com/v1If your shipping company uses its own brand and domains, your Application has its own API address. The Application screen in the merchant portal shows the exact address to call. Both addresses serve the same API.
A token only works on the address it was issued on.
Authentication
Get token is the only call that takes the client ID and client secret, and the only one that needs no token. The token lasts one hour. There is no refresh token: when it expires, get a new one the same way.
There are no scopes. A valid token reaches every endpoint, and only your own merchant account's data.
Keep the token and reuse it until it expires. Token requests have their own tighter limit (10 a minute).
Demo and Live
In Demo mode the API behaves exactly as in Live: the same checks, the same answers, real prices and a real label. But a demo order costs nothing, and no driver is ever sent for it.
- A demo Application can create a limited number of orders (25 by default). Your shipping company can raise it. Past the limit, creating an order returns demo_allowance_exhausted.
- Every demo order carries isDemo: true, and its air waybill number starts with DEMO.
- Use Advance demo order to move a demo order through its journey and test your handling of each status.
Store ID
Every order created through an Application carries that Application's number (for example 100001) as its Store ID. You do not send it and cannot change it. It tells you, and your shipping company, which integration created the order.
Safe retries (Idempotency-Key)
Calls that create a shipment or move money accept an Idempotency-Key header: Create order, Create orders in bulk, Dispatch order, Dispatch in bulk and Create return. Send your own unique value with the call. If the network fails and you send the same call again with the same key, you get the first result back and nothing happens twice.
The answer to a replayed call carries the header Idempotent-Replayed: true. A key belongs to one call: using it on a different endpoint returns idempotency_key_reused.
Rate limits
Each Application may make 100 calls a minute. Your shipping company can raise this for an Application. Every answer tells you where you stand:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 83
X-RateLimit-Reset: 1790908310X-RateLimit-LimitThe number of calls allowed per minute.X-RateLimit-RemainingThe calls left in the current minute.X-RateLimit-ResetWhen the allowance is full again, as a Unix time in seconds (UTC).
Past the limit the answer is 429 rate_limit_exceeded, with a Retry-After header in seconds.
Lists and pages
Long lists come in pages. Send page (starting at 1) and pageSize (10, 25, 50 or 100). The answer holds rows, total, page and pageSize.
Formats
- Money is a text value with two decimals ("27.80"), always in your shipping company's one currency, which is returned beside it.
- Dates and times are ISO 8601 in UTC ("2026-10-02T02:30:51.260Z").
- Sizes are in centimetres and weights in kilograms.
- Records are addressed by their id (a UUID). An order also has a short Order ID for people (orderId) and, once dispatched, an air waybill number (awbNumber).
- Fields you send that the API does not know are ignored. New fields may be added to answers at any time, so ignore fields you do not know.
Errors
An error always has the same shape. Use code in your program and show message to a person. A request that fails validation also lists each problem in details.
{
"code": "validation_failed",
"message": "The request is not valid.",
"details": [
"paymentMode must be one of the following values: prepaid, cod",
"boxes must contain at least 1 elements"
]
}Errors any call can return
| HTTP | Code | Meaning |
|---|---|---|
| 401 | no_token | The Authorization header is missing. |
| 401 | malformed_token | The Authorization header is not "Bearer <token>". |
| 401 | invalid_token | The token is not valid on this address. It is unknown, or it was issued on another address. |
| 401 | token_expired | The token is older than one hour. Get a new one. |
| 401 | token_revoked | The token was cancelled (for example the client secret was regenerated). Get a new one. |
| 403 | application_deactivated | The Application was switched off or suspended. |
| 403 | merchant_suspended | Your merchant account is suspended or closed. |
| 403 | merchant_on_hold | Your merchant account is on hold. |
| 403 | ip_not_allowed | The call came from an address that is not on the Application's address allow list. |
| 403 | origin_not_allowed | A browser call came from a website that is not in the Application's Allowed Origins. |
| 400 | validation_failed | The request is not valid. details lists each problem. |
| 429 | rate_limit_exceeded | Too many calls this minute. Wait for the time in Retry-After. |
| 500 | internal_error | Something went wrong on our side. Try again. |
Versions
The version is part of the path (/v1). Inside a version nothing is removed or changed in a way that would break your integration. A breaking change is released as a new version beside the old one.
Webhooks
To be told when something happens instead of asking, set a webhook address on your Application.
Read the webhooks guideAll endpoints
Authentication
Reference
Customers
- GETList customers
/v1/customers - GETGet customer
/v1/customers/{customerId} - POSTCreate customer
/v1/customers - PATCHUpdate customer
/v1/customers/{customerId} - DELETEDelete customer
/v1/customers/{customerId} - GETList addresses
/v1/customers/{customerId}/addresses - POSTCreate address
/v1/customers/{customerId}/addresses - PATCHUpdate address
/v1/customers/{customerId}/addresses/{addressId} - DELETEDelete address
/v1/customers/{customerId}/addresses/{addressId}
Addresses
Rates
Orders
- POSTCreate order
/v1/orders - POSTCreate orders in bulk
/v1/orders/bulk - GETList orders
/v1/orders - GETGet order
/v1/orders/{orderId} - PATCHUpdate order
/v1/orders/{orderId} - POSTCancel order
/v1/orders/{orderId}/cancel - POSTDispatch order
/v1/orders/{orderId}/dispatch - POSTDispatch in bulk
/v1/orders/dispatch/bulk - POSTAdvance demo order
/v1/orders/{orderId}/demo/advance