Skip to content

Sales Layer REST APIs use standard HTTP status codes to indicate successful operations.

The current OpenAPI specifications document these success status codes:

Status codeTypical use
200 OKSuccessful read operation, usually with a response body.
201 CreatedSuccessful resource creation. See implementation notes for endpoint-specific codes.
204 No ContentSuccessful update or delete operation without a response body.

200 OK

200 OK is used when the API returns data.

List responses may include metadata such as count or navigation links.

{
  "@readLink": "https://api2.saleslayer.com/catalog/Products?$top=10",
  "@nextLink": "https://api2.saleslayer.com/catalog/Products?$skipToken=TOKEN_VALUE",
  "value": [],
  "@count": 0
}

The exact response schema depends on the endpoint. Use the OpenAPI reference for the operation you call.

201 Created

201 Created is used when a resource is created successfully.

Create operations may include a Location response header with the URL of the created resource.

Example:

HTTP/1.1 201 Created
Location: https://api2.saleslayer.com/catalog/Products(3)

Note: Not all create operations return 201 Created. POST /Products, POST /Variants, and POST /CustomEntities return 200 OK on success instead. Refer to the OpenAPI reference for the status code specific to each create operation.

204 No Content

204 No Content is used when an operation succeeds but there is no response body.

This is common for update and delete operations.

Example:

HTTP/1.1 204 No Content

Implementation notes

  • Do not require a JSON body for 204 No Content.
  • Read Location headers on 201 Created when present.
  • Use the operation-specific OpenAPI schema to parse 200 OK responses.
  • Check the OpenAPI reference for the exact success code of each operation. Create operations may return either 200 OK or 201 Created depending on the resource.