Mock trade (development only)
In development (X-Breet-Env: development), 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
- You already have at least one wallet address (from Generate Wallet Address or Fetch Wallet Addresses).
- You send a
POST /trades/sell/mock-traderequest 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
- 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):cURL example
Responses
| Status | Meaning |
|---|---|
| 200 | Mock trade accepted; processing runs asynchronously (same as a real deposit). |
| 403 | Mock trade is not allowed — you are in production or not using X-Breet-Env: development. |
| 404 | No wallet found for the given walletAddress and asset. Ensure the address exists and matches the asset (e.g. from Fetch Wallet Addresses). |
| 422 | Validation error (e.g. missing required field, invalid asset). Check the response body for details. |
Simulating withdrawal statuses (development only)
In development (X-Breet-Env: development), 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 areversed 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.
| Currency | reversed when amount ≤ | processing when amount = | completed otherwise |
|---|---|---|---|
| NGN | 5,000 | 10,000 | any other amount |
| GHS | 10 | 100 | any other amount |
| USD | 15 | 50 | any other amount |
- 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 atprocessingso you can test how your system handles a long-running processing state. - Any other amount →
withdrawal.pending→withdrawal.completed. Standard happy path.