Skip to main content

Mock trade (sandbox only)

In sandbox (X-Breet-Env: sandbox), you can simulate an incoming deposit without sending real crypto. This lets you:
  • Test webhooks and notification flows end-to-end
  • Verify auto-settlement and payout logic
  • Exercise your app against the same trade lifecycle as production

How it works

  1. You already have at least one wallet address (from Generate Wallet Address or Fetch Wallet Addresses).
  2. You send a POST /trades/sell/mock-trade request with:
    • walletAddress — the deposit address to credit
    • asset — must match that wallet’s asset (e.g. TRX_TEST)
    • amountInUSD, cryptoReceived — amounts for the mock deposit
    • reference, txHash — unique identifiers for the mock transaction
  3. The API enqueues the trade as if it had been received from the blockchain. Your webhooks and any downstream flows (e.g. auto-settlement) run as they would for a real deposit.

Example request

Full request and response details: Mock a trade (POST /trades/sell/mock-trade). Minimal body (required fields only):
With optional fields:

cURL example

Responses

After a successful request, you can confirm the trade and related webhooks in your dashboard and via your webhook endpoint.

Simulating withdrawal statuses (sandbox only)

In sandbox (X-Breet-Env: sandbox), the amount you submit on a withdrawal request decides the final status, so you can exercise each branch of the withdrawal lifecycle — reversed, processing, and completed.

Amount-based rules

Find the row for the currency you’re withdrawing in. To trigger a reversed withdrawal, send any amount at or below the value in the first column. To make it stop at processing, send the exact value in the second column. Any other amount will go straight through to completed.
  • At or below the failure threshold → withdrawal.pending → withdrawal.reversed. Use this to test refund handling.
  • Exactly the pending threshold → withdrawal.pending → withdrawal.processing. The withdrawal stops at processing so you can test how your system handles a long-running processing state.
  • Any other amount → withdrawal.pending → withdrawal.completed. Standard happy path.
These rules are scoped to sandbox only. In production, withdrawals run through the normal flow and the final status reflects the actual outcome.

Nothing reaches the blockchain

Sandbox withdrawals are simulated end to end. No funds move and nothing is broadcast to any chain.
The txHash on a completed sandbox withdrawal is synthetic. It will not resolve on any block explorer. Do not build checks that expect to find it on-chain.
UTXO fee quotes are the one exception. POST /payments/estimate-network-fee returns a real estimate in sandbox, priced against the testnet chain, so you can exercise the full quote-then-withdraw flow.

Use testnet destination addresses

In sandbox, walletAddress must be a testnet address for the chain you are withdrawing on. A mainnet address is rejected as an invalid wallet address, and the reverse holds in production.