Refunds
Give a customer back all or part of a successful payment.
Preview
This part of the API is being built. This page is its design, so names and fields can still change. Direct charges, payments and webhooks already work.
Create a refund
POST/v1/refunds
Prop
Type
curl https://api.xtopay.co/v1/refunds \
-H "Authorization: Bearer sk_test_…" \
-H "Content-Type: application/json" \
-d '{ "payment": "XTP-7C9ADM3DKQF2", "amount": 100 }'{
"success": true,
"data": {
"id": "rfd_4k9m2x7q",
"payment": "XTP-7C9ADM3DKQF2",
"amount": 100,
"reason": null,
"status": "pending",
"created_at": "2026-10-24T11:02:00Z"
}
}The money goes back the way the customer paid. The refund's status becomes
succeeded, or failed with the money back in your balance, and the
payment's status becomes partially_refunded or refunded. You get the
payment.refunded webhook.
Good to know
- Refunds come out of your available balance. If there isn't enough, the
refund is refused with the code
insufficient_balance. - Xtopay's fee on the payment isn't returned.
- You can refund a payment in parts, up to what was paid.
Get a refund
GET/v1/refunds/{id}