Card

Problems

schedule 4 min read

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).
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.
configurationerror 403 A error relating to configuration issues.

Card Problems

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

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

Contractual Problem Types

Type Status Description
cardbranddisabled 403 The card brand is disabled.
accountholdertyperejected 403 The account holder type is rejected.
cardtyperejected 403 The card type is rejected.
3dsecurerequired 403 The transaction was rejected by 3-D Secure.
authenticationstatusrejected 403 The authentication status was rejected.
frauddetected 403 The transaction was fraudulent.
3dsecuredeclined 403 3-D Secure declined the transaction.
velocitycheck 429 Indicates that the limit for how many times a card or different cards can be used for attempting a purchase has been reached.

Acquirer and 3-D Secure Problem Types

Type Status Description
3dsecureerror 400 3D Secure not working, try again some time later
cardblacklisted 400 Card blacklisted, the payer needs to contact their Card-issuing bank
paymenttokenerror 403 There was an error with the payment token.
carddeclined 403 The card was declined.
acquirererror 403 The acquirer responded with a generic error.
acquirercardblacklisted 403 Card blacklisted, the payer needs to contact their Card-issuing bank
acquirercardexpired 403 Wrong expire date or Card has expired and payer needs to contact their Card-issuing bank
acquirercardstolen 403 Card blacklisted, the payer needs to contact their Card-issuing bank
acquirerinsufficientfunds 403 Card does not have sufficient funds, the payer needs to contact their Card-issuing bank.
acquirerinvalidamount 403 Amount not valid by aquirer, contact support.ecom@payex.com
acquirerpossiblefraud 403 Transaction declined due to possible fraud, the payer needs to contact their Card-issuing bank.
3dsecureusercanceled 403 Transaction was Cancelled during 3DSecure verification
3dsecuredeclined 403 Transaction was declined during 3DSecure verification
frauddetected 403 Fraud detected, the payer needs to contact their Card-issuing bank.
badrequest 400 Bad request, try again after some time
internalservererror 500 Server error, try again after some time
3dsecureacquirergatewayerror 502 Problems reaching 3DSecure verification, try again after some time.
badgateway 502 Problems reaching the gateway, try again after some time
acquirergatewayerror 502 Problems reaching acquirers gateway, try again after some time
acquirergatewaytimeout 504 Problems reaching acquirers gateway, try again after some time