success responses.md

Success responses

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

The current OpenAPI specifications document these success status codes:

Status code Typical use
200 OK Successful read operation, usually with a response body.
201 Created Successful resource creation. See implementation notes for endpoint-specific codes.
204 No Content Successful 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