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

# List Orders (Paginated)

> Retrieves a paginated list of orders. Can optionally filter by order type (on-ramp or off-ramp).




## OpenAPI

````yaml /openapi.yaml get /api/v1/auth/orders
openapi: 3.1.0
info:
  title: EmaalCoin API
  description: >
    EmaalCoin API reference. These APIs power cryptocurrency exchange between
    USDT and Fiat trading.


    - **On-Ramp**: Buy USDT with fiat (KES) via mobile money (STK Push for
    Kenya)

    - **Off-Ramp**: Sell USDT for KES with mobile money payout (Kenya)

    - **Ethereum, TRON, and Solana**: Multi-chain wallet support

    - **Merchant Offers**: Create and manage trading offers

    - **OTC Flows**: Bank and mobile money deposits/withdrawals for merchants

    - **Pricing engine**: FX quotes and fee profiles for quote-backed orders and
    transfers

    - **P2P/B2B transfers**: Internal and external stablecoin sends (USDT/USDC)
    with optional pricing snapshots

    - **Stablecoin swaps**: Treasury-backed two-leg USDT ↔ USDC conversion with
    BitGo confirmation, inventory reservation, and automatic refunds

    - **Multisig**: Collaborative and platform-managed multisig flows for
    high-value B2B
  version: 1.1.0
servers:
  - url: https://crypto.westminister.tech
    description: Production API (requires DNS for this hostname).
  - url: http://13.42.110.185:8080
    description: >-
      UAT on EC2 (direct). Use this base when building proof PDF URLs if the
      production hostname does not resolve.
security: []
tags:
  - name: Pricing
    description: >-
      Commercial pricing profiles and FX rate quotes (admin). Used with orders
      and transfers for auditable snapshots.
  - name: Transfers
    description: >-
      P2P and B2B stablecoin transfers (USDT/USDC). Optional fiat-equivalent
      pricing fields. B2B multisig behavior depends on wallet registration
      (synchronous completion vs proposal flow).
  - name: Stablecoin Swaps
    description: >-
      Treasury-backed USDT ↔ USDC conversions for BitGo provider-managed wallets
      on `tron`, `ethereum`, or `solana`. Collection confirms before treasury
      payout starts. Completion requires both legs and dual-asset balance
      synchronization.
  - name: Multisig
    description: >-
      Multisig wallet registration and TRON proposal/confirm flows
      (vendor/admin).
  - name: Escrow Wallets
    description: Escrow pool wallet metadata for off-ramp and operations.
  - name: Users
    description: >-
      User-related operations (registration, lookup, updates, counts, status
      changes)
  - name: Wallets-Users
    description: User wallet operations (create, manage, query balances)
  - name: Offers
    description: Offer operations (create, read, list, counts)
  - name: Orders
    description: Order operations (create, update, list, counts, stats)
  - name: Payment
    description: Payment initiation operations
  - name: Merchants
    description: >
      Merchant (vendor) onboarding and hierarchy operations.

      USE **GET /API/V1/AUTH/MERCHANTS** WITH **PAGE_ID** AND **PAGE_SIZE** TO
      PAGE MASTER VENDORS.

      USE **GET /API/V1/AUTH/MERCHANTS/{MERCHANT_ID}** FOR ONE MASTER VENDOR,
      **MERCHANT_WALLETS**, AND ALL **SUBVENDOR** ROWS WITH **WALLETS** (FULL
      TREE).
  - name: OTC Deposits
    description: >
      OTC fiat-to-crypto deposits (bank or mobile money). Rows live in
      **`otc_deposits`**. Merchants create drafts or one-shot deposits.
      **admin**, **otc_officer**, or **treasury** list all deposits.

      B2B bank flow uses draft, quote, submit, proof, assign, claim, settlement,
      and audit. **`credited_to_address`** is the merchant on-chain wallet
      treasury credits (resolved from the default wallet for
      **`requested_network`** on the master merchant ledger user or any
      **sub-vendor** under that merchant).

      **`GET /api/v1/auth/otc/deposits`** backfills missing
      **`credited_to_address`**/**`to_wallet_id`** when a wallet can be
      resolved. One-shot **`POST /api/v1/auth/otc/deposits`** persists the
      payout address when **`requested_network`** is sent.

      Bank proof PDFs upload via `POST .../proof` and are viewed at **`GET
      /otc-deposits-proof/{deposit_id}/{file}.pdf`** (relative
      **`proof_url`**/**`file_url`** plus API base URL).

      Merchants may edit tab-1 draft fields with **`PATCH
      /api/v1/auth/otc/deposits/{id}/draft`** while **`status`** is **`draft`**.
  - name: OTC Withdrawals
    description: >-
      OTC crypto-to-fiat withdrawals (bank or mobile money). Merchants create.
      Admin approves and executes.
  - name: OTC Config
    description: OTC display config (bank details, mobile money paybill) for merchant UI
  - name: Fiat Currencies
    description: >
      Shared platform **fiat_currencies** catalog. **GET
      /api/v1/auth/fiat-currencies** lists active rows for UI pickers. **GET
      /api/v1/auth/fiat-currencies/admin** lists all rows including inactive
      (admin). Admin manages rows with **GET
      /api/v1/auth/fiat-currencies/{id}**, **POST
      /api/v1/auth/fiat-currencies**, **PATCH
      /api/v1/auth/fiat-currencies/{id}**, and **DELETE
      /api/v1/auth/fiat-currencies/{id}**. Use for OTC, pricing, orders,
      remittance, and backoffice — not under **`/otc/...`**. Prefer **PATCH**
      with **`is_active: false`** over delete when a currency is referenced.
  - name: Countries
    description: >-
      Shared platform **countries** catalog. Public **GET /api/v1/countries**
      lists active rows for pickers. Auth **GET /api/v1/auth/countries** returns
      the same active catalog. Admin manages rows with **GET
      /api/v1/auth/countries/admin**, **GET /api/v1/auth/countries/{id}**,
      **POST /api/v1/auth/countries**, **PATCH /api/v1/auth/countries/{id}**,
      and **DELETE /api/v1/auth/countries/{id}**.
  - name: Files
    description: Authenticated file uploads for OTC receipts and proof artifacts.
paths:
  /api/v1/auth/orders:
    get:
      tags:
        - Orders
      summary: List Orders (Paginated)
      description: >
        Retrieves a paginated list of orders. Can optionally filter by order
        type (on-ramp or off-ramp).
      parameters:
        - name: page_id
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
          description: Page number (1-indexed)
        - name: page_size
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: Number of orders per page
        - name: order_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - ON_RAMP_BUY
              - ON_RAMP_SELL
              - OFF_RAMP_BUY
              - OFF_RAMP_SELL
          description: |
            Filter orders by type. If not provided, returns all order types.
            - **ON_RAMP_BUY**: Customer buys crypto with fiat
            - **OFF_RAMP_SELL**: Customer sells crypto for fiat
      responses:
        '200':
          description: List of orders
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Order'
              examples:
                all_orders:
                  summary: All Orders (Mixed Types)
                  description: Response when order_type parameter is not provided
                  value:
                    - id: 233e6fe7-b022-42a6-b57e-37df3b36e93f
                      customer_id: b523ed51-a7e0-4c53-8ac2-3c0b7e1c9cd5
                      vendor_id: 5c81c005-1c52-4e0d-85e2-862ee1cdd4d0
                      offer_id: 7c9a9311-7e7d-4739-9abc-34f7db00ff19
                      usdt_amount: '1200.00000000'
                      fiat_amount: '175200.00'
                      fiat_currency: KES
                      wallet_address: 4.085896624744069e+47
                      status: pending
                      payment_method: mpesa
                      order_type: ON_RAMP_BUY
                      escrow_wallet_address:
                        String: ''
                        Valid: false
                      escrow_network:
                        String: ''
                        Valid: false
                      escrow_reference:
                        String: ''
                        Valid: false
                      payment_phone_number:
                        String: ''
                        Valid: false
                      created_at: '2025-12-12T07:47:59.755991Z'
                      updated_at: '2025-12-12T07:47:59.755991Z'
                    - id: 6079f8a3-a53d-4d92-9bce-088dc75b757a
                      customer_id: 8d09359f-325a-4ecf-998d-dbe5eda3a498
                      vendor_id: 7a4301b0-e04b-4102-a999-b17dada65509
                      offer_id: 0e16f8d4-e557-4343-848b-9be955ccf06c
                      usdt_amount: '799.99000000'
                      fiat_amount: '112798.59'
                      fiat_currency: KES
                      wallet_address: TPY7ewYk2eY9b4TTYkCHJH3Cqudh3NU6tM
                      status: awaiting_crypto
                      payment_method: mpesa
                      order_type: OFF_RAMP_SELL
                      escrow_wallet_address:
                        String: TPcmUBs1WrSbAXze9pb3DRMqbap9TyS4ov
                        Valid: true
                      escrow_network:
                        String: tron
                        Valid: true
                      escrow_reference:
                        String: 6d4da0a8-6996-4798-a78f-7296bb143088
                        Valid: true
                      payment_phone_number:
                        String: '254727648169'
                        Valid: true
                      created_at: '2025-12-12T15:42:19.580936Z'
                      updated_at: '2025-12-12T15:42:19.580936Z'
                on_ramp_orders:
                  summary: On-Ramp Orders Only (Filtered)
                  description: Response when order_type=ON_RAMP_BUY is provided
                  value:
                    - id: 233e6fe7-b022-42a6-b57e-37df3b36e93f
                      customer_id: b523ed51-a7e0-4c53-8ac2-3c0b7e1c9cd5
                      vendor_id: 5c81c005-1c52-4e0d-85e2-862ee1cdd4d0
                      offer_id: 7c9a9311-7e7d-4739-9abc-34f7db00ff19
                      usdt_amount: '1200.00000000'
                      fiat_amount: '175200.00'
                      fiat_currency: KES
                      wallet_address: 4.085896624744069e+47
                      status: pending
                      payment_method: mpesa
                      order_type: ON_RAMP_BUY
                      escrow_wallet_address:
                        String: ''
                        Valid: false
                      escrow_network:
                        String: ''
                        Valid: false
                      escrow_reference:
                        String: ''
                        Valid: false
                      payment_phone_number:
                        String: ''
                        Valid: false
                      created_at: '2025-12-12T07:47:59.755991Z'
                      updated_at: '2025-12-12T07:47:59.755991Z'
                off_ramp_orders:
                  summary: Off-Ramp Orders Only (Filtered)
                  description: Response when order_type=OFF_RAMP_SELL is provided
                  value:
                    - id: 6079f8a3-a53d-4d92-9bce-088dc75b757a
                      customer_id: 8d09359f-325a-4ecf-998d-dbe5eda3a498
                      vendor_id: 7a4301b0-e04b-4102-a999-b17dada65509
                      offer_id: 0e16f8d4-e557-4343-848b-9be955ccf06c
                      usdt_amount: '799.99000000'
                      fiat_amount: '112798.59'
                      fiat_currency: KES
                      wallet_address: TPY7ewYk2eY9b4TTYkCHJH3Cqudh3NU6tM
                      status: awaiting_crypto
                      payment_method: mpesa
                      order_type: OFF_RAMP_SELL
                      escrow_wallet_address:
                        String: TPcmUBs1WrSbAXze9pb3DRMqbap9TyS4ov
                        Valid: true
                      escrow_network:
                        String: tron
                        Valid: true
                      escrow_reference:
                        String: 6d4da0a8-6996-4798-a78f-7296bb143088
                        Valid: true
                      payment_phone_number:
                        String: '254727648169'
                        Valid: true
                      created_at: '2025-12-12T15:42:19.580936Z'
                      updated_at: '2025-12-12T15:42:19.580936Z'
components:
  schemas:
    Order:
      type: object
      properties:
        id:
          type: string
          format: uuid
        customer_id:
          type: string
          format: uuid
        vendor_id:
          type: string
          format: uuid
          description: Liquidity provider (publisher). API name vendor_id.
        offer_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Liquidity listing id. API name offer_id. Nullable for custodial
            remittance orders.
        asset:
          type: string
          nullable: true
        crypto_amount:
          type: string
        usdt_amount:
          type: string
          nullable: true
          description: Backward-compatible alias for crypto_amount
        fiat_amount:
          type: string
        fiat_currency:
          type: string
        wallet_address:
          type: string
        status:
          type: string
          enum:
            - pending
            - processing
            - confirming
            - completed
            - cancelled
            - failed
        payment_method:
          type: string
          description: e.g., mpesa
        payment_txn_id:
          $ref: '#/components/schemas/NullableString'
        blockchain_txn_hash:
          $ref: '#/components/schemas/NullableString'
        expires_at:
          type: string
          format: date-time
        completed_at:
          $ref: '#/components/schemas/NullableTime'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          $ref: '#/components/schemas/NullableTime'
        merchant_request_id:
          $ref: '#/components/schemas/NullableString'
        checkout_request_id:
          $ref: '#/components/schemas/NullableString'
        mpesa_receipt_number:
          $ref: '#/components/schemas/NullableString'
        payment_phone_number:
          $ref: '#/components/schemas/NullableString'
        order_type:
          type: string
          enum:
            - ON_RAMP_BUY
            - ON_RAMP_SELL
            - OFF_RAMP_BUY
            - OFF_RAMP_SELL
        order_subtype:
          type: string
          enum:
            - standard_onramp
            - standard_offramp
            - remittance_offramp
            - custodial_remittance_offramp
            - treasury_offramp
          description: >
            Distinguishes marketplace, remittance, custodial remittance, and
            company fiat-on-demand off-ramp flows.

            Legacy rows are backfilled as `standard_onramp`/`standard_offramp`.

            `treasury_offramp` has no offer_id. Vendor is the platform treasury.
        sender_name:
          $ref: '#/components/schemas/NullableString'
        sender_country:
          $ref: '#/components/schemas/NullableString'
        sender_phone:
          $ref: '#/components/schemas/NullableString'
        beneficiary_bank_name:
          $ref: '#/components/schemas/NullableString'
        beneficiary_bank_code:
          $ref: '#/components/schemas/NullableString'
        beneficiary_bank_branch:
          $ref: '#/components/schemas/NullableString'
        beneficiary_bank_address:
          $ref: '#/components/schemas/NullableString'
        beneficiary_account_name:
          $ref: '#/components/schemas/NullableString'
        beneficiary_account_number:
          $ref: '#/components/schemas/NullableString'
        beneficiary_swift_code:
          $ref: '#/components/schemas/NullableString'
        escrow_wallet_address:
          $ref: '#/components/schemas/NullableString'
        escrow_network:
          $ref: '#/components/schemas/NullableString'
        escrow_reference:
          $ref: '#/components/schemas/NullableString'
        deposit_tx_hash:
          $ref: '#/components/schemas/NullableString'
        deposit_confirmations:
          type: integer
        deposit_detected_at:
          $ref: '#/components/schemas/NullableTime'
    NullableString:
      type: object
      description: Database-style nullable string wrapper
      properties:
        String:
          type: string
          nullable: true
        Valid:
          type: boolean
    NullableTime:
      type: object
      description: Database-style nullable time wrapper
      properties:
        Time:
          type: string
          format: date-time
          nullable: true
        Valid:
          type: boolean

````