Onerway
POST

Query an exchange rate

Query an exchange rate between different source and target currencies, optionally supplying a source amount for conversion.

Request

ApiKey
Account service API key assigned by Onerway, supplied in the request header. Use the key for the same environment as the request domain.
Example:
Content-Type
Request media type.
Example:
sourceCurrency
Source currency. See currency enums.
targetCurrency
Target currency. See currency enums.
Constraints
Rule
Must differ from sourceCurrency.
sourceAmount
Source amount denominated in sourceCurrency.
onBehalfOf
Merchant number that the request applies to. Supply it only when making a request on behalf of another merchant.

Request example

curl -X POST 'https://sandbox-transfer-api.onerway.com/api/v3/acct/queryExchangeRate' \
  -H 'ApiKey: replace_with_account_service_apikey' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sourceCurrency": "USD",
  "targetCurrency": "EUR",
  "sourceAmount": 100
}'

Response

respCode
Response code; 20000 indicates successful request processing. All other values are error codes.
respMsg
Human-readable description of the response code.
Business data on success; do not consume as valid business data on failure
Structured failure information; not present for every failure path

Response example

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "sourceCurrency": "USD",
    "sourceAmount": 100,
    "targetCurrency": "EUR",
    "targetAmount": 92,
    "conversionRate": 0.92,
    "quoteTime": "2026-01-15 10:00:00"
  }
}
20040004

Sending a negative sourceAmount.

Trigger: Sending a negative sourceAmount.

Example

{
  "respCode": "40004",
  "respMsg": "Illegal parameter [sourceAmount]",
  "error": {
    "type": "validation_error",
    "code": "40004",
    "message": "Illegal parameter [sourceAmount]",
    "requestId": "req_00000000000000000000000000000001",
    "errorDetails": [
      {
        "errorCode": "40004",
        "message": "Illegal parameter [sourceAmount]"
      }
    ],
    "param": "sourceAmount"
  }
}