Query Forex Exchange Rate

This function allows merchants to fetch the current forex exchange rate for any supported currency pair in real time

📘

Live endpoint

https://api.tingg.africa/api/v3/forex/payout/conversion/fetch?baseCurrencyCode=USD&exchangeCurrencyCode=KES

Request

Headers

Authorization is required to access this API

KeyValue TypeDescription
AuthorizationStringBearer token generated for your user

Request Parameters

The API will accept the below query parameters

KeyValue TypeRequiredDescription
baseCurrencyCodeStringNo3 letter currency code indicating the base currency for the exchange rate
exchangeCurrencyCodeStringYes3 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

ParameterTypeRequiredDescription
messageIntegerYesAuthentication description
successbooleanYesSuccess status of the request
statusCodeIntegerYesStatus of the response.
dataObjectYesContains the rates details
statusDescriptionStringNoNarration on status code.
baseCurrencyCodeStringNoThe currency to convert from. Null when none was found.
exchangeCurrencyCodeStringNoThe currency to convert to. Null when none was found.
buyRateFloatNoThe currency buy rate. Null when none was found.
sellRateFloatNoThe currency sell rate. Null when none was found.
conversionRateIDStringNoThe 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 CodeDescription
508Conversion rate found.
174Invalid/unsuccessful request
400Bad Request Request is not well-formed or syntactically incorrect i.e misspelling a field name.
400Threat detected the request payload contains malicious phrases and flags.
404Resource not found The specified URL / endpoint being called does not exist.
405Method Not Allowed The HTTP Method being used is not implemented for this endpoint.
429Quota limit Exceeded Too many requests have been sent in a given time period.
429Spike Arrest Violation Too many requests violating the rate limiting protection.
503Service Unavailable Something went wrong on checkout's therefore the server could not process your request.
504Gateway Timeout. The request took too long to get a response from the server.
Language