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

# 创建入金订单

> 创建 OTC 法币入金订单。

## 概述

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

## 说明

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

## 使用建议

* 调用该接口前，应先获取仍在有效期内的 OTC 报价。
* 建议同时持久化保存 `orderId`，便于后续对账与查询。
* 接口返回的银行信息应视为结算指令，与订单快照一起保存。
* 不要把"创建订单"理解为"付款完成"，后续仍需线下汇款并确认已付款。
* **机构子账户**：在创建机构子账户的OTC入金订单前，必须先完成机构子账户KYB 认证。具体详见：[获取认证URL](/global/api-reference/version/100/cn/endpoint/institutional/getCertificationUrl)。


## OpenAPI

````yaml global/api-reference/version/100/cn/openapi/otc-fiat-openapi.json POST /payment/open/otc/api/recharge
openapi: 3.1.0
info:
  title: GatePay OTC 法币 API
  description: OTC 法币出金与入金 API 参考。
  version: 2.1.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/otc/api/recharge:
    post:
      summary: 创建 OTC 入金订单
      description: 创建 OTC 法币入金订单。
      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'
        - name: X-GatePay-On-Behalf-Of
          in: header
          required: false
          schema:
            type: string
          description: 机构子账户 UID。仅在机构代替子账户发起业务请求时传输；直连商户请求时不需要传输。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OtcRechargeRequest'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OtcRechargeResponse'
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      schema:
        type: string
      description: 用于标识调用应用的商户应用 ClientId。
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      schema:
        type: string
      description: 按 GatePay 签名规则生成的 HMAC 签名。
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      schema:
        type: string
      description: 毫秒级时间戳，与服务端时间偏差不得超过30秒
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      schema:
        type: string
      description: 与时间戳配合使用的随机串，用于防止重放攻击。
  schemas:
    OtcRechargeRequest:
      type: object
      properties:
        quoteToken:
          type: string
          description: 报价接口返回的报价 token。
        bankId:
          type: string
          description: 用于汇款的商户银行 ID。
        currency:
          type: string
          description: 要接收的数字货币币种。当前支持：USDT、USDC。
        amount:
          type: string
          description: 预计入账的数字货币数量。
        fiatCurrency:
          type: string
          description: 要支付的法币币种。当前支持：USD。
        fiatAmount:
          type: string
          description: 需要支付的法币金额。
        promoCode:
          type: string
          description: 可选优惠码。
      required:
        - quoteToken
        - bankId
        - currency
        - amount
        - fiatCurrency
        - fiatAmount
      example:
        quoteToken: qt_01JXYZABCDEF
        bankId: ba_123456789
        currency: USDT
        amount: '1088.42'
        fiatCurrency: USD
        fiatAmount: '1000'
    OtcRechargeResponse:
      type: object
      properties:
        code:
          type: string
          description: 业务响应码。
        status:
          type: string
          description: 请求顶层状态。
        errorMessage:
          type: string
          description: 请求失败时的错误信息。
        data:
          $ref: '#/components/schemas/OtcRechargeOrder'
          description: 创建的入金订单数据。
    OtcRechargeOrder:
      type: object
      properties:
        orderId:
          type: string
          description: Gate OTC 订单 ID。
        otcOrderId:
          type: string
          description: OTC 订单 ID。
        currency:
          type: string
          description: 数字货币币种。
        amount:
          type: string
          description: 数字货币数量。
        fiatCurrency:
          type: string
          description: 法币币种。
        fiatAmount:
          type: string
          description: 法币金额。
        cfRate:
          type: string
          description: 汇率。
        bankId:
          type: string
          description: 银行 ID。
        bankNumber:
          type: string
          description: 银行编号。
        paid:
          type: boolean
          description: 订单是否已付款。
        status:
          type: string
          description: 当前订单状态。
        card_info:
          $ref: '#/components/schemas/OtcCardInfo'
          description: Gate OTC 收款银行信息。
        createTime:
          type: integer
          format: int64
          description: 订单创建时间戳（毫秒）。
        promoCode:
          type: string
          description: 优惠码。
        transferRemark:
          type: string
          description: 必须在汇款时原样填写的附言。
        paymentReceiptFileUrl:
          type: string
          description: 付款凭证文件 URL。
        tradeFee:
          type: string
          description: 各费用项的合计金额。
        feeCurrency:
          type: string
          description: 各费用项的计价币种。
        feeDetail:
          type: array
          description: 费用明细。
          items:
            $ref: '#/components/schemas/OtcQuoteFeeDetail'
    OtcCardInfo:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: 卡信息记录 ID。
        uid:
          type: integer
          format: int64
          description: 商户 UID。
        entity:
          type: string
          description: 实体名称。
        bank_account_name:
          type: string
          description: 收款银行账户持有人名称。
        bank_name:
          type: string
          description: 收款银行名称。
        bank_country:
          type: string
          description: 收款银行所属国家。
        bank_address:
          type: string
          description: 收款银行地址。
        bank_code:
          type: string
          description: 银行代码。
        branch_code:
          type: string
          description: 支行代码。
        iban:
          type: string
          description: 收款 IBAN 或账号。
        swift:
          type: string
          description: 收款 SWIFT 或 BIC 代码。
        remittance_line_number:
          type: string
          description: 路由号或汇款线路号。
        agent_bank_name:
          type: string
          description: 如适用，代理银行名称。
        agent_bank_swift:
          type: string
          description: 如适用，代理银行 SWIFT。
        transferRemark:
          type: string
          description: 必须在汇款时原样填写的附言或付款备注。
        memo:
          type: string
          description: 备注。
        is_default:
          type: boolean
          description: 是否为默认卡。
        bank_id:
          type: string
          description: 银行 ID。
    OtcQuoteFeeDetail:
      type: object
      properties:
        feeType:
          type: string
          description: >-
            费用类型：`BANK` 银行渠道收取的费用，`GATE_PAY` Gate Pay 手续费金额，`SUBSIDY`
            优惠金额，从收取的费用中减免
        amount:
          type: string
          description: 该项金额。

````

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