422, ask first.
Response
boolean
Whether a refund can be created right now. When
false, unavailable_reason says why and available_types is empty.Amount
The amount you may safely refund right now. This is authoritative — it already reserves in-flight refunds. A refund up to this value is guaranteed not to be rejected on balance grounds.
Amount
Total already refunded.
Amount
Total currently in-flight refunds — created but not yet completed.
boolean
Whether at least one refund is in flight. A payment carrying one cannot take another until it settles.
string[]
The refund types the remaining balance allows:
full, partial, or both.partial is absent when no amount smaller than the balance can be expressed in the currency. With a balance of one whole unit in a currency that has no minor unit, there is nothing between zero and the whole — only full is offered.string | null
How the reversal would be executed.
null when no refund is available.Why no refund can be created, or
null when one can. Human-readable; do not branch on the text.Example
Availability is a snapshot. Two refunds racing on the same payment are still serialised server-side, and the second is rejected on balance. Read availability to build the request, not to skip handling a
422.