> ## 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.

# Create QR Payment Order

> Create a QR payment order and return the prepay ID, QR content, and redirect URL.

## Overview

This page documents the `POST /v1/pay/transactions/native` 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.
* `qrContent` returns the content URL used to generate the QR code image, not a pre-rendered QR image itself.
* For shared signing rules, see [/global/api-reference/version/100/en/common/securityAndSignature](/global/api-reference/version/100/en/common/securityAndSignature).


## OpenAPI

````yaml global/api-reference/version/100/en/openapi/qrpay-openapi.json POST /v1/pay/transactions/native
openapi: 3.1.0
info:
  title: GatePay Web Payment API
  version: 1.0.0
  description: >-
    OpenAPI 3.1 specification for GatePay Web payment APIs, based on the English
    Web Payment documentation. It includes creating prepay orders, closing
    orders, querying order status, and refund-related APIs.
servers:
  - url: https://openplatform.gateapi.io
    description: Production
security: []
tags:
  - name: web-payment
    description: >-
      Web payment related APIs, including creating, closing, querying prepay
      orders and processing refunds.
paths:
  /v1/pay/transactions/native:
    post:
      tags:
        - web-payment
      summary: Create QR payment order
      description: >-
        Create a QR payment order and return the prepay ID, QR content, and
        redirect URL.
      operationId: createPrepayOrder
      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'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePrepayRequest'
            examples:
              default:
                summary: Basic example
                value:
                  merchantTradeNo: '118223456797'
                  currency: USDT
                  orderAmount: '1.9'
                  env:
                    terminalType: APP
                  goods:
                    goodsName: NF2T
                    goodsDetail: nef-book
                  orderExpireTime: 1660204248000
                  returnUrl: http://47.99.158.63:8205/payment/callback
      responses:
        '200':
          description: Prepay order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePrepayResponse'
              examples:
                success:
                  summary: Success response
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      prepayId: '50913213697495040'
                      terminalType: APP
                      expireTime: 1674100394000
                      qrContent: >-
                        http://openplatform.gate.io/qr/AjQHJ56mDQ26dtx5ftspl9usV9tlIA8iom35toXhX7Y=
                      location: >-
                        https://114.55.238.130:13555/webpay?prepayid=50913213697495040
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-SHA512 signature for request validation
      schema:
        type: string
        example: >-
          672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: >-
        Millisecond timestamp; the difference from server time must not exceed
        30 seconds.
      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: '3525756760'
  schemas:
    CreatePrepayRequest:
      type: object
      description: Request body for creating a Web payment prepay order.
      properties:
        merchantTradeNo:
          type: string
          description: Merchant order number, up to 100 bytes.
        currency:
          type: string
          description: Order currency, uppercase, such as USDT, BTC, etc.
        orderAmount:
          type: string
          description: Order amount, ranging from [0.0001, 5000000].
        fiatCurrency:
          type: string
          description: >-
            Fiat order currency in uppercase, such as EUR, GBP, USD, CNY, JPY,
            AUD, CAD, CHF.
        fiatAmount:
          type: string
          description: >-
            Fiat order amount. Minimum 0.01 with maximum precision of 2 decimal
            places.
        env:
          $ref: '#/components/schemas/Env'
        goods:
          $ref: '#/components/schemas/Goods'
        orderExpireTime:
          type: integer
          format: int64
          description: >-
            Order expiration time, UTC timestamp in milliseconds. Defaults to 1
            hour if omitted. If the provided value exceeds current time + 1 day,
            it is truncated to current time + 1 day.
        returnUrl:
          type: string
          description: >-
            The return URL for the order after successful payment, up to 256
            characters long.
        cancelUrl:
          type: string
          description: >-
            The return URL for the order after payment failure, up to 256
            characters long.
        channelId:
          type: string
          description: Client name.
      required:
        - merchantTradeNo
        - env
        - goods
    CreatePrepayResponse:
      type: object
      description: Response body for creating a prepay order.
      properties:
        status:
          type: string
          description: SUCCESS or FAIL.
        code:
          type: string
          description: Error code.
        errorMessage:
          type: string
          description: Error message.
        data:
          type: object
          description: Prepay order data.
          properties:
            prepayId:
              type: string
              description: Prepay ID.
            terminalType:
              type: string
              description: >-
                Transaction source. Available values: APP, WEB, WAP, MINIAPP,
                OTHERS.
            expireTime:
              type: integer
              format: int64
              description: >-
                Order expiration time in milliseconds. Defaults to 1 hour when
                orderExpireTime is omitted. If the provided value exceeds
                current time + 1 day, it is truncated to current time + 1 day.
            qrContent:
              type: string
              description: >-
                The API returns the URL for the order QR code, developers need
                to generate the QR code image themselves using this content.
            location:
              type: string
              description: The Web payment component redirect URL after creating the order.
          required:
            - prepayId
            - terminalType
            - expireTime
            - qrContent
            - location
      required:
        - status
        - code
    Env:
      type: object
      description: Transaction source information.
      properties:
        terminalType:
          type: string
          description: >-
            Transaction source. Available values: APP, WEB, WAP, MINIAPP,
            OTHERS.
      required:
        - terminalType
    Goods:
      type: object
      description: Goods information.
      properties:
        goodsName:
          type: string
          description: Goods name, up to 160 characters.
        goodsDetail:
          type: string
          description: Goods description, up to 256 characters.
      required:
        - goodsName

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.