HTTP Status Codes
Use the HTTP status code as the first signal for how to handle a response. These codes apply to both REST and GraphQL requests at the HTTP transport level.Success Codes
Client Error Codes (4xx)
These indicate a problem with your request. Fix the request before retrying.Server Error Codes (5xx)
These indicate a problem on JTL’s side. You cannot fix the underlying cause, but your app should handle them with retries and backoff.Error Response Formats
The error response format differs between the JTL-Wawi REST API, the JTL-Wawi GraphQL API, and the SCX Channel API.JTL-Wawi REST API
REST endpoints return errors as JSON with an error code, message, and optional validation details:GraphQL API
GraphQL requests return HTTP200 OK for both successful and failed operations. Errors are reported inside the response body in an errors array.
A successful response looks like this:
The most important difference from REST: never assume a
200 OK means success when using GraphQL. Always check for the errors array in the response body before processing data.SCX Channel API
The SCX Channel API returns errors as anerrorList array, which can contain multiple errors in a single response:
Key differences between the three formats:
Error Message Language
The SCX Channel API returns error messages in German by default. To receive error messages in English, set theAccept-Language header:
Handling Errors Effectively
Examples are in TypeScript. The patterns translate directly to any language with an HTTP client.1. Check the Status Code and the Response Body
For REST and SCX requests, the HTTP status code tells you if something went wrong. For GraphQL, the status code is almost always200, so you must check the body.
REST. Check response.ok first, then parse the error body for the top-level message and any field-level validation errors:
errors array inside the response body. If data is present alongside errors, the response is a partial success, decide whether to use the available data or treat it as a failure:
2. Handle Auth Errors (401) with Token Refresh
A401 typically means your access token has expired. Refresh the token and retry once:
Only retry once on a 401. If the second request also returns 401, the issue is likely invalid credentials rather than an expired token. Retrying indefinitely will not resolve it.
3. Handle SCX Batch Errors
SCX responses can contain multiple errors in a single response. Always iterate the fullerrorList:
4. Retry with Exponential Backoff for Server Errors
For 5xx errors and 429 (rate limit), increase the wait time between each retry:5. Log Errors with Context
When an API call fails, log enough information to reproduce the failure later. At minimum, capture:- The endpoint that was called (URL or operation name)
- The HTTP status code
- The error code and message from the response body
- Any field-level validation errors
- The tenant ID the request was made on behalf of
- A timestamp
Quick Reference
What’s Next?
Rate Limiting
Understand request quotas and how to handle 429 responses.
Pagination
Navigate large result sets with page-based and cursor-based pagination.
Using Platform APIs
Full guide to calling REST and GraphQL APIs from your Cloud App.
Webhooks
Handle real-time events from the JTL platform.