> ## 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 报价

> 获取用于 OTC 出金流程的法币与数字货币报价。

## 概述

本页说明 OTC 入金与出金共用的报价接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 使用 `type=BUY` 表示入金，使用 `type=SELL` 表示出金。
* 本页展示普通商户接口。
* 通用签名规则请参见 [/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/otc-fiat-openapi.json POST /withdraw/open/otc/api/v1/quote
openapi: 3.1.0
info:
  title: GatePay OTC 法币 API
  description: OTC 法币出金与入金 API 参考。
  version: 2.1.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /withdraw/open/otc/api/v1/quote:
    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/QuoteRequest'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteResponse'
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:
    QuoteRequest:
      type: object
      properties:
        cryptoCurrency:
          type: string
          description: 询价中使用的数字货币币种代码。入金支持：USDT、USDC；出金支持：USDT、USDC。
        fiatCurrency:
          type: string
          description: 询价中使用的法币币种代码。当前支持：USD。
        cryptoAmount:
          type: string
          description: 按数字货币数量询价时使用的数字货币金额。
        fiatAmount:
          type: string
          description: 按法币数量询价时使用的法币金额。
        side:
          type: string
          description: 询价方向。CRYPTO 表示按数字货币数量询价，FIAT 表示按法币数量询价。
        promotionCode:
          type: string
          description: 业务支持时可传的优惠码。
        type:
          type: string
          description: OTC 业务类型。BUY 表示入金，SELL 表示出金。
        bankAccountId:
          type: string
          description: 商户绑定的银行账户 ID（来自查询银行卡列表或创建银行卡接口）。
      required:
        - cryptoCurrency
        - fiatCurrency
        - side
        - type
      example:
        cryptoCurrency: USDT
        fiatCurrency: USD
        fiatAmount: '1000'
        side: FIAT
        type: BUY
        bankAccountId: '2897434'
    QuoteResponse:
      type: object
      properties:
        code:
          type: string
          description: 业务响应码。
        status:
          type: string
          description: 请求顶层状态。
        errorMessage:
          type: string
          description: 请求失败时的错误信息。
        data:
          type: object
          properties:
            quoteToken:
              type: string
              description: 下单时使用的报价 token。
            validPeriod:
              type: integer
              description: 报价有效期，单位为秒。
            cryptoAmount:
              type: string
              description: 报价返回的数字货币数量。出金（SELL）时即为应付金额。
            fiatAmount:
              type: string
              description: 报价返回的法币金额。入金（BUY）时即为应付金额。
            fiatRate:
              type: string
              description: 法币汇率，表示法币/数字货币。
            cryptoRate:
              type: string
              description: 数字货币汇率，表示数字货币/法币。
            tradeFee:
              type: string
              description: 各费用项的合计金额（预估）。
            feeCurrency:
              type: string
              description: 各费用项的计价币种。
            feeDetail:
              type: array
              description: 费用明细。
              items:
                $ref: '#/components/schemas/OtcQuoteFeeDetail'
          description: 报价响应数据。
      example:
        code: '0'
        status: success
        errorMessage: ''
        data:
          quoteToken: qt_01JXYZABCDEF
          validPeriod: 60
          cryptoAmount: '1088.42'
          fiatAmount: '1000'
          fiatRate: '0.918762'
          cryptoRate: '1.088420'
          tradeFee: '10.88'
          feeCurrency: USD
          feeDetail:
            - feeType: BANK
              amount: '2.00'
            - feeType: GATE_PAY
              amount: '10.00'
            - feeType: SUBSIDY
              amount: '1.12'
    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.