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

# Simulate partner transaction lifecycle events in non-production

> Sandbox-only endpoint for simulating partner transaction lifecycle events. You must first create a transaction and pass its returned `id` as `transaction_id` in the request body. This route is mounted only in non-production environments and hard-rejects when called against production state.



## OpenAPI

````yaml /openapi/openapi.json post /partner/sandbox/simulate
openapi: 3.1.0
info:
  title: CashWeb Partner API
  description: >-
    CashWeb Partner API enables crypto-to-fiat offramp transactions. Create
    quotes, manage transactions, receive lifecycle webhooks, and reconcile
    revenue.
  contact:
    name: Michael Anyi
    email: michael@cashweb.cash
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api-staging.cashweb.cash/api/v1
    description: Staging environment
  - url: https://api.cashweb.cash/api/v1
    description: Production environment
security: []
paths:
  /partner/sandbox/simulate:
    post:
      tags:
        - Partner API
      summary: Simulate partner transaction lifecycle events in non-production
      description: >-
        Sandbox-only endpoint for simulating partner transaction lifecycle
        events. You must first create a transaction and pass its returned `id`
        as `transaction_id` in the request body. This route is mounted only in
        non-production environments and hard-rejects when called against
        production state.
      operationId: simulate_transaction_event
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerSandboxSimulateRequest'
        required: true
      responses:
        '200':
          description: Sandbox event simulated
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiResponse_PartnerTransactionDetailsResponse
              example:
                data:
                  amount: '49000.00'
                  confirmations: 1
                  confirmed_at: '2026-02-12T12:01:00Z'
                  created_at: '2026-02-12T11:55:00Z'
                  crypto_amount: '100.00'
                  crypto_currency: usdt
                  deposit_address: TUr4xexampleaddress
                  deposit_id: dep_sandbox_001
                  deposit_status: confirmed
                  expires_at: '2026-02-12T12:30:00Z'
                  id: 01917f00-7b4c-7f56-8a2b-15998d58c9f3
                  merchant_id: mrc_001
                  merchant_reference: order-4551
                  network: trc20
                  rate: '490.00'
                  received_at: '2026-02-12T11:58:00Z'
                  required_confirmations: 1
                  status: deposit_confirming
                  terminal_id: term_01
                  updated_at: '2026-02-12T12:01:00Z'
                success: true
        '400':
          description: Invalid sandbox simulation request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: >-
                    event must be one of deposit.detected, deposit.confirmed,
                    transaction.completed, transaction.failed,
                    transaction.expired, transaction.refunded, payout.settled
                  timestamp: '2026-02-12T12:00:00Z'
        '401':
          description: Missing or invalid partner API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Sandbox simulation disabled in production
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: transaction_id not found for this partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Invalid state transition for requested sandbox event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - PartnerApiKey: []
components:
  schemas:
    PartnerSandboxSimulateRequest:
      type: object
      description: >-
        Sandbox-only request for simulating partner transaction lifecycle
        events.
      required:
        - transaction_id
        - event
      properties:
        blockchain_hash:
          type:
            - string
            - 'null'
          description: Optional blockchain hash override for deposit simulations.
          example: 0xabc123sandboxhash
        deposit_id:
          type:
            - string
            - 'null'
          description: Optional sandbox deposit identifier override.
          example: dep_sandbox_001
        event:
          type: string
          description: Consumer-facing event type to simulate.
          example: deposit.detected
        transaction_id:
          type: string
          format: uuid
          description: Partner transaction identifier to simulate against.
          example: 01917f00-7b4c-7f56-8a2b-15998d58c9f3
    ApiResponse_PartnerTransactionDetailsResponse:
      type: object
      description: Standard API response wrapper for all successful responses
      required:
        - success
        - data
      properties:
        data:
          type: object
          description: Detailed partner transaction snapshot for TSQ and recovery reads.
          required:
            - id
            - deposit_address
            - network
            - expires_at
            - status
            - crypto_currency
            - crypto_amount
            - rate
            - amount
            - deposit_status
            - created_at
            - updated_at
          properties:
            amount:
              type: string
              description: Fiat amount in NGN derived at create time.
              example: '161500.00'
            confirmations:
              type:
                - integer
                - 'null'
              format: int32
              description: Latest observed confirmation count.
              example: 1
            confirmed_at:
              type:
                - string
                - 'null'
              format: date-time
              description: Deposit confirmed timestamp in UTC RFC3339.
              example: '2026-02-12T12:01:00Z'
            created_at:
              type: string
              format: date-time
              description: Transaction creation timestamp in UTC RFC3339.
              example: '2026-02-12T11:55:00Z'
            crypto_amount:
              type: string
              description: Crypto amount in token units.
              example: '100.00'
            crypto_currency:
              type: string
              description: Token for this transaction.
              example: usdt
            deposit_address:
              type: string
              description: >-
                Deposit address where the seller should send funds for this
                transaction.
              example: '0x9d8D32b6D7DfDdAb66f6a79b9dA8fA2E30A91B7a'
            deposit_id:
              type:
                - string
                - 'null'
              description: Provider deposit identifier when a deposit has been detected.
              example: dep_abc123
            deposit_status:
              type: string
              description: Latest known deposit status.
              example: confirmed
            expires_at:
              type: string
              format: date-time
              description: >-
                Deposit deadline. Deposits after this timestamp may require
                manual recovery.
              example: '2026-02-12T12:00:00Z'
            id:
              type: string
              format: uuid
              example: 01917f00-7b4c-7f56-8a2b-15998d58c9f3
            merchant_id:
              type:
                - string
                - 'null'
              description: Partner-provided merchant identifier.
              example: mrc_001
            merchant_reference:
              type:
                - string
                - 'null'
              description: >-
                Partner-owned canonical reference used for timeout recovery and
                reconciliation.
              example: order-4551
            network:
              type: string
              description: Network expected for the deposit address.
              example: bep20
            rate:
              type: string
              description: Executable partner rate in NGN per token.
              example: '1615.00'
            received_at:
              type:
                - string
                - 'null'
              format: date-time
              description: Deposit received timestamp in UTC RFC3339.
              example: '2026-02-12T11:58:00Z'
            required_confirmations:
              type:
                - integer
                - 'null'
              format: int32
              description: Required confirmation count for final crediting.
              example: 1
            status:
              type: string
              description: >-
                Current transaction lifecycle status.

                Allowed values: pending, awaiting_deposit, deposit_confirming,
                selling_crypto, order_filled,

                completed, failed, expired, cancelled, refunded.
              example: deposit_confirming
            terminal_id:
              type:
                - string
                - 'null'
              description: Partner-provided terminal identifier.
              example: term_01
            updated_at:
              type: string
              format: date-time
              description: Last transaction update timestamp in UTC RFC3339.
              example: '2026-02-12T12:04:10Z'
        message:
          type:
            - string
            - 'null'
          description: Optional message for additional information
        success:
          type: boolean
          description: Indicates if the request was successful
          example: 'true'
    ErrorResponse:
      type: object
      description: Error response structure for OpenAPI documentation
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: Error details
    ErrorDetails:
      type: object
      description: Error details structure
      required:
        - message
        - code
        - timestamp
      properties:
        code:
          type: string
          description: Machine-readable error code
        message:
          type: string
          description: Human-readable error message
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the error occurred
  securitySchemes:
    PartnerApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````