Reverse a payment

Returns funds back to the customer by automatically performing the appropriate payment action depending on the payment's status.

For more information, see Reverse a payment.

Path Parameters
  • id
    Type: string Pattern: ^(pay)_(\w{26})$
    required

    The unique identifier for the payment.

Headers
  • Cko-Idempotency-Key
    Type: string

    An optional idempotency key for safely retrying payment requests

Body·
application/json
  • reference
    Type: string
    max length:  
    80

    An internal reference to identify the payment reversal.

    For American Express payment reversals, there is a 30-character limit.

  • metadata
    Type: object

    Stores additional information about the transaction with custom fields.

    You can only supply primitive data types with one level of depth. Fields of type object or array are not supported.

Responses
  • application/json
  • application/json
  • 401

    Unauthorized

  • 403

    Reversals not supported for this payment

  • 404

    Payment not found

  • application/json
  • 502

    Bad gateway

Request Example for post/payments/{id}/reversals
curl 'https://{prefix}.api.sandbox.checkout.com/payments/{id}/reversals' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "reference": "ORD-5023-4E89",
  "metadata": {
    "coupon_code": "NY2018",
    "partner_id": 123989
  }
}'
{
  "action_id": "act_y3oqhf46pyzuxjbcn2giaqnb44",
  "_links": {
    "payment": {
      "href": "https://{prefix}.api.checkout.com/payments/pay_y3oqhf46pyzuxjbcn2giaqnb44"
    }
  }
}