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

# 下单

> 创建地址支付订单（直付或闪兑）

## 概述

本页说明 `POST /payment/open/institution/v1/pay/address/create` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

创建订单，订单币种和支付币种一致创建直付地址支付单，订单币种和支付币种不一致创建闪兑地址支付单

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示同一接口的机构路径版本。
* 机构侧请求需携带 `X-GatePay-On-Behalf-Of`，用于表示本次代理请求的账户上下文；在机构代理商户 API 中通常填写目标子账户 ID。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/address-payment-openapi.json POST /payment/open/institution/v1/pay/address/create
openapi: 3.0.1
info:
  title: GatePay 地址支付 API
  version: 1.0.0
  description: GatePay 地址支付接口（中文描述）
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/institution/v1/pay/address/create:
    post:
      summary: 创建订单
      description: 创建地址支付订单（直付或闪兑）
      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/CreateOrderRequest'
            example:
              merchantTradeNo: '93840202212210025'
              currency: BTC
              orderAmount: '2.1'
              env:
                terminalType: MINIAPP
              goods:
                goodsName: USDT_PAY_BTC_TEST
                goodsDetail: yc
              orderExpireTime: 1673410179000
              returnUrl: www.test1.com
              cancelUrl: www.test2.com
              merchantUserId: 1336974
              chain: BSC
              fullCurrType: BTC_BSC
              channelId: '123456'
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
              example:
                status: SUCCESS
                code: '000000'
                errorMessage: ''
                data:
                  prepayId: '47656656276819968'
                  terminalType: MINIAPP
                  expireTime: 1673410179000
                  chain:
                    chain_type: BSC
                    fullCurrType: USDT_BSC
                    address: '0x1699dB45Dc502A0395038265fCBC4Fa05d6afFBD'
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 签名
      schema:
        type: string
        example: 672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 时间戳（毫秒）
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数
      schema:
        type: string
        example: '9578'
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: >-
        必填代理归属请求头。请填写本次请求的发起方账户 ID；在机构代理商户 API 中通常填写目标子账户 ID，在机构代扣与划转接口中可填写机构账户
        ID 或子账户 ID。
  schemas:
    CreateOrderRequest:
      type: object
      properties:
        merchantTradeNo:
          type: string
          description: 商户系统中的交易号
        currency:
          type: string
          description: 订单币种
        orderAmount:
          type: string
          description: 订单金额
        surchargeAmount:
          type: string
          description: 附加费用
        toleranceAmount:
          type: string
          description: 容差金额
        fiatCurrency:
          type: string
          description: 法币币种，大写形式，如EUR、GBP、USD、CNY、JPY、AUD、CAD、CHF
        fiatAmount:
          type: string
          description: 法币订单金额，最小值0.01，最高精度为2位
        payCurrency:
          type: string
          description: 用户选择的支付币种，非闪兑单不需要传）
        env:
          $ref: '#/components/schemas/EnvRequest'
        goods:
          $ref: '#/components/schemas/GoodsRequest'
        orderExpireTime:
          type: integer
          description: 订单过期时间（毫秒）
        returnUrl:
          type: string
          description: 支付成功回调地址
        cancelUrl:
          type: string
          description: 取消支付回调地址
        merchantUserId:
          type: integer
          description: 商户用户ID
        chain:
          type: string
          description: 链名称
        fullCurrType:
          type: string
          description: 带链币种
        channelId:
          type: string
          description: 客户名称
      required:
        - merchantTradeNo
        - env
        - goods
        - orderExpireTime
        - merchantUserId
        - chain
        - fullCurrType
    CreateOrderResponse:
      type: object
      description: 响应参数
      properties:
        status:
          type: string
        code:
          type: string
        errorMessage:
          type: string
        data:
          type: object
          properties:
            prepayId:
              type: string
              description: 创建的支付单order id
            terminalType:
              type: string
              description: 创建订单的终端类型
            expireTime:
              type: integer
              format: int64
              description: 过期毫秒时间戳
            chain:
              $ref: '#/components/schemas/ChainInfo'
    EnvRequest:
      type: object
      properties:
        terminalType:
          type: string
          description: 交易来源，可选值：APP、WEB、WAP、MINIAPP、OTHERS
      required:
        - terminalType
    GoodsRequest:
      type: object
      properties:
        goodsName:
          type: string
          description: 商品名称
        goodsDetail:
          type: string
          description: 商品详情
    ChainInfo:
      type: object
      properties:
        chain_type:
          type: string
          description: 链名称
        address:
          type: string
          description: 收款地址
        fullCurrType:
          type: string
          description: 带链币种

````