Invoice

Problems

Information when something goes wrong.

Edit "Problems" on GitHub

Problems

When performing operations against a resource in the Swedbank Pay API Platform, it will respond with a problem message that contain details of the error type if the request could not be successfully performed. Regardless of why the error occurred, the problem message will follow the same structure as specified in the Problem Details for HTTP APIs (RFC 7807) specification.

We generally use the problem message type and status code to identify the nature of the problem. The problems array contains objects with name and description that will often help narrow down the specifics of the problem, usually to the field in the request that was missing or contained invalid data.

The structure of a problem message will look like this:

Problem Example

1
2
3
4
5
6
7
8
9
10
11
{
    "type": "https://api.payex.com/psp/errordetail/<resource>/inputerror",
    "title": "There was an input error",
    "detail": "Please correct the errors and retry the request",
    "instance": "ec2a9b09-601a-42ae-8e33-a5737e1cf177",
    "status": 400,
    "problems": [{
        "name": "CreditCardParameters.Issuer",
        "description": "minimum one issuer must be enabled"
    }]
}
Field Type Description
type string The URL that identifies the error type. This is the only field usable for programmatic identification of the type of error! When dereferenced, it might lead you to a human readable description of the error and how it can be recovered from.
title string The title contains a human readable description of the error.
detail string A detailed, human readable description of the error and how you can recover from it.
instance string The identifier of the error instance. This might be of use to Swedbank Pay support personnel in order to find the exact error and the context it occurred in.
status integer The HTTP status code that the problem was served with.
action string The action indicates how the error can be recovered from.
problems array The array of problem detail objects.
name string The name of the field, header, object, entity or likewise that was erroneous.
description string The human readable description of what was wrong with the field, header, object, entity or likewise identified by name.

Common Problems

All common problem types will have a URL in the format https://api.payex.com/psp/errordetail/<error-type>. The URL is an identifier that you can hard-code and implement logic around. It is currently not not possible to dereference this URL, although that might be possible in the future.

Type Status Description
inputerror 400 The server cannot or will not process the request due to an apparent client error (e.g. malformed request syntax, size to large, invalid request).
configurationerror 403 A error relating to configuration issues.
forbidden 403 The request was valid, but the server is refusing the action. The necessary permissions to access the resource might be lacking.
notfound 404 The requested resource could not be found, but may be available in the future. Subsequent requests are permissible.
systemerror 500 A generic error message.

Invoice Problems

There are a few problems specific to the invoice resource that you may want to guard against in your integrations. All invoice error types will have the following URL structure:

https://api.payex.com/psp/errordetail/invoice/<error-type>

Invoice With New Assessment Flow

Type Status Description
InputError 400 Occurs if the input validation fails. The problem field will specify which parameter failed the validation.
Forbidden 403 Invalid authentication status for the requested method.
Forbidden 403 The authentication’s time limit has expired.
CreditNotApproved 403 Credit check or extension of credit check was rejected.
NotFound 404 The requested resource was not found.
SystemError 500 Unexpected error. The logs might provide further problem details.
SystemError 500 The requested method is not implemented fully by code, or not configured for the resource. The problem body will specify which.
SystemError 500 State of the resource is invalid for further progress.

Invoice Authentication Status Mapping - Assessment Flow

Type Status Description
ABORTEDIDENTIFICATION 403 Authentication aborted in BankID-app.
USERPREABORTED 403 User aborted before starting signing or authentication.
USERABORTED 403 Signing or authentication aborted from web.
TIMEOUTIDENTIFICATION 403 User haven’t completed authentication in time.
NATIONALIDENTIFIERMISMATCH 403 The Social Security Number provided in purchase did not match the Social Security Number from the BankID.
FAILED 403 Unclassified failure.
ERROR 502 Unexpected error.

Invoice Without Assessment Flow

Invoice transactions without SCA is only available in Norway, and only for merchants who have a special agreement with Swedbank Pay.

Type Status Description
inputerror 400 10 - ValidationWarning
inputerror 400 30 - ValidationError
inputerror 400 3010 - ClientRequestInvalid
forbidden 403 Any other error code
externalerror 500 No error code
externalerror 502 40 - Error
externalerror 502 50 - SystemConfigurationError
externalerror 502 60 - SystemError
externalerror 502 9999 - ServerOtherServer