FX API
Introduction
This API allows merchants to consume currency conversion services, providing both selling and buying rates for various currencies. The rates are refreshed hourly.
Base URL
The base URL for the FX API is:
- Sandbox URL: https://dev.lipad.io
- Production URL: https://api.lipad.io
Authentication
API requests must include an Access Token in the header for authentication.
x-access-token: YOUR_ACCESS_TOKEN
You can obtain an access token with your API Keys here:
- Sandbox URL: https://dev.charge.lipad.io/v1/auth
- Production URL: https://api.charge.lipad.io/v1/auth
Method: POST
Request body
{
"consumer_key": "YOUR_CONSUMER_KEY",
"consumer_secret": "YOUR_CONSUMER_SECRET"
}
Response:
{
"access_token":"YOUR_ACCESS_TOKEN",
"expires_in":"ACCESS_TOKEN_TTL"
}
Endpoints
1. Exchange rates
GET /v1/fx?base_currency=USD
Base currency can be varied.
Sample Request
curl -X GET -H "x-access-token: YOUR_ACCESS_TOKEN" https://dev.lipad.io/v1/fx?base_currency=USD
Response
{
"base_currency": "USD",
"rates": {
"KES": {
"buying": "158.496617",
"selling": "164.509032"
},
"NGN": {
"buying": "908.749572",
"selling": "956.287051"
},
"UGX": {
"buying": "3815.838236",
"selling": "4008.730148"
},
"TZS": {
"buying": "2508.000308",
"selling": "2635.500323"
}
}
}