> ## 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 /v1/pay/address/create` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

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

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示普通商户接口。
* 通用签名规则请参见 [/global/api-reference/version/100/cn/common/securityAndSignature](/global/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml global/api-reference/version/100/cn/openapi/address-payment-openapi.json POST /v1/pay/address/create
openapi: 3.0.1
info:
  title: GatePay 地址支付 API
  version: 1.0.0
  description: GatePay 地址支付接口（中文描述）
servers: []
security: []
paths:
  /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'
      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: 毫秒级时间戳，与服务端时间偏差不得超过30秒
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数
      schema:
        type: string
        example: '9578'
  schemas:
    CreateOrderRequest:
      type: object
      properties:
        merchantTradeNo:
          type: string
          description: 商户系统中的交易号
        currency:
          type: string
          description: >-
            加密货币币种。加密币下单时与 orderAmount 一并必传；纯法币下单（传 fiatCurrency +
            fiatAmount）时可省略，系统会换算为 USDT。须与 payCurrency 相同（未传 payCurrency 时以其回填）。
        orderAmount:
          type: string
          description: >-
            加密货币订单金额。加密币下单时与 currency 一并必传；纯法币下单（传 fiatCurrency +
            fiatAmount）时可省略。
        surchargeAmount:
          type: string
          description: 附加费用
        toleranceAmount:
          type: string
          description: 容差金额
        fiatCurrency:
          type: string
          description: >-
            法币币种，大写形式，如EUR、GBP、USD、CNY、JPY、AUD、CAD、CHF。纯法币下单时与 fiatAmount
            一并传入，并省略 currency/orderAmount。
        fiatAmount:
          type: string
          description: >-
            法币订单金额，最小值0.01，最高精度为2位。纯法币下单时与 fiatCurrency 一并传入，并省略
            currency/orderAmount。
        payCurrency:
          type: string
          description: 用户支付币种。可选；未传时自动回填为 currency。若传入则必须与 currency 相同。
        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: 客户名称
        payerEmail:
          type: string
          format: email
          description: 付款人邮箱。可选，当商户异常退款模式为自动退款时必传，用于异常支付场景的邮件通知（如少付催补、领取退款等）
          example: payer@example.com
      required:
        - merchantTradeNo
        - orderExpireTime
        - merchantUserId
        - chain
        - fullCurrType
    CreateOrderResponse:
      type: object
      properties:
        prepayId:
          type: string
          description: 预支付订单ID
        terminalType:
          type: string
          description: 终端类型
        expireTime:
          type: integer
          description: 过期时间
        chain:
          $ref: '#/components/schemas/ChainInfo'
    EnvRequest:
      type: object
      properties:
        terminalType:
          type: string
          description: 交易来源，可选值：APP、WEB、WAP、MINIAPP、OTHERS
    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: 带链币种
        memo:
          type: string
          description: 链上备注（memo）。部分链（如 TON）从收款地址中解析；无则不返回或为空。

````

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