Sample - Adyen Checkout API
POST/payments/{paymentPspReference}/refunds

Refund a captured payment

Refunds a payment that has been captured, and returns a unique reference for this request. You get the outcome of the request asynchronously, in a REFUND webhook.

You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount.

Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as cards, iDEAL, or Klarna.

If you want to refund a payment but are not sure whether it has been captured, use the /payments/{paymentPspReference}/reversals endpoint instead.

For more information, refer to Refund.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 10 body fields
paymentPspReferencestringrequired
The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment that you want to refund.
Idempotency-Keystringoptional
A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).
amountobjectrequired
The amount that you want to refund. The `currency` must match the currency used in authorisation, the `value` must be smaller than or equal to the authorised amount.
applicationInfoobjectoptional
Information about your application. For more details, see [Building Adyen solutions](https://docs.adyen.com/development-resources/building-adyen-solutions).
capturePspReferencestringoptional
This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the specific capture to refund.
enhancedSchemeDataobjectoptional
Enhanced scheme data that may be required for processing the payment. For example, airline information.
lineItemsarray<object>optional
Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.
merchantAccountstringrequired
The merchant account that is used to process the payment.
merchantRefundReasonstringoptional
The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER**
Allowed:FRAUDCUSTOMER REQUESTRETURNDUPLICATEOTHER
referencestringoptional
Your reference for the refund request. Maximum length: 80 characters.
splitsarray<object>optional
An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).
storestringoptional
The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails.

6 status codes
201Created - the request has been fulfilled and has resulted in one or more new resources being created.
amountobjectrequired
The refund amount.
capturePspReferencestringoptional
This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the specific capture to refund.
lineItemsarray<object>optional
Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.
merchantAccountstringrequired
The merchant account that is used to process the payment.
merchantRefundReasonstringoptional
Your reason for the refund request.
Allowed:FRAUDCUSTOMER REQUESTRETURNDUPLICATEOTHER
paymentPspReferencestringrequired
The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment to refund.
pspReferencestringrequired
Adyen's 16-character reference associated with the refund request.
referencestringoptional
Your reference for the refund request.
splitsarray<object>optional
An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).
statusstringrequired
The status of your request. This will always have the value **received**.
Allowed:received
storestringoptional
The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails.
400Bad Request - a problem reading or understanding the request.
additionalDataobjectoptional
Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.
errorCodestringoptional
The error code mapped to the error message.
errorTypestringoptional
The category of the error.
messagestringoptional
A short explanation of the issue.
pspReferencestringoptional
The PSP reference of the payment.
statusintegeroptional
The HTTP response status.
401Unauthorized - authentication required.
additionalDataobjectoptional
Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.
errorCodestringoptional
The error code mapped to the error message.
errorTypestringoptional
The category of the error.
messagestringoptional
A short explanation of the issue.
pspReferencestringoptional
The PSP reference of the payment.
statusintegeroptional
The HTTP response status.
403Forbidden - insufficient permissions to process the request.
additionalDataobjectoptional
Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.
errorCodestringoptional
The error code mapped to the error message.
errorTypestringoptional
The category of the error.
messagestringoptional
A short explanation of the issue.
pspReferencestringoptional
The PSP reference of the payment.
statusintegeroptional
The HTTP response status.
422Unprocessable Entity - a request validation error.
additionalDataobjectoptional
Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.
errorCodestringoptional
The error code mapped to the error message.
errorTypestringoptional
The category of the error.
messagestringoptional
A short explanation of the issue.
pspReferencestringoptional
The PSP reference of the payment.
statusintegeroptional
The HTTP response status.
500Internal Server Error - the server could not process the request.
additionalDataobjectoptional
Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.
errorCodestringoptional
The error code mapped to the error message.
errorTypestringoptional
The category of the error.
messagestringoptional
A short explanation of the issue.
pspReferencestringoptional
The PSP reference of the payment.
statusintegeroptional
The HTTP response status.

Error handling

A 400 is returned: Bad Request - a problem reading or understanding the request. A 401 is returned: Unauthorized - authentication required. A 403 is returned: Forbidden - insufficient permissions to process the request. A 422 is returned: Unprocessable Entity - a request validation error. A 500 is returned: Internal Server Error - the server could not process the request.