Documentation/API Reference

API REFERENCE

Query Exchange Rate

POSThttps://mapi.yabandpay.com/Payments
Live API
API PLAYGROUND · Live API

Query Exchange Rate

POSThttps://mapi.yabandpay.com/Payments
Automatically signed with your credentials

Request parameters6

Required fields first

Query Exchange Rate

sell_currencyRequiredstringdata.sell_currencyCurrency to sell
buy_currencyRequiredstringdata.buy_currencyCurrency to buy
currencyRequiredstringdata.currencyCurrency to sell if currency matches sell_currency; otherwise, the currency to buy
amountRequiredstringdata.amountAmount to sell if currency matches sell_currency; otherwise, the amount to buy
tenorRequiredstringdata.tenorTOD or SPOT
request_idRequiredstringdata.request_idUnique request ID; a combination of digits and letters at least 24 characters is recommended

Credentials stay on this page. Your secret key is never stored or sent to the documentation server.

This API queries exchange rates.

Before creating an FX order, you must call this API to obtain a quote and create the order within 30 seconds of receiving the quote.

Notes

Tip

Notes

  1. Quote validity period
    Each exchange rate quote returned is valid for 30 seconds. After it expires, you must query the exchange rate again.

  2. Settlement tenor (Tenor)

  • TOD: Real-time settlement, unaffected by public holidays.

  • SPOT: Settlement on T+2 business days. Before the settlement date, ensure that the account has sufficient funds for settlement. If settlement fails due to insufficient funds, a penalty may be charged based on the actual loss.

  1. SPOT access
    You must apply in advance to use SPOT settlement, which is subject to credit limits.

Please use a dedicated account.

user=040268

ParameterTypeDescriptionRequired
userStringMerchant-level UIDRequired
signStringSignatureRequired
methodStringv3.GetFXQuoteRequired
timeLongTimestampRequired
  • Parameters
ParameterTypeDescriptionRequired
sell_currencyStringCurrency to sellRequired
buy_currencyStringCurrency to buyRequired
currencyStringCurrency to sell if currency matches sell_currency; otherwise, the currency to buyRequired
amountStringAmount to sell if currency matches sell_currency; otherwise, the amount to buyRequired
tenorStringTOD or SPOTRequired
request_idStringUnique request ID; a combination of at least 24 digits and letters is recommendedRequired

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=1&buy_currency=DKK&currency=GBP&method=v3.GetFXQuote&request_id=20304095064069023960369000g-42&sell_currency=GBP&tenor=TOD&time=1546588959&user=040268"

Sign stringA using secret_key

The resulting signature is:

"YOUR_SIGNATURE"

Request example:

{
  "user": "040268",
  "sign": "YOUR_SIGNATURE",
  "method": "v3.GetFXQuote",
  "time": 1546588959,
  "data": {
    "sell_currency": "GBP",
    "buy_currency": "DKK",
    "currency": "GBP",
    "amount": "1",
    "tenor": "TOD",
    "request_id": "20304095064069023960369000g-42"
  }
}

Response example:

{
  "status": true,
  "code": "200",
  "data": {
    "type": "sell",
    "sell_currency": "GBP",
    "buy_currency": "DKK",
    "sold_currency": "GBP",
    "sold_amount": "1.00",
    "bought_currency": "DKK",
    "bought_amount": "8.54",
    "tenor": "TOD",
    "exchange_rate": 8.544924729,
    "quote_id": "83e96dc0-8f8e-48c7-9bc4-6acc1019fced",
    "expiry_time": 1773824647
  },
  "message": "",
  "response_id": "202603181703362736334439"
}

Additional information:

Response result:
  1. If the call succeeds, "status": true is returned.
  2. If the call fails, "status": false is returned.
Response codes:
StatusCodeMessage
true200
false-1000Internal error
false-403The signature Error
false-2001The UID not exist
false-3001Required field is missing
false-4118Incorrect request ID