Payments
Refund a payment
Refunds a payment if supported by the payment method.
For card payments, refund requests are processed asynchronously. You can use workflows to be notified if the refund is successful.
post/payments/{id}/refunds
Request
- Base URLhttps://{prefix}.api.sandbox.checkout.com
- Auth
- OAuth 2Client credentialsToken URLstringScopesgateway, gateway:payment-refunds
- or API key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
idstring required
The payment identifier
Headers
Cko-Idempotency-Keystring
An optional idempotency key for safely retrying payment requests
Request body
Example request
{
"amount": 6540,
"reference": "ORD-5023-4E89",
"amount_allocations": [
{
"id": "ent_w4jelhppmfiufdnatam37wrfc4",
"amount": 1000,
"reference": "ORD-5023-4E89",
"commission": {
"amount": 1000,
"percentage": 1.125
}
}
],
"capture_action_id": "act_fd3h6evhpn3uxdoqbuu3lqnqbm",
"items": [
{
"type": "digital",
"sub_type": "stablecoin",
"name": "Necklace",
"quantity": 2,
"unit_price": 50,
"reference": "858818ac",
"commodity_code": "DEF123",
"unit_of_measure": "metres",
"total_amount": 29000,
"tax_rate": 2000,
"tax_amount": 1000,
"discount_amount": 1000,
"wxpay_goods_id": "1001",
"service_ends_on": "2025-01-01T00:00:00.0000000",
"purchase_country": "GB",
"foreign_retailer_amount": 200
}
],
"destination": {
"account_type": "savings",
"account_number": "13654567455",
"bank_code": "123-456",
"branch_code": "6443",
"iban": "HU93116000060000000012345676",
"bban": "3704 0044 0532 0130 00",
"swift_bic": "37040044",
"country": "GB",
"account_holder": {
"type": "individual",
"first_name": "John",
"last_name": "Smith",
"company_name": "Test company",
"tax_id": "123456",
"date_of_birth": "1986-01-01T00:00:00.0000000",
"country_of_birth": "GB",
"residential_status": "resident",
"billing_address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"zip": "SW1A 1AA",
"country": "GB"
},
"phone": {
"country_code": "+1",
"number": "415 555 2671"
},
"identification": {
"type": "passport",
"number": "09876",
"issuing_country": "US"
},
"email": "test.user@checkout.com"
},
"bank": {
"name": "Lloyds TSB",
"branch": "Bournemouth",
"address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"zip": "SW1A 1AA",
"country": "GB"
}
}
},
"metadata": {
"coupon_code": "NY2018",
"partner_id": 123989
}
}Response
Payment is already refunded
Example response
{
"action_id": "act_y3oqhf46pyzuxjbcn2giaqnb44"
}Changes
No recorded changes to this operation across all 1 revision of this API.