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

# Get order by order_id

> Retrieve an order's metadata using its 32-byte hex order_id (with or without 0x).

Fetch an order by its `order_id` (32-byte hex, with or without `0x`).

**Auth**
Requires `X-API-Key` and returns the order only if owned by the calling user (internal keys may bypass, depending on server policy).


## OpenAPI

````yaml api-reference/openapi.json get /orders/{order_id}
openapi: 3.1.0
info:
  title: Element Aggregator API for B2B
  description: >-
    The Element Aggregator acts as a bridge between fiat and blockchain smart
    contracts. It handles payment processing, event listening, and order
    management, ensuring seamless coordination between Web2 and Web3 ecosystems.
  version: 1.0.0
servers:
  - url: https://sandbox.elementpay.net
security: []
paths:
  /orders/{order_id}:
    get:
      tags:
        - Order Endpoints
      summary: Fetch order details by order_id
      description: >-
        Retrieve an order's metadata using its 32-byte hex order_id (with or
        without 0x).
      operationId: get_order_status_orders__order_id__get
      parameters:
        - name: order_id
          in: path
          required: true
          schema:
            type: string
            title: Order Id
      responses:
        '200':
          description: Order fetched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_OrderOut_'
              example:
                status: success
                message: Order fetched successfully
                data:
                  order_id: >-
                    95531bef5c8a3997d61f672193b73c458455b3d1649f37ec356e9db45676bc3c
                  status: PENDING
                  amount_crypto: 0.07536
                  amount_fiat: 10
                  currency: KES
                  exchange_rate: 132.6965
                  token: BASE_USDC(Testnet)
                  file_id: EPay-95531bef5c
                  phone_number: '254712531490'
                  creation_transaction_hash: >-
                    c69b5efb9852adcad851b8a7d778f922151a655d3cf04ebbc239202423bac6e6
                  order_type: OnRamp
                  wallet_address: '0x4f07419e6bfccf8d256e8ef803cc2653dfbb9558'
                  created_at: '2025-08-13T04:38:34.976Z'
                  updated_at: '2025-08-13T04:38:34.982Z'
        '400':
          description: Bad request
          content:
            application/json:
              examples:
                invalid_order_id:
                  summary: Invalid order_id format
                  value:
                    status: error
                    message: Invalid order_id format.
                    data:
                      field: order_id
                      value: abc123
        '401':
          description: Unauthorized / Missing or invalid API key
          content:
            application/json:
              example:
                status: error
                message: Unauthorized
        '404':
          description: Order not found
          content:
            application/json:
              example:
                status: error
                message: Order not found
                data:
                  order_id: >-
                    0x0000000000000000000000000000000000000000000000000000000000000000
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                status: error
                message: Internal error occurred
      security:
        - APIKeyHeader: []
components:
  schemas:
    ApiResponse_OrderOut_:
      properties:
        status:
          type: string
          enum:
            - success
            - error
          title: Status
        message:
          type: string
          title: Message
        data:
          anyOf:
            - $ref: '#/components/schemas/OrderOut'
            - type: 'null'
      type: object
      required:
        - status
        - message
      title: ApiResponse[OrderOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OrderOut:
      properties:
        order_id:
          type: string
          title: Order Id
        status:
          $ref: '#/components/schemas/OrderStatus'
        amount_crypto:
          type: number
          title: Amount Crypto
        amount_fiat:
          type: number
          title: Amount Fiat
        currency:
          type: string
          title: Currency
        exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Exchange Rate
        token:
          type: string
          title: Token
        invoice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Id
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
        creation_transaction_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Creation Transaction Hash
        settlement_transaction_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Settlement Transaction Hash
        refund_transaction_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Refund Transaction Hash
        order_type:
          $ref: '#/components/schemas/OrderType'
        wallet_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Wallet Address
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - order_id
        - status
        - amount_crypto
        - amount_fiat
        - currency
        - exchange_rate
        - token
        - invoice_id
        - file_id
        - phone_number
        - creation_transaction_hash
        - settlement_transaction_hash
        - refund_transaction_hash
        - order_type
        - wallet_address
        - created_at
        - updated_at
      title: OrderOut
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    OrderStatus:
      type: string
      enum:
        - pending
        - failed
        - settled
        - settled_unverified
        - refunded
      title: OrderStatus
    OrderType:
      type: integer
      enum:
        - 0
        - 1
      title: OrderType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````