Errors
Swish uses conventional HTTP response status codes to indicate the success or failure of an API request. As a general rule:
Status codes in the
2xxrange indicate success.Status codes in the
4xxrange indicate incorrect or incomplete parameters (e.g. a required parameter was omitted).Status codes in the
5xxrange indicate an error with Swish's servers.
Swish also outputs an error response formatted in JSON:
{
"error": {
"message": "Item with ID 123 not found.",
"error": "Not Found",
"statusCode": 404,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}Last updated