Test scenarios in sandbox

Sandbox runs the same payment and compliance flow as production, but no money moves. You trigger the events that would normally come from outside (an incoming deposit, an on-chain transfer), and a sandbox reviewer makes the decisions Stables compliance makes in production.

You choose the outcome with a scenario on the simulate request, or with test values the way you would use test card numbers: the amount of a payment, the sender wallet of a deposit, or a tag in a customer's email.

The sandbox reviewer waits a few seconds before it decides, so you can see the held state first. Listen for webhooks or poll the resource rather than expecting the final status in the simulate response.

Scenarios at a glance

AreaTest valueOutcome
TransferSimulate the deposit with scenario: completed (default)Completes
TransferSimulate the deposit with scenario: rfi_approvedHeld with a source-of-funds RFI. Approved once you answer it, then completes
TransferSimulate the deposit with scenario: rfi_rejectedHeld with a source-of-funds RFI. Rejected once you answer it, and the transfer fails
Transfer or payment routeWorth USD 1313.00 to 1313.99Held with a source-of-funds RFI. Approved once you answer it, then completes
Transfer or payment routeWorth USD 1314.00 to 1314.99Held with a source-of-funds RFI. Rejected once you answer it, and the payment fails
Payment route depositscenario: completed, failed or create_onlyDeposit paid out, failed, or recorded as pending
Balance depositSender is a whitelisted walletCredited
Balance depositSender is not whitelistedHeld for review, then approved and credited
Balance depositSender address ends in deadHeld for review, then rejected. Nothing is credited
Balance whitelisted walletWallet label contains +rejectRejected by review. Any other label is approved
Balance withdrawalAnyWaits for approval in the dashboard, as in production
Customer verificationEmail local part contains +kyc_retry or +kyc_reject, for example [email protected]A verification waiting for review is sent back for resubmission, or rejected. With any other email it is approved

For document-based verification outcomes, see Sandbox Test Documents.

Transfers

Simulate the deposit

After you create a transfer, it waits for the customer's deposit. Simulate that deposit to start processing:

POST /api/v1/transfers/{transferId}/sandbox/simulate-deposit
FieldTypeRequiredDescription
scenariostringNocompleted (default), rfi_approved or rfi_rejected. See Test an RFI.
from_addressstringNoSender wallet of the simulated crypto deposit. Used by the Travel Rule check on offramps.

The request needs an Idempotency-Key header. A 202 response means the deposit was accepted:

{
  "transfer_id": "8f0f6c1e-...",
  "simulation_id": "2b7d9a40-...",
  "scenario": "completed",
  "deposit_status": "completed"
}
curl -X POST "https://api.sandbox.stables.money/api/v1/transfers/{transferId}/sandbox/simulate-deposit" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "scenario": "rfi_approved" }'

Things to know:

  • The deposit is always for the transfer's full amount. You cannot simulate an under- or over-payment.
  • You can simulate a deposit once, while the transfer is still waiting for it. A second call, or a call on a transfer that has moved on, returns 409.
  • A transfer paid from your balance is funded when you create it, so there is no deposit to simulate and no scenario to pick.
  • After the deposit, conversion and payout always succeed in sandbox. The only way to make a transfer fail is an RFI that is rejected.

Offramps: the sender wallet

On an offramp, Stables runs a Travel Rule check against the wallet the crypto came from. If you leave from_address out, sandbox uses a sender wallet shaped for the deposit's network, so the check can pass. Pass from_address when you want to test with a specific wallet.

Test an RFI

Pick the outcome when you simulate the deposit:

  1. Create a transfer of any amount, funded by a deposit.
  2. Simulate the deposit with "scenario": "rfi_approved" (to test approval) or "scenario": "rfi_rejected" (to test rejection). The transfer is held: its compliance_hold object names the RFI and its outstanding requirements, and you receive rfi.created and transfer.action_required.
  3. Read the RFI with Get RFI and answer each requirement with Submit Evidence.
  4. A few seconds after the RFI reaches submitted, the sandbox reviewer decides it. With rfi_approved the RFI is approved and the transfer completes. With rfi_rejected it is rejected (final) and the transfer fails.

You can also choose the outcome with the amount. A transfer worth USD 1313.00 to 1313.99 when you create it is held and approved the same way, and one worth USD 1314.00 to 1314.99 is held and rejected, even if you simulate its deposit with completed. For USDC, USDT or USD, that is the amount you send. For other currencies, choose an amount whose USD value at the current rate lands in the middle of the range.

The reviewer only decides RFIs you have answered. An RFI you leave open stays open. See Requests for Information for the full RFI flow.

If an RFI scenario completes without an RFI, transaction risk checks are switched off for your sandbox organization. Contact [email protected] to switch them on.

Payment routes (virtual accounts)

Simulate an incoming bank deposit with:

POST /api/v1/customers/{customerId}/payment-routes/{virtualAccountId}/sandbox/simulate-deposit

See Setup a sandbox environment for the request fields. The scenario field picks the outcome:

scenarioOutcome
completed (default)The deposit is recorded and paid out to the payment route's destination
failedThe deposit is recorded and its collection fails
create_onlyThe deposit is recorded and left pending; nothing is paid out

Things to know:

  • completed and failed run the payout flow, so they need a virtual account that pays out automatically. create_only works on any virtual account.
  • The RFI ranges apply to deposits too. They are checked against the full deposit amount in USD, before fees.

Balance

Fund your balance without an on-chain transfer:

POST /api/v1/prefund/wallet/{network}/sandbox/simulate-deposit
FieldTypeRequiredDescription
amountstringYesAmount in major units, for example "250" or "250.5". At most 6 decimal places.
currencystringYesUSDC or USDT. Tron holds USDT only.
sender_addressstringNoOn-chain sender. Defaults to your first active whitelisted wallet on the network.
tx_hashstringNoTransaction hash to record. Defaults to a new one on each call.

The sender decides what happens:

  • Whitelisted wallet (or sender_address left out while you have one): credited.
  • Wallet that is not whitelisted: held for review, then approved and credited a few seconds later. If you have no whitelisted wallet on the network and leave sender_address out, this is what happens.
  • Address ending in dead: held for review, then rejected. Nothing is credited.

A 202 response returns the deposit_id that the ledger entry and webhooks carry:

{
  "deposit_id": "...",
  "tx_hash": "...",
  "workflow_id": "...",
  "status": "started"
}
curl -X POST "https://api.sandbox.stables.money/api/v1/prefund/wallet/polygon/sandbox/simulate-deposit" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "amount": "1000", "currency": "USDC" }'

Things to know:

  • You need an active deposit wallet on the network first. Without one, the call returns 409 with code PREFUND_WALLET_NOT_ACTIVE. See Balance Deposit Wallet.
  • Sending the same tx_hash again is idempotent: the response has status: "duplicate" and the original deposit is reused.
  • Withdrawals are never approved automatically. Approve them in the dashboard, as in production.

In the dashboard

The same simulations are available in the sandbox dashboard:

  • Transfers: open a transfer that is waiting for its deposit, click Simulate deposit, and choose Completes, RFI → approved or RFI → rejected. Transfers paid from your balance don't show it.
  • Payment routes: open a virtual account and use the Simulate tab.
  • Balances: go to Add funds, pick the coin and network, click Simulate deposit under the deposit address, and enter an amount. The dashboard credits the deposit from your first whitelisted wallet; to test review outcomes, call the API with sender_address.

If you don't see these buttons, ask an admin of your organization for permission to simulate sandbox deposits.

On this page