SET Crypto API Suite · Pay out
Top up an underfunded payout
POST/v1/payouts/{payout}/fund
Tops up a fixed-output payout that the provider reported as underfunded, from the payout's own custodial wallet. Once per shortfall.
Path parameters
payoutstringrequired- The payout's id,
po_…. An unknown id answers404 payout_unknown.
Headers
Idempotency-Keystring- Any unique string, so a retry runs once. See Idempotency.
Body
amountstring- USDC, dollars and cents as a string, for example
"10.00". It defaults tounderfundedByand may be more; less answers400 amount_too_small.
Notes
- Needs the
writescope. Any account type. POST /v1/payouts/{payout}/fundapplies only to fixed-output payouts: those created withdestinationAmount, which SET switches on per deployment (features.fixedOutputPayouts; otherwise creating one answers503 fixed_output_payouts_disabled).- A fixed-output payout is underfunded when the rate moves before the provider takes the funds.
- The payout must be in state
underfundedwithunderfundedByset (409 payout_not_underfunded). - The payout's wallet must hold enough USDC (
409 balance_too_low). - What the conversion does not need comes back as fee credit.
- The top-up is a second transfer from the payout's wallet into the payout's first transfer.
- The answer is the payout plus
funding(id,amount,transfer). The state staysunderfundeduntil the provider applies the top-up;underfundedByreadsnull. - A second call for the same shortfall answers
409 funding_already_sent; if the provider reports a new shortfall, it can be topped up again. - Event
payout.funding_sent. - A self-custody wallet's payout is never underfunded this way.
- The example was made with a sandbox key; the provider's report of a 10.00 shortfall was simulated, since the sandbox cannot move a rate.
- This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
404 payout_unknown409 payout_not_underfunded400 amount_invalid400 amount_too_small503 custodial_wallets_disabled403 operator_cannot_pay_out403 restricted409 initiation_required409 balance_too_low409 recipient_incomplete409 funding_already_sent