Errors, limits and retries
Developers
This page is for Developers, so it isn't in your menu.
When a request fails, the API answers with a 4xx or 5xx status and a JSON body that says why.
The error body
Section titled “The error body”{ "statusCode": 400, "message": "items[0].quantity must be a positive integer", "error": "Bad Request"}| Field | Meaning |
|---|---|
statusCode |
The HTTP status, repeated. |
message |
What went wrong, in plain English. Log it, and show it to the person who can fix the data. |
error |
The standard name of the status, such as Bad Request or Not Found. |
Base your code on the HTTP status. Messages can be reworded, so don’t match on their exact text.
Status codes
Section titled “Status codes”| Status | Means | Common causes |
|---|---|---|
400 Bad Request |
The request can’t be done as sent. Fix it before you try again. | A missing or invalid field (Invalid carrier, Invalid service level, items must contain at least one item). A location that isn’t yours or your key’s (Invalid origin location). An address whose suburb and postcode don’t match. The carrier refusing the booking (AusPost booking failed: …). schedule sent for a carrier other than self_managed. |
401 Unauthorized |
No valid API key. | The Authorization header is missing, mistyped or doesn’t start with Bearer . The key was revoked. See API keys and authentication. |
403 Forbidden |
The key is valid but can’t do this. | Insufficient scope: the key lacks the scope the endpoint needs. Not available to users limited to specific locations: a location-limited key called an account-wide endpoint. Store deliveries are turned off for this merchant: ask Shipr support. |
404 Not Found |
The thing doesn’t exist, or your key can’t see it. | A wrong ID, or a delivery at a location your key can’t see (Delivery not found). |
409 Conflict |
The request clashes with the current state. | Changing a delivery that isn’t pending_pickup. Reusing the external_id of a cancelled or failed delivery. Moving a store delivery that’s on a driver’s trip. Adding a delivery that’s already on a manifest. A second return for the same delivery. |
429 Too Many Requests |
Too many requests in a short time. | See Rate limits. |
500 Internal Server Error |
Something went wrong at Shipr. | Retry with a wait. If it keeps happening, contact Shipr support with the time and the request. |
Rate limits
Section titled “Rate limits”The endpoints you call with an API key don’t have a fixed request limit today. Keep your traffic reasonable anyway: use webhooks rather than polling, and don’t poll faster than you need.
Some public endpoints are limited per IP address:
| Endpoint | Limit |
|---|---|
| Public tracking lookup by tracking number | 120 requests a minute |
| Dashboard sign-in | 10 requests a minute |
A limited endpoint sends these headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit |
Requests allowed in the window. |
X-RateLimit-Remaining |
Requests left in the window. |
X-RateLimit-Reset |
Seconds until the window resets. |
Retry-After |
On a 429: seconds to wait before trying again. |
A 429 body looks like this:
{ "statusCode": 429, "message": "ThrottlerException: Too Many Requests" }Handle 429 everywhere, not only on these endpoints, so your integration keeps working if limits are added.
When to retry
Section titled “When to retry”| Response | Retry? |
|---|---|
| No response: timeout or network error | Yes, with a wait. Creates are safe to repeat if they have an external_id. |
429 |
Yes, after Retry-After seconds, or after a wait if it’s missing. |
500 and other 5xx |
Yes, with a growing wait. |
400, 401, 403, 404, 409 |
No. The same request gets the same answer. Fix the request, the key or the data first. |
Wait longer after each failure, for example 1, 2, 4, 8 and 16 seconds, and add a little random time so many clients don’t retry at once. Stop after a few tries and alert someone.
The API reference lists the status codes each endpoint can return.