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

# Get a User's Orders

Fetches a paginated list of all orders associated with a user or account, providing visibility into historical and ongoing trades.


## OpenAPI

````yaml get /exchange/api/orders
openapi: 3.0.3
info:
  version: 2.1.0
  title: Onboard External API Gateway
  description: >-
    **Introduction**

    API Gateway for Onboard


    This specification describes API endpoints that are available to the public
    internet via the API gateway. The different endpoints require different
    authentication schemes, see documentation for what applies to the operation
    you want to access.


    **Errors**

    Uses conventional HTTP response codes to indicate success or failure. In

    general:
     
    - `2xx` status codes indicate success. Codes in the

    - `4xx` range

    indicate a client error (e.g. required parameters, failed request etc.).

    - `5xx` status codes indicate a server error occurred.
  contact:
    name: Nestcoin TechOps
    email: techops@nestcoin.com
  license:
    name: UNLICENSED
servers:
  - url: https://external.dev.onboardpay.co
    description: Gateway for external API on staging environment.
security: []
tags:
  - name: users-onboardapi
    description: Endpoints available to for merchants liquidity automation
  - name: users-users
    description: User related endpoints
  - name: users-partners
    description: Partner related endpoints
  - name: users-admin
    description: Back office related endpoints
  - name: users-user2fa
    description: User 2fa related endpoints
  - name: users-usernotifications
    description: User notifications related endpoints
  - name: users-merchantnetwork
    description: Merchant network endpoints
  - name: users-userauth
    description: Authentication endpoints
  - name: users-userservice
    description: Service endpoints
  - name: users-webhook
    description: webhook endpoints
paths:
  /exchange/api/orders:
    get:
      tags:
        - exchange-external-api
      summary: Retrieve list of exchange orders
      operationId: getExchangeOrdersExternal
      parameters:
        - name: from
          in: query
          description: 15-04-2022
          schema:
            type: string
            format: date
        - name: to
          in: query
          description: 15-08-2022
          schema:
            type: string
            format: date
        - name: size
          in: query
          schema:
            maximum: 100
            type: integer
            default: 20
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: transactionType
          in: query
          schema:
            $ref: '#/components/schemas/GetExchangeOrdersExternalTransactionTypeEnum'
        - name: statuses
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/GetExchangeOrdersExternalStatusesEnum'
        - name: token
          in: query
          schema:
            type: string
        - name: fiat
          in: query
          schema:
            type: string
        - name: network
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeOrdersResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '401':
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
      security:
        - authToken: []
components:
  schemas:
    GetExchangeOrdersExternalTransactionTypeEnum:
      type: string
      enum:
        - ONRAMP
        - OFFRAMP
    GetExchangeOrdersExternalStatusesEnum:
      type: string
      enum:
        - INITIATED
        - DEPOSITED
        - CONFIRMED
        - COMPLETED
        - PENDING
        - CANCELLED
        - IN_DISPUTE
        - AWAITING_ACCEPTANCE
    ExchangeOrdersResponse:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/ExchangeOrderDTO'
        pageNumber:
          type: integer
        pageSize:
          type: integer
        totalPages:
          type: integer
        totalOrders:
          type: integer
    ErrorMessageDto:
      description: >-
        Default error object for services. This gives consistent error object
        that all services may use.
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code
          example: UNKNOWN_ERROR
        message:
          type: string
          description: Descriptive error message
          example: Request could not be completed due to an error
        data:
          type: object
          description: Additional data for this error message.
          additionalProperties: true
          properties: {}
      x-common-model: ErrorMessageDto
    ExchangeOrderDTO:
      type: object
      properties:
        id:
          type: string
          format: uuid
        cexOrderId:
          minimum: 1
          type: integer
        apiKey:
          type: string
        lastWebhookSentAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        orderId:
          type: string
          format: uuid
        reference:
          type: string
          example: '0165359005113074501885'
        customerId:
          type: string
          format: uuid
        customerName:
          type: string
          example: John Doe
        offer:
          $ref: '#/components/schemas/OrderOfferDTO'
        escrowAddress:
          type: string
          description: Escrow address
          example: 1.2869144918162796e+48
        paymentChannelId:
          type: string
          example: BANK_TRANSFER_NIGERIA
        paymentMethod:
          type: object
          properties: {}
        buyerPaymentMethod:
          type: object
          properties: {}
        customerWallet:
          $ref: '#/components/schemas/WalletDTO'
        tokenAddress:
          type: string
          example: 0
        status:
          type: string
          enum:
            - INITIATED
            - DEPOSITED
            - CONFIRMED
            - COMPLETED
            - PENDING
            - CANCELLED
            - IN_DISPUTE
            - AWAITING_ACCEPTANCE
        createdAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        initiatedAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        depositedAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        confirmedAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        completedAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        cancelledAt:
          type: string
          format: date-time
          description: Timestamp field.
          x-faker: date.recent
        lockHash:
          type: string
          default: 'null'
        confirmationHash:
          type: string
          default: 'null'
        cancellationHash:
          type: string
          default: 'null'
    OrderOfferDTO:
      required:
        - networkId
        - partnerId
        - rate
        - token
        - tokenAmount
        - transactionType
      type: object
      properties:
        offerId:
          type: string
          format: uuid
        partnerId:
          type: string
          format: uuid
        transactionType:
          type: string
          enum:
            - ONRAMP
            - OFFRAMP
        rate:
          type: number
          example: 0.32
        networkId:
          type: string
          example: TRC20
        fiatSymbol:
          type: string
          example: NGN
        fiatAmount:
          type: number
          example: 120.5
        token:
          type: string
          example: USDT
        tokenAmount:
          type: number
          example: 120.5
        partnerDisplayName:
          type: string
          example: John Doe
    WalletDTO:
      type: object
      properties:
        walletAddress:
          type: string
          example: 0
        networkId:
          type: string
          example: bsc_testnet
        walletName:
          type: string
          example: My Trust Wallet
  securitySchemes:
    authToken:
      type: apiKey
      name: x-auth-token
      in: header

````