> ## 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 Native Pre-order

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

## Overview

This page documents the `POST /payment/open/institution/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.
* 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/institution/web-payment-openapi.json POST /payment/open/institution/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:
  /payment/open/institution/v1/pay/transactions/native:
    post:
      tags:
        - web-payment
      summary: Create prepay order
      description: >-
        Create a Web payment prepay order and return the prepay ID, QR content
        and Web payment component 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'
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
      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: '0'
                    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-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 be within 5 minutes of server time
      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'
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: >-
        Required delegated-subject header. Provide the initiating account ID for
        this request. For institution merchant APIs, this is typically the
        target sub-account ID; for institution charge and transfer APIs, it can
        be either an institution account ID or a sub-account ID.
  schemas:
    CreatePrepayRequest:
      type: object
      description: Request body for creating a Web payment prepay order.
      properties:
        merchantTradeNo:
          type: string
          description: Merchant order number, up to 32 bytes.
        currency:
          type: string
          description: Order currency, uppercase, such as USDT, BTC, etc.
        orderAmount:
          type: string
          description: Order amount, ranging from [0.0001, 500000].
        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.
        actualCurrency:
          type: string
          description: >-
            The actual currency requested by the merchant for settlement. Use
            this field to specify the actual incoming currency if the settlement
            currency requested by the merchant is different from the order
            currency.
        env:
          $ref: '#/components/schemas/Env'
        goods:
          $ref: '#/components/schemas/Goods'
        orderExpireTime:
          type: integer
          format: int64
          description: >-
            Order expiration time, UTC timestamp in milliseconds. If not set, it
            defaults to 1 hour, with a maximum expiration time of 1 hour.
        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. If not set, it defaults
                to 1 hour, with a maximum expiration time of 1 hour.
            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

````