409
payments.refund_not_allowedpaymentsRule R12This payment cannot be refunded for this amount
One refund rule covers several conditions, and detail says which one failed: the payment must be succeeded, succeeded_at must be within refund_window_days, the provider of the successful attempt must support refunds for the method, an installment payment must be refunded in full, and the new amount plus all refunds not rejected, canceled or failed must not exceed the payment.
Why the API refuses
WHEN RequestRefund is executed, THE SYSTEM SHALL reject it unless the payment status is succeeded, succeeded_at is within the tenant setting refund_window_days, the provider of the successful attempt supports refunds for the method, the amount equals the payment amount when the method is installment, and amount.minor plus the sum of refunds not in rejected, canceled or failed does not exceed the payment amount.
What to do
- Read
refunded_minoron the payment and subtract it fromamount.minorbefore asking: that difference is the most you can still refund. - Check
succeeded_atagainst the window before offering a refund button at all. - If the method cannot be refunded through the provider (
providers.refund_unsupported), the refund has to happen out of band; the API will not pretend otherwise.