Refund a payment

Use a refund to return a payment to a customer. Refunds can be made in the Hub or by using this API endpoint.

There are two types of refunds you might need to process:

  • Full refund
    A full refund returns the total amount of the payment to the customer — it can only be performed once.
  • Partial refund
    A partial refund returns a sum less than the captured amount. A payment can be refunded multiple times, but cannot exceed the original payment amount.

👍

Refunds are always processed in the same currency as the captured payment.

🚧

You cannot cancel a refund after it has been processed.

Overview

To process a refund successfully, you must provide the payment ID of the captured payment. You can find the ID:

  • In the response of the payment request
  • In the webhook notification

The requests are the same for partial and full refunds. Any refunds for less than the original captured amount will be considered partial refunds.

The request

Use the details below to set up your request.

Endpoints

Live

https://api.checkout.com/payments/{id}/refunds

Sandbox

https://api.sandbox.checkout.com/payments/{id}/refunds

Header and path parameters

Header

Value

Authorization Required

secret key

Use the valid secret key of your Checkout.com account. You can find this in the Hub.

Content-Type\ Required

application/json

Path

Value

id Required

The ID of the captured payment, embedded within the payment response (prefixed by pay_).

Body parameters

Field name

Description

amount Integer Optional

The amount to refund. If not specified, the full payment amount will be refunded.

reference\ String\ Optional

A reference you can later use to identify this refund request.

metadata\ Object\ Optional

A set of key/value pairs that you can attach to the refund request. It can be useful for storing additional information in a structured format.

Request example

{
  "reference": "ORD-5023-4E89",
  "metadata": {
    "coupon_code": "NY2018",
    "partner_id": 123989
  }
}

The response

A successful refund request returns a 202 Refund accepted response. However, if there was a problem with your request, you'll receive an error response.

Response examples

{
  "action_id": "act_y3oqhf46pyzuxjbcn2giaqnb44",
  "reference": "ORD-5023-4E89",
  "_links": {
    "payment": {
      "href": "https://api.checkout.com/payments/pay_y3oqhf46pyzuxjbcn2giaqnb44"
    }
  }
}
{
  "request_id": "0HL80RJLS76I7",
  "error_type": "request_invalid",
  "error_codes": [
    "payment_source_required"
  ]
}

Additional error responses:

  • 403 Refund not allowed
  • 404 Payment not found

Troubleshooting

Let's take a look at what might have happened — this checklist might help to identify the problem:

  • Is the refund amount higher than the original payment?
  • Has the payment already been refunded?
  • Did you send the authorization ID instead of the payment ID?

Can we help?

Thanks for using Checkout.com. If you need any help or support, then message our support team at [email protected].