After submitting an API call to Adyen, you receive a response back to inform you that your request was received and processed. Depending on the HTTP status code of the response, you can build some logic to handle any errors.
HTTP responses
HTTP status code | HTTP status message | Description |
---|---|---|
200 |
OK |
Request processed normally. The request message was successfully processed and produced a response. The response message varies, depending on the request method and the requested data. |
201 |
Created |
The request was successful and a new resource was created. |
202 |
Accepted |
The request was accepted, but has not been processed yet. This is not a guarantee that the request will be completed. |
204 |
No Content |
The server successfully fulfilled the request, and there is no additional content to send in the response. |
301 |
Moved Permanently |
The resource you requested moved to a different location. |
400 |
Bad Request |
Problem reading or understanding request. The receiving server cannot understand the request because of malformed syntax. Do not repeat the request without first modifying it. Check the request for errors, fix them, and then retry the request. |
401 |
Unauthorized |
Authentication required. You need to provide valid authentication credentials (username/password) to access the resource. |
403 |
Forbidden |
Insufficient permission to process request. You do not have the appropriate user rights to access the request. Do not repeat the request. |
404 |
Not Found |
File not found. The server could not retrieve the resource you requested at the specified location. It is possible that the resource becomes available in the future. Usually, this happens when the URL you pass with the request is incorrect. You can make subsequent calls. |
405 |
Method Not Allowed |
The target resource does not support this method. |
406 | Not Acceptable |
The server could not produce an acceptable response. |
408 |
Request Timeout |
The server did not receive a complete request message within a certain amount of time. You can retry the request. |
409 |
Conflict |
Resource is locked. A conflict occurred because the request was already processed or is in progress. Identify the reason for the conflict and resolve it. You can retry the request if the API returns a transient error header with value true. |
413 |
Payload too large |
The body of your request was too large. The maximum request size is 10 MB. Send the request again with a size of less than 10 MB. |
422 |
Request validation error. The request is well-formed (syntactically correct), but semantically incorrect: the receiving server can read the request, but cannot understand it. |
|
429 |
Too Many Requests |
You have sent too many requests in a short period. To handle this issue, implement a retry mechanism that uses exponential backoff with jitter. |
500 |
Internal Server Error |
Server could not process request. The receiving server encountered an unexpected condition that prevents it from fulfilling the request. You can also recieve a 500 status code when the request is incorrect, for example because of a missing or empty mandatory field. |
501 |
Not Implemented |
The server does not support the functionality required to complete the request. |
504 |
Gateway Timeout |
The server, acting as a gateway or proxy, did not get a response from the upstream server in time. |
Handle 200 responses
An HTTP 200/OK response status code means that the request was submitted correctly and Adyen processed it successfully. An HTTP 200 response does not automatically mean that the payment or the modification request was successfully executed.
When the payment response includes a resultCode
with a value of Refused
or Error
, a refusalReason
field is added. Check the refusal reason messages to learn more about the possible issues of the payment or the modification request.
For example:
- You send a capture payment request.
-
The response to your capture request returns HTTP 200/OK. This means:
- We received your request.
- We will execute a payment capture.
- We still do not know if the capture operation will be successful or not.
- We'll let you know in the corresponding webhook event.
- If the capture operation fails, for example, because the acquirer declines to accept the shopper's card, the payable amount for the transaction is not collected.
-
Based on your settings, you'll receive a webhook message that includes the information about this capture example:
- The
pspReference
in this notification is the same as thepspReference
in the capture modification response. - The
success
field value isfalse
, and thereason
field includes a short message to explain the cause of the failure.
- The
Handle 4xx and 5xx responses
In the following scenarios, the plataforma de pagamentos da Adyen does not accept or store submitted requests:
- The request does not pass validation.
- The request violates a security constraint.
- The request violates a configuration constraint.
- An internal error occurs on the plataforma de pagamentos da Adyen.
In these cases, you receive an error message with an error code containing a description of the problem.
In general, you should handle it as an exception.
There is no charge for rejected payment requests accompanied by an error message.
Debugging APIs
While building your integration into the Adyen APIs, you can reach out to us if you need additional help.
If you contact our Support Team, provide the pspReference
returned in the header of the API response. The pspReference
is a unique ID for that specific API request, and can be used by our Support Team to identify specific API calls.
Error response fields
In case of an error, the response object contains the following fields:
Field | Type | Required | Description |
---|---|---|---|
|
Integer |
|
Returns the HTTP status code. |
|
String |
|
Returns the Adyen code that is mapped to the error message. |
|
String |
|
Returns the message, a short explanation of the issue. |
|
String |
|
Returns the type of error that was encountered. Allowed error types:
|
|
String |
|
Returns the PSP reference associated with this error. |
The following example shows a possible error response:
{
"status" : 403,
"errorCode" : "901",
"message" : "Invalid Merchant Account",
"errorType" : "security"
}
For the complete list of error codes and corresponding messages, see Error codes and messages.