Skip to main content

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

  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):
{
  "walletAddress": "TV8dNYYBgL3xLbQcJLMBNavY4gYNqPF8Jv",
  "asset": "TRX_TEST",
  "amountInUSD": 50,
  "cryptoReceived": 500,
  "reference": "mock-ref-550e8400-e29b-41d4-a716-446655440000",
  "txHash": "0xmock550e8400e29b41d4a716446655440000"
}
With optional fields:
{
  "walletAddress": "TV8dNYYBgL3xLbQcJLMBNavY4gYNqPF8Jv",
  "asset": "TRX_TEST",
  "amountInUSD": 100,
  "cryptoReceived": 1000,
  "reference": "mock-ref-660e8400-e29b-41d4-a716-446655440001",
  "txHash": "0xmock660e8400e29b41d4a716446655440001",
  "sourceAddress": "TSource1234567890AbCdEfGhIjKlMnOpQr",
  "confirmations": 12
}

cURL example

curl -X POST "https://api.breet.io/v1/trades/sell/mock-trade" \
  -H "x-app-id: YOUR_APP_ID" \
  -H "x-app-secret: YOUR_APP_SECRET" \
  -H "X-Breet-Env: development" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "TV8dNYYBgL3xLbQcJLMBNavY4gYNqPF8Jv",
    "asset": "TRX_TEST",
    "amountInUSD": 50,
    "cryptoReceived": 500,
    "reference": "mock-ref-550e8400-e29b-41d4-a716-446655440000",
    "txHash": "0xmock550e8400e29b41d4a716446655440000"
  }'

Responses

StatusMeaning
200Mock trade accepted; processing runs asynchronously (same as a real deposit).
403Mock trade is not allowed — you are in production or not using X-Breet-Env: development.
404No wallet found for the given walletAddress and asset. Ensure the address exists and matches the asset (e.g. from Fetch Wallet Addresses).
422Validation error (e.g. missing required field, invalid asset). Check the response body for details.
After a successful request, you can confirm the trade and related webhooks in your dashboard and via your webhook endpoint.