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

# Query Checkout Order

> Query checkout order details by prepay ID or merchant trade number. Either prepayId or merchantTradeNo is required.

## Overview

This page documents the `GET /v2/pay/order/query` endpoint. The full schema, parameters, and examples are rendered from the linked OpenAPI definition above.

## Notes

* Authentication uses the standard GatePay signed headers.
* This page documents the standard merchant endpoint.
* Provide at least one of `prepayId` or `merchantTradeNo`.
* This endpoint returns the order-query payload directly and does not use the outer `bizType` / `bizStatus` callback envelope.
* For centralized payment orders, interpret `pay_amount` together with `orderAmount`.
* Treat this endpoint as the final confirmation and reconciliation source rather than something used only during exceptions.
* For shared signing rules, see [/api-reference/version/100/en/common/securityAndSignature](/api-reference/version/100/en/common/securityAndSignature).


## OpenAPI

````yaml /api-reference/version/100/en/openapi/checkout-payment-openapi.json GET /v2/pay/order/query
openapi: 3.1.0
info:
  title: GatePay API
  description: >-
    GatePay Checkout Payment API - Create orders at the cashier, process
    refunds, and query order/refund details.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /v2/pay/order/query:
    get:
      summary: Checkout Order Details
      description: >-
        Query checkout order details by prepay ID or merchant trade number.
        Either prepayId or merchantTradeNo is required.
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - $ref: '#/components/parameters/prepayId'
        - $ref: '#/components/parameters/merchantTradeNo'
      responses:
        '200':
          description: Order details retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/OrderQueryBizData'
                        description: Checkout order details
              examples:
                successResponse:
                  summary: Success Response
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      prepayId: '65466648727916544'
                      merchantId: '10002'
                      merchantTradeNo: '163'
                      transactionId: '65466648727916545'
                      goodsName: charge
                      currency: USDT
                      orderAmount: '118.75'
                      surchargeAmount: '0'
                      toleranceAmount: '0'
                      underpaidAmount: '0'
                      fiatCurrency: USD
                      fiatAmount: '100'
                      fiatRate: '1.1875'
                      status: PAID
                      createTime: 1677573665000
                      expireTime: 1677577265000
                      transactTime: 1677573665219
                      order_name: charge
                      pay_currency: USDT
                      pay_amount: '118.75'
                      expectCurrency: USDT
                      actualCurrency: USDT
                      actualAmount: '118.75'
                      rate: '1'
                      channelId: '123456'
                      address: '0x86608d3C9f979b98a3b2417216eD859d313E339D'
                      chain: MATIC
                      fullCurrType: USDT_MATIC
                      inUsdt: '118.75'
                      location: https://www.gate.com/cashier?prepayid=65466648727916544
                      merchantName: test merchant
                      returnUrl: https://lotkeys.com/tr/gate-payment-response
                      transaction_info:
                        done_amount: '118.75'
                        confirming_list: []
                      whiteBrandInfo:
                        logoUrl: https://example.com/logo.png
                        brand: GatePay
                        payWays: []
                      totalFeeAmount: '0'
                      totalSettleAmount: ''
                      payDetails: []
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: Merchant client ID, obtained from GatePay platform
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: HMAC-SHA256 signature for request validation
      schema:
        type: string
        example: >-
          672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: >-
        Timestamp in milliseconds, must not differ from server time by more than
        5 minutes
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: Random nonce for replay attack prevention
      schema:
        type: string
        example: '9578'
    prepayId:
      name: prepayId
      in: query
      required: false
      description: Pre-order ID (either prepayId or merchantTradeNo required)
      schema:
        type: string
    merchantTradeNo:
      name: merchantTradeNo
      in: query
      required: false
      description: Merchant order number (either prepayId or merchantTradeNo required)
      schema:
        type: string
  schemas:
    ApiResponse:
      type: object
      properties:
        status:
          type: string
          description: Payment status
        code:
          type: string
          description: Error code
        errorMessage:
          type: string
          description: Error message
    OrderQueryBizData:
      type: object
      properties:
        prepayId:
          type: string
          description: Pre-order ID
        merchantId:
          type: integer
          format: int64
          description: Merchant ID
        merchantTradeNo:
          type: string
          description: Merchant order number
        transactionId:
          type: string
          description: Transaction ID
        goodsName:
          type: string
          description: Goods name
        currency:
          type: string
          description: Order currency
        orderAmount:
          type: string
          description: Order amount
        surchargeAmount:
          type: string
          description: Surcharge amount
        toleranceAmount:
          type: string
          description: Tolerance amount
        underpaidAmount:
          type: string
          description: Underpaid amount
        fiatCurrency:
          type: string
          description: Fiat currency
        fiatAmount:
          type: string
          description: Fiat amount
        fiatRate:
          type: string
          description: Fiat exchange rate
        status:
          type: string
          description: Order status
          enum:
            - PENDING
            - PROCESS
            - PAID
            - EXPIRED
            - CANCELLED
            - ERROR
            - BLOCK
            - AUDITING
            - REJECTED
            - AUDIT_ERROR
        createTime:
          type: integer
          format: int64
          description: Create time in milliseconds
        expireTime:
          type: integer
          format: int64
          description: Expiration time in milliseconds
        transactTime:
          type: integer
          format: int64
          description: Transaction time in milliseconds
        order_name:
          type: string
          description: Order name
        pay_currency:
          type: string
          description: Payment currency
        pay_amount:
          type: string
          description: >-
            Payment amount; for centralized payment orders, this field
            represents the amount that should be paid and should be interpreted
            together with orderAmount
        expectCurrency:
          type: string
          description: Expected currency
        actualCurrency:
          type: string
          description: Actual currency
        actualAmount:
          type: string
          description: Actual amount
        rate:
          type: string
          description: Exchange rate
        channelId:
          type: string
          description: Channel ID
        address:
          type: string
          description: Deposit address
        appLogo:
          type: string
          description: App logo URL
        appName:
          type: string
          description: App name
        chain:
          type: string
          description: Chain name
        channel_type:
          type: string
          description: Channel type
        fromAddress:
          type: string
          description: Payer address
        fullCurrType:
          type: string
          description: Full currency type
        inUsdt:
          type: string
          description: Equivalent USDT amount
        location:
          type: string
          description: Payment URL
        merchantName:
          type: string
          description: Merchant name
        pay_account:
          type: string
          description: Payment account
        qrcode:
          type: string
          description: QR code content
        returnUrl:
          type: string
          description: Return URL
        scheme:
          type: string
          description: URL scheme
        showChainNameEn:
          type: string
          description: Chain name in English
        totalFee:
          type: string
          description: Total fee
        txHash:
          type: string
          description: Transaction hash
        transaction_info:
          $ref: '#/components/schemas/TransactionInfo'
        whiteBrandInfo:
          $ref: '#/components/schemas/WhiteBrandInfo'
        totalFeeAmount:
          type: string
          description: >-
            Cumulative fees charged. May be empty or `0` when payment flows are
            not settled, unpaid, or in centralized-payment-only scenarios, etc.
        totalSettleAmount:
          type: string
          description: >-
            Cumulative settled amount. May be empty when payment flows are not
            settled, etc.
        payDetails:
          type: array
          description: Payment information
          items:
            $ref: '#/components/schemas/OrderQueryPayDetail'
    TransactionInfo:
      type: object
      properties:
        done_amount:
          type: string
          description: Amount already confirmed
        confirming_list:
          type: array
          items:
            $ref: '#/components/schemas/ConfirmingItem'
          description: List of confirming transactions
    WhiteBrandInfo:
      type: object
      properties:
        logoUrl:
          type: string
          description: Logo URL
        brand:
          type: string
          description: Brand name
        payWays:
          type: array
          items:
            type: string
          description: Payment methods
    OrderQueryPayDetail:
      type: object
      description: >-
        Fee and settlement information for a single payment in the flow
        (payDetail).
      properties:
        transactionId:
          type: string
          description: Payment flow / transaction ID.
        payType:
          type: string
          description: 'Payment type: `GatePay` for Gate Pay, `Web3Pay` for Web3 payment.'
        payTime:
          type: string
          description: Payment time.
        payAmount:
          type: string
          description: Payment amount.
        payCurrency:
          type: string
          description: Payment currency
        feeAmount:
          type: string
          description: Fee amount.
        settleAmount:
          type: string
          description: Settled amount.
        settlementStatus:
          type: string
          description: 'Settlement status: `pending` not settled, `done` settled.'
    ConfirmingItem:
      type: object
      properties:
        amount:
          type: string
          description: Amount
        confirm:
          type: integer
          description: Confirmation count

````