Skip to main content
When a request fails, the Swish API returns a JSON error response with a consistent structure. The HTTP status code indicates the category of failure, and the response body provides details for debugging.

Error format

All error responses use the same envelope:

Status codes

Handling errors

The @swishapp/api-client never throws on API errors. Instead, every response is a union: check for "error" in result to distinguish failures from successful responses.

Request ID

Every response - successful or failed - includes a requestId. When reporting an issue to Swish support, include the request ID so the team can look up the exact request in the logs.