Skip to content

Latest commit

 

History

History
147 lines (138 loc) · 7.61 KB

response_codes.md

File metadata and controls

147 lines (138 loc) · 7.61 KB

Responses

The API responds to requests with different HTTP status codes depending on the result from the request. As with regular HTTP requests, the responses are categorized according into the following classes. Error responses may also include an error message in the body to assist the client in resolving the problem.

2xx Success

These codes are returned for requests that were understood and processed successfully.

Code

Definition

Purpose

200

OK

For successful GET/PUT requests.

201

Created

For a successful POST request.

202

Accepted

For a request that resulted in a scheduled task being created to perform the actual request.

204

No Content

For a successful request that produced no response (such as DELETE requests).

3xx Redirection

These codes are returned for requests that have resulted in the client needing to take further action to complete the request.

Code

Definition

Purpose

301

Moved Permanently

When the API routes have changed (unlikely) or if the incoming request is not secure (http) then it will be redirect to the secure (https) version.

302

Found

When the resource was found at a different location. When a request to a deprecated version of the API is received, a 302 Found response will be issued to the current API version.

304

Not Modified

If an If-Modified-Since header is sent in the request and the resource has not been modified since the specified date, then this response will be sent. NB. See resource specific pages for support for the If-Modified-Since header.

4xx Client Error

Code

Definition

Purpose

400

Bad Request

Issued when a malformed request was sent. Such as due to invalid syntax or missing required data.

401

Unauthorized

This response is sent when either the clients credentials are not provided or are incorrect.

403

Forbidden

When the user doesn't have permission to perform a specific operation on a resource (eg. edit a product). Permissions can be set through the store control panel.

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 (eg. PUT on /orders is invalid, but PUT on /orders/{id} 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 due to a condition imposed by the server. The exact reasons response for this will vary from one resource to the next. Examples may include attempting to delete a Category which would result in Products being orphaned. Additional information about the conflict and how to resolve it may be available in the details section of the response.

413

Request Entity Too Large

When the client requests too many objects. eg. the limit parameter was above the maximum allowed.

415

Unsupported Media Type

When the client specifies a content type in the Content-Type header that is not supported by the API.

5xx Server Error

These codes are returned for requests that could not be processed due to an internal error with the API or server.

Code

Definition

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 (eg. TRACE, PATCH).

503

Service Unavailable

When the store is marked as "Down for Maintenance" or the store is being upgraded to a new version.

507

Insufficient Storage

When the store has reached a limitation for the resource according to their BigCommerce plan (eg 500 product limit).

509

Bandwidth Limit Exceeded

When the requests-per-hour limitations for the API have been reached.