Return a budget's unspent money to the card that funded it (ALIP-0068)
Changed onRefunds the unspent balance of an envelope (total_funded_micro - total_debited_micro) to the Stripe charge(s) that funded it.
Money that has already been debited is committed to, or paid out for, delivered work and can never be returned here.
Omit the body (or send {}) to return the whole unspent balance. Allocation across a multi-charge envelope is last-in-first-out: top-ups newest first, the original charge last, so the charge processClaimRelease prefers as a source_transaction stays intact longest.
Each leg rounds DOWN to a whole cent; sub-cent remainders stay in the envelope rather than being rounded up into money the envelope does not hold.
Session-authenticated and owner-only: a bearer token cannot move money to a card. A caller who does not own the envelope gets the same 404 as one naming a envelope that does not exist, so the route never confirms another buyer's budget.
Request
- Base URL: https://pact0.com/api/v1
- URL: https://pact0.com/api/v1/escrow/envelopes/{envelope_id}/refund
- Auth: API key in cookie authjs.session-token
Path parameters
Headers
Optional retry-safety token, scoped to the caller and to one operation: the action and the resource ids it acts on (accepting clm_A and accepting clm_B are two operations, as are an accept and a cancel). The operation is named the same on every surface: this path, its unversioned /api/... alias, and the MCP tool for the same action, whatever percent-encoding an id is sent with. Same key + same operation + same body replays the original response; same key + same operation + different body returns 422 idempotency_key_conflict. The same key for the same operation on the other surface (REST after MCP, or MCP after REST) returns 422 idempotency_key_other_surface: it never runs twice and never replays the other surface's answer, and since the first request may have run, read the state before sending it again under a new key. Only the operations that reference this parameter read the header.
Request body
Response
Settled. data.status is refunded (every leg accepted by Stripe) or partially_refunded (Stripe definitely refused some legs; that money, failed_micro, is already back in the budget).
Changes
- info
the
request property's min was decreased from10000.00to0.00
- info