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

# Retrieve an order

> Retrieves the full details of an existing order, including payment gateway information.



## OpenAPI

````yaml /openapi.yaml get /v1/orders/{id}
openapi: 3.1.0
info:
  title: Kyren Pay API
  description: >
    The Kyren Pay API enables merchants to accept payments from customers
    worldwide.

    Integrate checkout sessions, manage products, track orders, and handle
    webhooks.


    **Data types**: The API uses the following types for request/response data:

    - **string**: For text, identifiers, and **all amount/price fields** (e.g.
    `price`, `amount`, `platformFee`, `available`)
      to avoid floating-point precision issues. Use decimal format like `"9.99"`.
    - **integer**: For counts, pagination, and timestamps

    - **timestamp**: Unix timestamp in milliseconds (integer) for all time
    fields (e.g. `createdAt`, `paidAt`, `expiresAt`).
      Time parameters (e.g. `startDate`, `endDate`) also use Unix milliseconds.
  version: 1.0.0
  contact:
    name: Kyren Pay Support
    email: support@kyren.top
    url: https://kyren.top
servers:
  - url: https://api.kyren.top
    description: Production
  - url: https://staging-api.kyren.top
    description: Staging, available only with credentials issued by Kyren
security:
  - ApiKeyAuth: []
tags:
  - name: Config
    description: Retrieve platform configuration such as supported currencies.
  - name: Products
    description: Create and manage products that represent the goods or services you sell.
  - name: Checkouts
    description: Create checkout sessions to collect payments from your customers.
  - name: Orders
    description: View and manage orders created from completed checkout sessions.
  - name: Balance
    description: View your account balance and transaction history.
  - name: Epay Compatibility
    description: >
      Compatibility endpoints for existing integrations built on 易支付 API
      conventions.

      These endpoints use form/query parameters with `pid + sign` verification
      (MD5), not `x-api-key` header auth.
paths:
  /v1/orders/{id}:
    get:
      tags:
        - Orders
      summary: Retrieve an order
      description: >-
        Retrieves the full details of an existing order, including payment
        gateway information.
      operationId: getOrder
      parameters:
        - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          description: The order detail object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDetailResponseWrapper'
              example:
                code: 0
                message: success
                data:
                  id: order_def456
                  checkoutSessionId: cs_xyz789
                  productId: prod_abc123
                  customerEmail: customer@example.com
                  customerName: null
                  amount: '9.99'
                  currency: USD
                  platformFeeRate: '0.04'
                  platformFee: '0.40'
                  netAmount: '9.59'
                  settledAmount: '9.59'
                  settledCurrency: USD
                  exchangeRate: null
                  hkdExchangeRate: null
                  paymentMethod: CREDIT_CARD
                  paymentGateway: allinpay
                  gatewayOrderId: gw_001
                  gatewayTransactionId: txn_001
                  status: PAID
                  paidAt: 1736932500000
                  settledAt: null
                  payerIp: 203.0.113.1
                  metadata:
                    userId: user_456
                  createdAt: 1736932200000
                  updatedAt: 1736932500000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    ResourceId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The unique identifier of the resource
  schemas:
    OrderDetailResponseWrapper:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/OrderDetail'
    OrderDetail:
      allOf:
        - $ref: '#/components/schemas/Order'
        - type: object
          properties:
            checkoutSessionId:
              type: string
            paymentGateway:
              type: string
            gatewayOrderId:
              type: string
            gatewayTransactionId:
              type: string
              nullable: true
            settleDateTime:
              type: integer
              format: int64
              nullable: true
            payerIp:
              type: string
              nullable: true
            gatewayCallbackIp:
              type: string
              nullable: true
            clientUserAgent:
              type: string
              nullable: true
            gatewayPaidAmount:
              type: string
              nullable: true
            gatewayPaidCurrency:
              type: string
              nullable: true
            gatewayPaidAt:
              type: integer
              format: int64
              nullable: true
            cardNo:
              type: string
              nullable: true
            cardOrgn:
              type: string
              nullable: true
            localCurrency:
              type: string
              nullable: true
            localAmount:
              type: string
              nullable: true
            updatedAt:
              type: integer
              format: int64
              description: Unix timestamp in milliseconds
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        error:
          type: object
          properties:
            field:
              type: string
            reason:
              type: string
    Order:
      type: object
      properties:
        id:
          type: string
        productId:
          type: string
        customerEmail:
          type: string
        customerName:
          type: string
        amount:
          type: string
        currency:
          type: string
        platformFeeRate:
          type: string
          description: Platform fee rate (e.g. "0.04" for 4%)
        platformFee:
          type: string
          description: Platform fee charged by Kyren Pay
        netAmount:
          type: string
          description: Net amount after fees (amount - platformFee - paymentFee)
        settledAmount:
          type: string
          nullable: true
          description: Net amount converted to USD for settlement
        settledCurrency:
          type: string
          description: Settlement currency, always "USD"
        exchangeRate:
          type: string
          nullable: true
          description: >-
            Exchange rate used for currency conversion (null if payment currency
            is USD)
        hkdExchangeRate:
          type: string
          nullable: true
          description: >-
            Exchange rate from payment currency to HKD used by the payment
            gateway (null for HKD orders)
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethod'
        type:
          type: string
          enum:
            - PAYMENT
            - ONBOARDING_FEE
        status:
          $ref: '#/components/schemas/OrderStatus'
        paidAt:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp in milliseconds, null if not paid
        settledAt:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp in milliseconds, null if not settled
        metadata:
          type: object
          additionalProperties:
            type: string
        createdAt:
          type: integer
          format: int64
          description: Unix timestamp in milliseconds
    PaymentMethod:
      type: string
      enum:
        - CREDIT_CARD
        - APPLE_PAY
        - GOOGLE_PAY
        - WECHAT_PAY
        - ALIPAY
        - ALIPAY_HK
        - BOOST
        - TOUCH_N_GO_EWALLET
        - LINE_PAY
        - KREDIVO
        - GCASH
        - PAYNOW
        - CRYPTO
      description: The payment method used by the customer
    OrderStatus:
      type: string
      enum:
        - CREATING
        - PENDING
        - PAID
        - SETTLED
        - REFUNDED
        - DISPUTED
        - CHARGEBACK
        - FAILED
        - CLOSED
        - REVOKED
      description: |
        - `CREATING` — Order is being created while waiting for gateway result
        - `PENDING` — Order created, awaiting payment confirmation
        - `PAID` — Payment confirmed
        - `SETTLED` — Funds settled to merchant balance
        - `REFUNDED` — Order has been refunded
        - `DISPUTED` — Order is under dispute
        - `CHARGEBACK` — Card payment was charged back
        - `FAILED` — Payment failed
        - `CLOSED` — Order closed (expired or unpaid)
        - `REVOKED` — Order has been revoked
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            message: Unauthorized
    NotFound:
      description: Not found — the requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 404
            message: Not Found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >
        Your API key. Public production API-key endpoints accept `kyren_live_*`
        keys. Staging credentials are environment-specific and must be used only
        with the staging environment for which Kyren issued them.

````