Core concepts

Payouts

Payouts move merchant balance out to destinations you control. Use destination availability and idempotency for safe execution.

Create payout

Payouts move merchant balance out to destinations you control. Create payout once with a stable idempotency key.

curl $XPEND_BASE/v1/payouts \
  -H "Authorization: Bearer $XPEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: payout_2024_03_12_001" \
  -d '{
    "amount": "1000.00",
    "chain": "ethereum",
    "token": "USDT",
    "destination_address": "0x...",
    "payout_otp": "123456"
  }'

Check destination availability first

Use destination availability before rendering payout forms so users only see valid options for token, chain, and amount.

curl $XPEND_BASE/v1/payouts/destination-availability \
  -H "Authorization: Bearer $XPEND_SECRET_KEY"

Read and cancel

  • GET /v1/payouts/:id, read payout state.
  • POST /v1/payouts/:id/cancel, cancel payout if still cancellable.
  • Allow cancel only while payout is not terminal/executed.
  • Use webhooks (payout.completed, payout.failed) for async transitions.

Operational model

Payout OTP and admin workflows

For higher-risk merchant accounts, payout TOTP enrollment/status endpoints are available under merchant resources and should be wired into admin UX. Keep automation behind admin workflows and audit changes.