Skip to main content

Rates

This endpoint retrieves the current exchange rates for the requested currency pairs.

HTTP Request via SSL

POST '/api/v1/da/rates'

Header Parameters

ParameterMandatoryDescription
Authorizationyes"Bearer merchant_private_key" - The api key as a string.
Content-TypeyesAll request bodies should have content type application/json and be valid JSON.

Request Body Parameters

ParameterMandatoryDescription
ratesyesAn array of currency pair objects. Each object contains a base and a quote currency.
session_tokenyesAuthorization token.

Response Parameters

ParameterDescription
successtrue/false
statusThe HTTP status code of the response
ratesA hash with the rates for each currency pair requested. Each currency pair (e.g., "LTC-EUR") contains a price.
curl "https://business.payments.defexa.io/api/v1/da/rates" \
  -H "Authorization: Bearer merchant_private_key" \
  -H "Content-Type: application/json" \
  -d '{
        "session_token": "f3a728b408fadd87f",
        "rates": [
          { "base": "LTC", "quote": "EUR" },
          { "base": "TRX", "quote": "USD" }
        ]
      }'

Return status 200 and JSON:

{
"success": true,
"status": 200,
"rates": {
"LTCEUR": {
"amount": 1,
"price": 100.5
},
"TRXUSD": {
"amount": 1,
"price": 0.24268752164476534
}
}
}