When performing requests against the PayEx Checkout API, problems might occur. All problems will be served in the form of an application/problem+json (RFC 7807 Problem Detail) response. All problem responses will have a common structure, with the following properties:

Properties

Property DescriptionUse*
type
string

A URL describing the type of problem that occurred. To be treated as an exception class type. Can be trusted to not change between different instances of the same problem type.

title
string

The human readable title of the problem.

status
int

The HTTP status code of the response, included as a convenience for logging, etc.

detail
string
The human readable detail explaining the source of the problem and, if any, which actions you can perform to remedy the problem.
instance
string
(optional)
An optional identifier of the instance of the problem that occurred, useful for PayEx Support when debugging what the source of the problem might be. 
problems
array
(optional) 

An optional array of objects containing details about which JSON fields or similar in the request that had errors and a description of what the error was.

{
   "name": "...",
   "description": "..."
}

*Use: Whether hard coded, programmatic use of values in this property is encouraged or not.

Request Problems

Request problems within the HTTP status code range of 400 to 499 indicates that the request contains an error that needs to be fixed before the request can be retried against the PayEx Checkout API. Below is an example of a problem response you might get from PayEx Checkout:

{
 "type": "https://api.payex.com/psp/checkout/problems/validation",
 "title": "Validation error",
 "status": 400,
 "detail": "There was 1 error in the request. Please correct the problem(s) and repeat the request.",
 "instance": "1337",
 "problems": [
    {
     "name": "reference",
     "description": "The field reference must be a string with a maximum length of 40."
    }
  ]
}

Server Problems

Request problems within the HTTP status code range of 500 to 599 indicates that an unexpected error occurred in the server that it was unable to gracefully recover from. Below is an example of a problem response you might get from PayEx Checkout:

{
 "type": "https://api.payex.com/psp/checkout/problems/validation",
 "title": "An unexpected error occurred",
 "status": 500,
 "detail": "An unexpected error occurred. Please contact support.ecom@payex.com with the value of the instance field (1337) to have the problem resolved",
 "instance": "1337",
}
Created by Asbjørn Ulsberg on 2018/07/05 12:48
    

Tips

Did you know that you can improve XWiki? Take 5 minutes to fill this survey and help this open source project!

Need help?

If you need help with XWiki you can contact: