# 汇率查询

> 查询源币种到目标币种的参考汇率。

```yaml
openapi: 3.1.0
info:
  title: 汇率查询
  version: 1.0.0
  description: 查询源币种到目标币种的参考汇率。
paths:
  /api/v1/acct/queryExchangeRate:
    post:
      summary: 汇率查询
      description: 查询源币种到目标币种的参考汇率。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号。通常在沙盒或生产商户开通后，从商户后台或开户材料中获取。
                sourceAmount:
                  type: number
                  description: 源金额。
                sourceCurrency:
                  type: string
                  description: 源币种。
                targetCurrency:
                  type: string
                  description: 目标币种。
                sign:
                  type: string
                  description: 请求签名字符串，需使用商户私钥按 Transfer 请求签名规则生成。
              required:
                - merchantNo
                - sourceCurrency
                - targetCurrency
                - sign
            examples:
              query-exchange-rate:
                summary: 汇率查询
                value:
                  merchantNo: "801129"
                  sign: "{{SIGN}}"
                  sourceAmount: 11.87
                  sourceCurrency: USD
                  targetCurrency: PKR
      responses:
        "200":
          description: 返回汇率结果
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的响应码。
                  respMsg:
                    type:
                      - string
                      - "null"
                    description: Onerway 返回的响应信息。
                    x-onerway-value:
                      nullable: true
                      when:
                        en: No response message is returned.
                        zh: 未返回响应信息时为 `null`。
                  data:
                    type: object
                    properties:
                      sourceAmount:
                        type: number
                        description: 源金额信息。
                      sourceCurrency:
                        type: string
                        description: 源币种信息。
                      targetAmount:
                        type: number
                        description: 目标金额信息。
                      targetCurrency:
                        type: string
                        description: 目标币种信息。
                      convRate:
                        type: number
                        description: 转换汇率。
                      rateDateTime:
                        type: string
                        description: 当前汇率时间。
                    description: 汇率查询结果。
              examples:
                exchange-rate-returned:
                  summary: 返回汇率结果
                  value:
                    respCode: "20000"
                    respMsg: null
                    data:
                      sourceAmount: 11.87
                      sourceCurrency: USD
                      targetAmount: 3286.32
                      targetCurrency: PKR
                      convRate: 276.859578
                      rateDateTime: 2025-10-30 23:10:17
```
