Docs
Errors and rate limits
The response envelope, the error format and how limits work.
Response envelope
A successful call returns HTTP 200 and an envelope with success set to true and your result in data. Some responses add a message, and list responses add paging fields such as current_page, page_size, max_pages and total_count.
{
"success": true,
"data": { }
}Errors
A failed call returns a 4xx or 5xx status and success set to false. error.code is a stable code you can match on, and error.message is text for people. Some errors add a data field with details, for example a list of reasons.
{
"success": false,
"error": {
"code": "GE_003",
"message": "You're not authorized to access this resource"
},
"data": ["Missing, invalid or expired bearer token"]
}Match on the HTTP status and error.code, not on message text. Messages can change.
Common codes
| Status | Code | When |
|---|---|---|
400 | GE_001 | The request is not valid. The message says which field or rule failed. |
401 | GE_003 | The bearer token or channel API key is missing, invalid or expired, or the account is not active. data lists the reason. |
404 | GE_004 | The resource you asked for does not exist for your account. |
401 | AUTH_018 | Token request only. The client id or secret is wrong, or access is suspended, revoked or past its end date. |
403 | GE_007 | The brand you asked for is not enabled for your account. |
429 | AUTH_001 | You went over your per-minute limit. |
429 | TOO_MANY_REQUESTS | Token request only. Too many requests from one IP address. |
Rate limits
- Calls with your bearer token share one per-minute limit. The default is 60 requests a minute. Shopflo can agree a different limit with you.
- Going over returns 429. Wait, then slow down.
- The token endpoint has its own limit of 10 requests a minute per IP address. An IP address that makes more than 30 attempts in that window is blocked for 15 minutes. Cache your token instead of asking for a new one on every call.
Support
Email [email protected]. Include your client id (never your secret) and the time of the call. If a call failed, add the HTTP status and the error.code.