Simulate payout settlement¶
TL;DR - Create payouts in dev exactly as in production - same wizard,
same API. Two differences: the OTP step accepts any 6-digit code, and
settlement takes seconds instead of days - automatic by default, or driven
step by step via the Simulation API, including forcing failed or
expired.
The OTP step¶
Any code works
At the confirmation step of a fiat payout, no
code is delivered to your phone in dev. Type any 6 digits - 000000
does the job. (Environments can be configured to require one specific
code instead; if yours is, your Magma contact will have shared it.)
Create the payout¶
Nothing differs until settlement. Use the dashboard wizard or the Product
API as documented in Fiat payouts and
Crypto-to-fiat payouts - customer in active
status, funded balance, recipient set up, fee preview, confirm.
Auto-settlement (the default)¶
With auto-advance on (the dev default), a fiat payout walks
pending → processing → completed on its own, one step every few seconds.
Crypto-to-fiat payouts go one better: the sandbox simulates the customer's
crypto arriving at the single-use deposit address, then settles.
To check which mode the sandbox is in:
The response includes an auto_advance flag. If you need deterministic,
step-by-step control for automated tests, ask your Magma contact to run
the sandbox with auto-advance off.
Advance a payout manually¶
Find the transaction id in the transactions list, then:
curl -X POST \
"https://dev.magma.builders/api/v1/sandbox/transactions/{id}/advance?to=completed" \
-H "Authorization: Bearer $TOKEN"
to |
Transaction status you'll see |
|---|---|
processing |
processing |
completed (default) |
completed - terminal |
failed |
failed - terminal |
expired |
expired - terminal; simulates the crypto deposit window lapsing before the customer paid |
deposit_received |
processing - crypto payouts only: the customer's crypto "arrived" at the deposit address |
Statuses are the production vocabulary - see the Status reference.
Transitions are one-way
Statuses only move forward; once a payout is completed, failed, or
expired it cannot be re-opened. And on an auto-advancing sandbox,
completed may win the race before your failed call lands. For a
failure demo that always works, block the customer first - see
Block or unblock a customer -
and watch the payout fail with a BLOCKED error.
Receipts¶
Once completed, the paper trail works as in production: the transaction
detail offers the PDF receipt, and exports include the payout - see
Export & receipts. Useful for demoing the
full story end to end.
What's next¶
- End-to-end walkthrough - this page is the closing steps of the full loop.
- Simulation API reference - auth, full endpoint table, errors.