API status codes
The BigCommerce B2B Edition APIs use standard HTTP response status codes. When there's an error, the response body also contains an error message to help resolve the problem.
2XX Success
2xx codes are returned for requests that the server understood and processed successfully.
Code | Text | Purpose |
---|---|---|
200 | OK | For successful GET and PUT requests. |
201 | Created | For a successful POST request. |
202 | Accepted | For a request that created a scheduled task to perform the actual request. |
204 | No Content | For a successful request that produced no response, such as DELETE requests. |
3xx Redirection
3xx codes are returned for requests that require further action.
Code | Text | Purpose |
---|---|---|
301 | Moved Permanently | When the API routes have changed, or the incoming request uses an insecure protocol such as http , the request will be redirected to the secure (https ) version of the current API route. |
304 | Not Modified | This status code will be returned if the request includes an If-Modified-Since header, but the resource has not been modified since the specified date. |
4xx Client Error
4xx codes are returned for requests that could not be processed because there were problems with the request or the data.
Code | Text | Purpose |
---|---|---|
400 | Bad Request | Issued when a malformed request was sent. |
401 | Unauthorized | This response is sent when your client failed to provide credentials or its credentials were invalid. |
403 | Forbidden | Returned when permissions do not allow the operation. |
404 | Not Found | When a particular resource doesn’t exist or couldn’t be found. |
405 | Method Not Allowed | The resource was found, but doesn’t support the request method. Issued when either a specific method isn’t yet implemented on a resource, or the resource doesn’t support the method at all. For example, a PUT request to /companies is invalid, but a PUT request to /companies/{companyId} is valid. |
406 | Not Acceptable | When the client specifies a response content type in the Accept header that is not supported. |
409 | Conflict | A change requested by the client is being rejected because it did not meet a condition imposed by the server. The exact reasons for this response vary from one resource to another. For example, attempting to delete a category whose deletion would orphan products. Additional information about the conflict, and about how to resolve it, may be available in the response's details section. |
413 | Request Entity Too Large | When the client requests too many objects. For example, the limit parameter exceeded the maximum. |
415 | Unsupported Media Type | There are issues with the Content-Type header. |
422 | Missing or Invalid Data | The request could not be processed, either because it omitted required fields or because it contained invalid data. See the response for more details. |
429 | Too Many Requests | When an OAuth client exceeds the rate limit for API requests to a store. |
5xx Server Error
5xx codes are returned for requests that could not be processed because there was an internal error with the API or server.
Code | Text | Purpose |
---|---|---|
500 | Internal Server Error | When an error has occurred within the API. |
501 | Not Implemented | When a request method is sent that is not supported by the API, such as TRACE or PATCH . |
503 | Service Unavailable | When the store is “Down for Maintenance”, being upgraded to a new version, or is suspended due to administrative action or a billing issue. |
507 | Insufficient Storage | When the store has reached a limitation for the resource. |
Troubleshooting
Code | Common Causes | Solutions |
---|---|---|
204, 301, and 302 | Redirects | Try the www or non-www version of the URL. |
400 | Invalid syntax, required data missing, Content-Type header missing | Double-check request body for syntax errors and missing data; check the Content-Type header. |
401 | API credentials are missing or invalid. | Double-check the authToken . Send cURL request with the same credentials to rule out app or config issues. |
403 | API account lacks required OAuth scopes, the store owner account changed, the requests exceeded an internal platform limit, or the route is incorrect. | Double-check OAuth Scopes. Check the endpoint route. Are the URL and authToken correct? |
415 | Request headers specify an unsupported Content-Type , or the Content-Type header is missing altogether. | Double-check the Content-Type request header. |
500 | Expensive API calls or an internal server error. | Re-attempt the request three to five times, with increasing delays of at least a minute between attempts. |
Did you find what you were looking for?