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
- Type: stringid
Pattern: ^(pay)_(\w{26})$requiredThe unique identifier for the payment.
Headers
- Type: stringCko
- Idempotency - Key An optional idempotency key for safely retrying payment requests
Body·
application/json
- Type: stringreferencemax length:80
An internal reference to identify the payment reversal.
For American Express payment reversals, there is a 30-character limit.
- Type: objectmetadata
Stores additional information about the transaction with custom fields.
You can only supply primitive data types with one level of depth. Fields of type
objectorarrayare 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"
}
}
}