No momento, esta página não está disponível em português
Tools-2 icon

HTTP status codes

Learn how to handle HTTP responses.

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 should build some logic to handle any errors that a request or the system may return.

HTTP responses

HTTP status code HTTP status message Adyen status message Notes
200

OK

Request processed normally

The request message has been successfully processed, and it has produced a response.
The response message varies, depending on the request method and the requested data.

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 input 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

It was not possible to retrieve the resource you requested at the specified location.
It may or may not become available again in the future.
Usually, this happens when the URL you pass with the request is incorrect.
You may make subsequent calls.
413

Payload too large

Request Entity Too Large

The body of your request was too large. The maximum request size is 10MB.
Send the request again with a size of less than 10MB.

422

Unprocessable Entity

Request validation error

The request is well-formed (syntactically correct), but semantically incorrect: the receiving server can read it, but it cannot understand it.

500

Internal Server Error

Server could not process request

The receiving server encountered an unexpected condition that prevents it from fulfilling the request.
Our servers may return a 500 status code also when the request is incorrect, for example because of a missing or not filled in mandatory field.

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 the  pspReference in the capture modification response.
    • The success field value is false, and the reason field includes a short message to explain the cause of the failure.

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 may need to reach out to us for 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

status

Integer

-white_check_mark-

Returns the HTTP status code.

errorCode

String

-white_check_mark-

Returns the Adyen code that is mapped to the error message.

message

String

-white_check_mark-

Returns the message, a short explanation of the issue.

errorType

String

-white_check_mark-

Returns the type of error that was encountered.

Allowed error types:

  • internal

  • validation

  • security

  • configuration

pspReference

String

-x-

Returns the PSP reference associated with this error.
If the pspReference is not present in the response body, check the HTTP headers of the response.

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.

See also