# FX Rate Query

> Query the indicative FX rate from a source currency to a target currency.

```yaml
openapi: 3.1.0
info:
  title: FX Rate Query
  version: 1.0.0
  description: Query the indicative FX rate from a source currency to a target currency.
paths:
  /api/v1/acct/queryExchangeRate:
    post:
      summary: FX Rate Query
      description: Query the indicative FX rate from a source currency to a target currency.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Merchant number assigned by Onerway. Retrieve it from the merchant
                    portal or onboarding material after your sandbox or
                    production account is created.
                sourceAmount:
                  type: number
                  description: Optional source amount used to calculate the target amount.
                sourceCurrency:
                  type: string
                  description: Source currency.
                targetCurrency:
                  type: string
                  description: Target currency.
                sign:
                  type: string
                  description: Request signature string. Generate it according to the Transfer
                    request-signing rules with your merchant private key.
              required:
                - merchantNo
                - sourceCurrency
                - targetCurrency
                - sign
            examples:
              query-exchange-rate:
                summary: Query exchange rate
                value:
                  merchantNo: "801129"
                  sign: "{{SIGN}}"
                  sourceAmount: 11.87
                  sourceCurrency: USD
                  targetCurrency: PKR
      responses:
        "200":
          description: Exchange rate returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Response code returned by Onerway.
                  respMsg:
                    type:
                      - string
                      - "null"
                    description: Response message returned by Onerway.
                    x-onerway-value:
                      nullable: true
                      when:
                        en: No response message is returned.
                        zh: 未返回响应信息时为 `null`。
                  data:
                    type: object
                    properties:
                      sourceAmount:
                        type: number
                        description: Source amount.
                      sourceCurrency:
                        type: string
                        description: Source currency.
                      targetAmount:
                        type: number
                        description: Converted target amount.
                      targetCurrency:
                        type: string
                        description: Target currency.
                      convRate:
                        type: number
                        description: Conversion rate.
                      rateDateTime:
                        type: string
                        description: Rate timestamp.
                    description: FX quote result.
              examples:
                exchange-rate-returned:
                  summary: Exchange rate returned
                  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
```
