> ## 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` 表示出金。
* 本页展示同一接口的机构路径版本。
* 除创建子账户、查询子账户详情、分页查询子账户外，机构侧请求需携带 `X-GatePay-On-Behalf-Of`。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/otc-fiat-openapi.json POST /withdraw/open/institution/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/institution/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'
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
      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: 用于防重放和验签的 Unix 时间戳。
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      schema:
        type: string
      description: 与时间戳配合使用的随机串，用于防止重放攻击。
    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:
    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 表示出金。
      required:
        - cryptoCurrency
        - fiatCurrency
        - side
        - type
      example:
        cryptoCurrency: USDT
        fiatCurrency: USD
        fiatAmount: '1000'
        side: FIAT
        type: BUY
    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: 报价返回的数字货币数量。
            fiatAmount:
              type: string
              description: 报价返回的法币金额。
            fiatRate:
              type: string
              description: 法币汇率，表示法币/数字货币。
            cryptoRate:
              type: string
              description: 数字货币汇率，表示数字货币/法币。
          description: 报价响应数据。
      example:
        code: '0'
        status: success
        errorMessage: ''
        data:
          quoteToken: qt_01JXYZABCDEF
          validPeriod: 60
          cryptoAmount: '1088.42'
          fiatAmount: '1000'
          fiatRate: '0.918762'
          cryptoRate: '1.088420'

````