Get started
Errors
Codes
Each endpoint page lists that endpoint's errors, with the exact body. The general meaning of each code in the collection is this.
| Code | When it happens |
|---|---|
| 400 | A body that is not valid JSON, an invalid path identifier, or a resource that does not exist or does not belong to the token's store. |
| 401 | Missing, malformed or expired token. Authenticate again and repeat the call. |
| 403 | The branch in the path is not linked to the token's head office. |
| 404 | The requested resource was not found. |
| 422 | The request was understood and rejected by a rule: missing required field, empty or oversized batch, a state that does not allow the operation. |
Two body formats
On most endpoints the error comes in an object with an error field. The collection records an exception on the bulk inventory routes, which respond with code, message and errorDescription. Handle both formats.
{"error":"authorization header is invalid"} 200 does not mean everything went in
Batch operations respond 200 even when some items are rejected: the response separates what was accepted from what was not. That is the case for bulk inventory and for adding customers and products to a contract. Read the response body and reprocess only what was rejected.
A 400 that is not your error
On the cashback balance by customer listing, 400 with no record found means the store has no records or offset went past the end of the list. The collection treats that as the end of pagination, not as an invalid request.
Related endpoints
Get started
- Environments and base URL: The base URL, the collection url variable and who calls whom.
- Authentication: One token for 12 hours, sent as Bearer on every call.
- Pagination and limits: limit and offset, per-endpoint caps and the two batch routes.
Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.