> ## Documentation Index
> Fetch the complete documentation index at: https://docs.breet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Mock a trade (non-production only)

> Simulates an incoming deposit so you can test your integration without sending real crypto. **Only available when `X-Breet-Env` is `development`.** The wallet is identified by `walletAddress`; it must match the given asset. The trade is processed as if it came from the blockchain and will trigger the same webhooks and flows as a real deposit.



## OpenAPI

````yaml /api-reference/openapi.json post /trades/sell/mock-trade
openapi: 3.0.0
info:
  title: BREET PUBLIC API
  version: 1.0.0
  license:
    name: Proprietary
    url: https://breet.io/terms
servers:
  - url: https://api.breet.io/v1
security:
  - appId: []
    appSecret: []
    breetEnv: []
tags:
  - name: Crypto Wallet
    description: Generate and manage crypto wallet addresses for receiving deposits.
    x-group: Wallets and Deposits
  - name: Withdrawals
    description: >-
      ## Withdrawals


      To help protect your funds, withdrawals support an additional security
      layer through **IP whitelisting**.


      ### IP Whitelisting


      When IP whitelisting is enabled, all withdrawal requests must originate
      from an approved IP address. Any withdrawal request coming from an IP not
      on the whitelist will be automatically blocked.


      You can add up to **7 IP addresses** from your dashboard.


      This feature is recommended for:


      - Production servers
          
      - Preventing unauthorized withdrawal attempts
          

      ### How it works


      - Enable IP whitelisting from your dashboard
          
      - Add up to 7 trusted IP addresses
          
      - Only requests from those IPs will be allowed to initiate withdrawals
          

      If IP whitelisting is disabled, withdrawals can be initiated from any IP
      address.
  - name: Banks
    description: List, validate, add, and remove bank accounts for fiat withdrawals.
  - name: Transactions
    description: Retrieve deposit and trade transaction history.
  - name: Webhooks
    description: >-
      Inspect and retry **outgoing** webhooks we send to your server (trade and
      withdrawal events). Requires an active integration with API access (VIP
      partners). For **incoming** payload shapes and verification, see the
      Webhooks guide in the Guides tab.
  - name: Assets
    description: >-
      Retrieve the list of supported deposit/sell assets and their
      configuration.
  - name: Rates and Prices
    description: >-
      Get live market prices and calculate conversion rates. These endpoints are
      public and do not require authentication.
  - name: Account
    description: Retrieve and update integration account details and preferences.
  - name: Testing
    description: Endpoints for testing your integration in development.
  - name: Conversion
    description: >-
      Convert between USD and local fiat (NGN | GHS). Available for both user
      and integration (business) flows.
  - name: Wallet addresses
    description: >-
      Add and remove withdrawal (payout) wallet addresses. If the same address,
      network, and token are sent with a different label, the existing address
      is updated.
paths:
  /trades/sell/mock-trade:
    post:
      tags:
        - Testing
      summary: Mock a trade (non-production only)
      description: >-
        Simulates an incoming deposit so you can test your integration without
        sending real crypto. **Only available when `X-Breet-Env` is
        `development`.** The wallet is identified by `walletAddress`; it must
        match the given asset. The trade is processed as if it came from the
        blockchain and will trigger the same webhooks and flows as a real
        deposit.
      operationId: mockTrade
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - walletAddress
                - asset
                - amountInUSD
                - cryptoReceived
                - reference
                - txHash
              properties:
                walletAddress:
                  type: string
                  description: >-
                    The deposit wallet address (from Generate Wallet Address or
                    Fetch Wallet Addresses). Must belong to your integration and
                    match the asset.
                asset:
                  type: string
                  description: >-
                    Asset identifier (e.g. TRX_TEST, USDC_TEST3). Must match the
                    wallet's asset. Use GET /trades/assets for the list.
                amountInUSD:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                  description: Amount in USD (must be greater than zero).
                cryptoReceived:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                  description: Crypto amount received (must be greater than zero).
                reference:
                  type: string
                  description: >-
                    Unique reference for this mock transaction (e.g. UUID or
                    test ref).
                txHash:
                  type: string
                  description: Mock transaction hash for the deposit.
                sourceAddress:
                  type: string
                  description: Optional sender/source address for the mock deposit.
                confirmations:
                  type: integer
                  minimum: 1
                  description: >-
                    Optional number of confirmations to simulate (positive
                    integer).
            examples:
              minimal:
                summary: Minimal request
                value:
                  walletAddress: TV8dNYYBgL3xLbQcJLMBNavY4gYNqPF8Jv
                  asset: TRX_TEST
                  amountInUSD: 50
                  cryptoReceived: 500
                  reference: mock-ref-550e8400-e29b-41d4-a716-446655440000
                  txHash: 0xmock550e8400e29b41d4a716446655440000
              withOptionalFields:
                summary: With optional sourceAddress and confirmations
                value:
                  walletAddress: TV8dNYYBgL3xLbQcJLMBNavY4gYNqPF8Jv
                  asset: TRX_TEST
                  amountInUSD: 100
                  cryptoReceived: 1000
                  reference: mock-ref-660e8400-e29b-41d4-a716-446655440001
                  txHash: 0xmock660e8400e29b41d4a716446655440001
                  sourceAddress: TSource1234567890AbCdEfGhIjKlMnOpQr
                  confirmations: 12
      responses:
        '200':
          description: >-
            Mock trade initiated successfully; the trade will be processed
            asynchronously.
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    message: mock trade initiated
                    success: true
                    data: {}
                    meta: {}
                    summary: {}
                    stats: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Mock trade is not allowed in production. Use X-Breet-Env:
            development.
          content:
            application/json:
              example:
                success: false
                message: mock trade is not allowed in production
                meta: {}
                errors: []
                data: {}
        '404':
          description: Wallet not found for the given walletAddress and asset.
          content:
            application/json:
              example:
                success: false
                message: wallet not found
                meta: {}
                errors: []
                data: {}
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    Unauthorized:
      description: Invalid or missing API credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            notAuthenticated:
              summary: Missing credentials
              value:
                success: false
                message: you're not authenticated
                meta: {}
                errors: []
                data: {}
            wrongCredentials:
              summary: Invalid app ID or secret
              value:
                success: false
                message: wrong app id and secret combination
                meta: {}
                errors: []
                data: {}
    ValidationError:
      description: >-
        Request validation failed — check the errors array for field-level
        details
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: validation errors
            meta: {}
            errors:
              - message: Invalid value
                field: amount
                location: body
            data: {}
    InternalServerError:
      description: An unexpected server error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: something went wrong!
            meta: {}
            errors: []
            data: {}
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        meta:
          type: object
        errors:
          type: array
          items:
            type: object
        data:
          type: object
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID from the Breet dashboard
    appSecret:
      type: apiKey
      in: header
      name: x-app-secret
      description: Your application secret from the Breet dashboard
    breetEnv:
      type: apiKey
      in: header
      name: X-Breet-Env
      description: 'Environment selector: development or production'

````