API Reference · Payments
Refund a payment
Refunds all or part of a payment back to the customer.
POST
/v1/payments/:id/refundOmit `amount` for a full refund. Partial refunds are allowed as long as the total refunded never exceeds the original amount. LuniPay also reverses the platform fee proportionally and emits `payment.refunded`.
Path parameters
idstringRequiredPayment id (`pay_…`).
Body parameters
amountintegerAmount to refund, in the smallest currency unit. Defaults to the full remaining amount.
reasonstringRefund reason shown on the dashboard.
Allowed values: duplicate fraudulent requested_by_customer
metadataobjectUp to 20 key/value pairs attached to the refund.
Errors
404
resource_missingNo payment exists with that id.
409
refund_exceeds_remainingRequested amount is greater than the remaining refundable balance.
409
payment_not_refundablePayment is not in a state that can be refunded (e.g., FAILED or already REFUNDED).