Refund a transaction (partial or full)
Books an inverse transaction for the requested amount,
scaling every leg of the original (including legs in other
currencies) by amount / gross_in(currency). Banker’s
rounding; residual on the largest leg per currency, so the
new transaction is balanced per currency.
currency is the base currency the caller is refunding. For
single-currency originals it may be omitted and is inferred.
For multi-currency originals it is required; omitting it
returns refund_currency_required (422).
Sum of prior refunds is tracked per currency: a 100% USDC
refund does not block a later 100% BTC refund on a USDC+BTC
original. Refunds that would exceed the original’s remaining
amount in the requested currency return
partial_refund_exceeds_original (422). Idempotent on
Idempotency-Key.
Authorizations
Scopes
Headers
Required on writes. Stable identifier you choose. The same key
always returns the same transaction, forever. Can also be supplied as
idempotency_key in the request body. Header wins.
Allowed character set: A-Z, a-z, 0-9, _, :, ., -.
Max 255 bytes. Replays of an accepted key return the original
response with header Idempotent-Replayed: true so callers can
tell a replay from a freshly-committed result.
1 - 255^[A-Za-z0-9_:.\-]+$"pi_acme_1234_capture"
Query Parameters
Body
Response
Idempotency replay (original refund returned)