Error handling

The ProCheckout API is RESTy. It makes good use of HTTP and the status codes described in RFC2616. If an error occurs you will receive a 4xx or 5xx status code and an Error structure detailing the error.

This is an example of an Error structure

{
	"code": 40009,
	"message":"Invalid minimum amount",
  	"reason":"Minimum amount doesnt match.",
  	"link":"http://developers.wallet.pt/errors/40009",
  	"tid":"39e26399-dd27-464e-b9ac-9355df84475c"
}

The fields in the Error structure are detailed here. Errors in the 10xxx range are technical errors resulting from integration issues or plataform issues, 20xxx errors are related to authentication and 40xxx errors are payment workflow errors. The error code list is in the following table.

Code Message
10001 Missing parameter
10002 Invalid parameter
10004 Resource not found
10005 Endpoint not found
10006 Endpoint deprecated
10007 Action not found
10009 Invalid Json format
10010 Invalid Content-Type
10013 Current state of the resource doesn’t allow the operation requested
19998 Down for maintenance!
19999 Internal Server Error. Try Again Later
20001 Valid authentication required
20002 Access denied
20004 Invalid credentials
20005 Invalid API KEY
20008 The service is unavailable at the moment, please, try again later!
20009 No more pin retries left.
40009 Invalid minimum amount
40010 Payment is not refundable
40012 The payment exceeds the max amount permitted
40013 The total amount per period was reached
40015 Exceeds the maximum amount
40016 Parent has some pending operations
40021 Payment error. Try again later