> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 创建 FX 报价

> 以客户的本地币种为 USD 价格报价，并在报价到期前保持该价格

以客户的本地币种为 USD 金额报价。汇率为 Yuno 的每日 [参考汇率](https://docs.y.uno/zh-hans/reference/fx-rates/get-fx-rates.md) 加上为您的组织约定的加价。请在 `expires_at` 之前使用该报价收取本地金额。请参阅 [本地价格和税费](https://docs.y.uno/zh-hans/docs/payment-features/subscriptions/local-price-and-taxes.md)。

> [!NOTE]
>
> **按组织启用**
>
> FX 报价按组织启用。请联系您的大客户经理（KAM）启用。

* 仅可对 `USD` 金额报价。
* `404 FX_QUOTE_NOT_AVAILABLE` 表示最新可用日期没有该币种的已发布汇率：请以 USD 收费。
* 过期的报价在支付时会被拒收。请重新报价，并向客户显示新的金额。


## OpenAPI

````yaml openapi/zh-hans/fx-rates/create-fx-quote.json POST /fx-rates/quote
openapi: 3.0.1
info:
  title: Yuno FX Rates API
  version: '1.0'
servers:
  - url: https://api-sandbox.y.uno/v1
  - url: https://api.y.uno/v1
security: []
paths:
  /fx-rates/quote:
    post:
      summary: 创建 FX 报价
      description: >-
        以客户的本地币种对美元金额进行报价，使用 Yuno 的每日参考汇率加上您的加价，并保留该报价直至
        `expires_at`。随支付一并发送该报价，即可按本地金额收费。
      operationId: create-fx-quote
      parameters:
        - in: header
          name: PUBLIC-API-KEY
          required: true
          schema:
            type: string
          description: 您的公钥 API 密钥。
        - in: header
          name: PRIVATE-SECRET-KEY
          required: false
          schema:
            type: string
          description: 当您从 backend 报价时使用的私有密钥。切勿在客户端暴露。
        - in: header
          name: X-Account-Code
          required: false
          schema:
            type: string
          description: 该报价所针对的账户。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - target_currency
              properties:
                checkout_session:
                  type: string
                  description: 该报价所针对的结账会话。使用公钥时必填。
                account_id:
                  type: string
                  description: 该报价所针对的账户。
                amount:
                  type: object
                  required:
                    - currency
                    - value
                  properties:
                    currency:
                      type: string
                      enum:
                        - USD
                      description: 仅支持 `USD`。
                    value:
                      type: number
                      description: 取值范围为 0.0001 至 9999999999。
                target_currency:
                  type: string
                  description: 报价所用的三位 ISO 货币代码。
                  example: BRL
            example:
              checkout_session: <checkout_session>
              amount:
                currency: USD
                value: 29
              target_currency: BRL
      responses:
        '200':
          description: 外汇报价
          content:
            application/json:
              schema:
                type: object
                properties:
                  fx_quote_id:
                    type: string
                  amount:
                    type: object
                    properties:
                      currency:
                        type: string
                      value:
                        type: number
                  local_amount:
                    type: object
                    properties:
                      currency:
                        type: string
                      value:
                        type: number
                  reference_rate:
                    type: number
                  markup_percentage:
                    type: number
                  rate:
                    type: number
                  fx_date:
                    type: string
                    description: 参考汇率所属日期。
                  expires_at:
                    type: string
                    description: 报价可用于扣款的截止时间。
              example:
                fx_quote_id: fxq_D8BBCB40182E44799D4AE3F6BBF2D1FB
                amount:
                  currency: USD
                  value: 29
                local_amount:
                  currency: BRL
                  value: 152.55
                reference_rate: 5.1572
                markup_percentage: 2
                rate: 5.2603
                fx_date: '2026-11-19'
                expires_at: '2026-11-21T22:24:07Z'
        '400':
          description: 请求体无效，例如金额不是 USD
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: INVALID_PARAMETERS
                messages:
                  - ...
        '403':
          description: 您的组织未启用该产品
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: PRODUCT_NOT_ENABLED
                messages:
                  - ...
        '404':
          description: 错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: FX_QUOTE_NOT_AVAILABLE
                messages:
                  - No published rate for BRL on the latest available day.

````

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