Skip to main content
Every JTL API uses standard HTTP status codes to indicate success or failure. This page covers the error formats returned by the JTL-Wawi API (REST and GraphQL) and SCX Channel API, the status codes you’ll encounter, and strategies for handling failures.

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

For GraphQL requests, a 200 OK status does not guarantee success. GraphQL can return errors inside the response body while the HTTP status remains 200. Always check the errors array in the response. See the GraphQL errors section below.

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 HTTP 200 OK for both successful and failed operations. Errors are reported inside the response body in an errors array. A successful response looks like this:
An error response looks like this:
A partial success (some data, some errors) 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 an errorList 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 the Accept-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 always 200, 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:
GraphQL. Check two layers: HTTP-level errors first, then the 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

A 401 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 full errorList:

4. Retry with Exponential Backoff for Server Errors

For 5xx errors and 429 (rate limit), increase the wait time between each retry:
Backoff schedule:
Add jitter (a small random delay) to prevent multiple clients from retrying at the same time. Replace Math.pow(2, attempt) * 1000 with Math.pow(2, attempt) * 1000 + Math.random() * 500.

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
Avoid logging access tokens, session tokens, client secrets, or personally identifiable information from request payloads.

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.