Error format

All responses from the Universe API with a response code >=400 should be handled as an error with the format described in this section.

{
    "error_code": string,
    "error_messages": Array<string>,
    "correlation_id": string
}

error_code String, always present

The error_code property indicates the type of the error.

error_messages String[], always present

The error_messages array contains a list of errors that have occurred.

correlation_id String, always present

The correlation_id property holds the correlation id which was sent as a request header Klarna-Correlation-Id or a generated one. It can be used to contact Klarna for further integration support.

Examples

Request banks for an invalid country code

HTTP 400 Bad request
{
    "error_code": "COUNTY_CODE_INVALID",
    "error_messages": ["Invalid parameter country."],
    "correlation_id": "41636415-889d-47b7-9001-fea909b089a1"
}

Any of the request parameters is invalid

HTTP 400 Bad request
{
    "error_code": "VALIDATION_ERROR",
    "error_messages": ["size: must be less than or equal to 1000"],
    "correlation_id": "41636415-889d-47b7-9001-fea909b089a1"
}

API token is missing or invalid

HTTP 403 Forbidden
{
    "error_code": "API_TOKEN_INVALID",
    "error_messages": ["API token not valid!"],
    "correlation_id": "41636415-889d-47b7-9001-fea909b089a1"
}

Request banks for a country which is not supported

HTTP 404 Not found
{
    "error_code": "COUNTRY_NOT_FOUND",
    "error_messages": ["Country CN not supported"],
    "correlation_id": "41636415-889d-47b7-9001-fea909b089a1"
}

results matching ""

    No results matching ""