get https://api-approval.tingg.africa/api/v3/forex/payout/conversion/fetch
This function allows merchants to fetch the current forex exchange rate for any supported currency pair in real time
Live endpoint
Request
Headers
Authorization is required to access this API
Key | Value Type | Description |
---|---|---|
Authorization | String | Bearer token generated for your user |
Request Parameters
The API will accept the below query parameters
Key | Value Type | Required | Description |
---|---|---|---|
baseCurrencyCode | String | No | 3 letter currency code indicating the base currency for the exchange rate |
exchangeCurrencyCode | String | Yes | 3 letter currency code indicating the exchange currency for the exchange rate |
Sample Request
curl --location 'https://api-approval.tingg.africa/api/v3/forex/payout/conversion/fetch?baseCurrencyCode=USD&exchangeCurrencyCode=KES' \
--header 'Authorization: Bearer eyJraWQiOiJjYXMtcGsiLCJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI4NzcxNCIsInBhcmVudCI6IkFETUlOIiwibGV2ZWwiOiJBRE1JTiIsImlzcyI6Imh0dHA6Ly9jYXMtYXBpLmFwcHJvdmFsOjgwODAvIiwidXR5cGUiOiJVSSIsImF1ZCI6IiIsInBob25lIjoiMjU0NzI4MTQzODEyIiwibmFtZSI6InBldGVyLm1haW5hQGNlbGx1bGFudC5pbyIsImNsaWVudCI6IkNFTExVTEFOVCIsImV4cCI6MTc0NTQxMjIzMiwiaWF0IjoxNzQ1NDA4NjMyLCJjdXN0X2lkIjo5MDAxLCJqdGkiOiJkZDUxYmE4My1kNDcwLTQ4MmUtOGE4OS1mNWI2ZWFjMmU5OTBiMzJlZTk5OC1mNDllLTQ0MmYtODk2Yi04MzY3M2Y0NWY5ZmUiLCJlbWFpbCI6InBldGVyLm1haW5hQGNlbGx1bGFudC5pbyJ9.GY618l6yf4urkIDEeUsDOsmJfsH0gCx_XtPfd7zgb8X1S7gfPVox-s9-e74cxQ23GVmSm11h-Yf50WUgrCURjz1P5KeS_4-L2moW2coEeADLJZe1dd33nbuuu1_NeRbM4ksfkOCAUknb9nERJD04juSQuqIrQn9eYA9hktv4nExBV4hlQnlZXcuCEJp3m2TmqlLvsLNP5S7jDWjqfkZlDy8NoKBLjqnm6_e3y-35Y6UBo8v6JcJkKKMIY9qnSYaCto2rTDEnofipXu5QEk1Bt8a3UlJLDP3DirPa17gTCDumdefgCRqddiI6AxcuFZ_FrHy1kryKhpmIw98zQKeDOA'
Response
Response Parameters
Parameter | Type | Required | Description |
---|---|---|---|
message | Integer | Yes | Authentication description |
success | boolean | Yes | Success status of the request |
statusCode | Integer | Yes | Status of the response. |
data | Object | Yes | Contains the rates details |
statusDescription | String | No | Narration on status code. |
baseCurrencyCode | String | No | The currency to convert from. Null when none was found. |
exchangeCurrencyCode | String | No | The currency to convert to. Null when none was found. |
buyRate | Float | No | The currency buy rate. Null when none was found. |
sellRate | Float | No | The currency sell rate. Null when none was found. |
conversionRateID | String | No | The primary key for the rate |
Sample Response
{
"message": "Authentication successful.",
"success": true,
"statusCode": 508,
"data": {
"statusDescription": "Conversion rate found.",
"baseCurrencyCode": "USD",
"exchangeCurrencyCode": "KES",
"buyRate": 158.1,
"sellRate": 158.1,
"conversionRateID": "650"
}
}
Response Status Codes
Status Code | Description |
---|---|
508 | Conversion rate found. |
174 | Invalid/unsuccessful request |
400 | Bad Request Request is not well-formed or syntactically incorrect i.e misspelling a field name. |
400 | Threat detected the request payload contains malicious phrases and flags. |
404 | Resource not found The specified URL / endpoint being called does not exist. |
405 | Method Not Allowed The HTTP Method being used is not implemented for this endpoint. |
429 | Quota limit Exceeded Too many requests have been sent in a given time period. |
429 | Spike Arrest Violation Too many requests violating the rate limiting protection. |
503 | Service Unavailable Something went wrong on checkout's therefore the server could not process your request. |
504 | Gateway Timeout. The request took too long to get a response from the server. |