OhentPay
API Reference

Rates

Exchange rates operations

Fetch exchange rate for a currency pair

GET
/rates
AuthorizationBearer <token>

In: header

Query Parameters

from_currencystring
to_currencystring
amountinteger
to_amountinteger

You can also pass the amount you wish to buy as to_amount rather than the sell amount

Response Body

curl -X GET "https://api.ohentpay.com/rates?from_currency=GBP&to_currency=EUR&amount=100&to_amount=112"
{
  "rate": {
    "from_currency": {
      "currency_code": "GBP",
      "amount": 1
    },
    "to_currency": {
      "currency_code": "EUR",
      "amount": "1.127"
    },
    "last_updated": "2020-04-28T02:18:06+01:00",
    "outside_market_hours": false
  },
  "sender": {
    "currency_code": "GBP",
    "amount": 1
  },
  "recipient": {
    "currency_code": "EUR",
    "amount": 112
  },
  "reversed": false
}
{
  "request": "error",
  "code": 400,
  "message": "Invalid request"
}