Currencies

Introduction

The Currencies API method allows you to list the supported currencies, including information like phone country codes associated with each currency. Note, these are the currencies that are supported for local wallets. For currencies available for cross-border integrations, please contact support.

📘

The currency API endpoint is:

https://api.mfsafrica.com/api/currencies

The Currency object

FieldTypeDescription
idlong integerUnique object identifier
namestringThe currency name
codestringThe code i.e KES, UGX
countryobjectExpanded country object
usd_ratefloatThe latest USD exchange rate

Sample Currency Object (JSON)

📘

Note

Sample Response (JSON) - if you use one of the development libraries, this is automatically converted into a native object for you:

{
  "id": 7,
  "name": "Rwandan Francs",
  "code": "RWF",
  "country": {
    "iso": "RW",
    "iso3": "RWA",
    "iso_numeric": 646,
    "name": "RWANDA",
    "printable_name": "Rwanda",
    "phone_prefix": "250",
    "supported": true
  },
  "usd_rate": 897.5
}

Retrieving a single Currency

To retrieve a single currency, provide the currency id and a currency object will be returned.

Parameter (*required field)TypeDescription
id*Integer
Ex. 7
The id of the currency you want to retrieve

Sample Request

curl https://api.mfsafrica.com/api/currencies/7 -H "Authorization: Token ab594c14986612f6167a975e1c369e71edab6900"
package com.beyonic.samples;

import com.beyonic.exceptions.BeyonicException;
import com.beyonic.models.*;

Beyonic.API_KEY = "ab594c14986612f6167a975e1c369e71edab6900";

String response = null;

try{
    response = new Currency().get(123);
    System.out.println(response);
}
catch (Exception e){
    e.printStackTrace();
}
<?php
require_once('./lib/Beyonic.php');
Beyonic::setApiKey("ab594c14986612f6167a975e1c369e71edab6900");

$account = Beyonic_Currency::get(7);
?>
import beyonic
beyonic.api_key = 'ab594c14986612f6167a975e1c369e71edab6900'

currency = beyonic.Currency.get(7)
require 'beyonic'
Beyonic.api_key = 'ab594c14986612f6167a975e1c369e71edab6900'

currency = Beyonic::Currency.get(7)

Sample Response

{
  "id": 7,
  "name": "Rwandan Francs",
  "code": "RWF",
  "country": {
    "iso": "RW",
    "iso3": "RWA",
    "iso_numeric": 646,
    "name": "RWANDA",
    "printable_name": "Rwanda",
    "phone_prefix": "250",
    "supported": true
  },
  "usd_rate": 897.5
}

Listing all Currencies

To retrieve a list of all currencies, make a GET request to the currencies end point. This will return a list of currencies.

Sample Request

curl https://api.mfsafrica.com/api/currencies -H "Authorization: Token ab594c14986612f6167a975e1c369e71edab6900"
package com.beyonic.samples;

import com.beyonic.exceptions.BeyonicException;
import com.beyonic.models.*;

Beyonic.API_KEY = "ab594c14986612f6167a975e1c369e71edab6900";

String response = null;

try{
    response = new Currency().list();
    System.out.println(response);
}
catch (Exception e){
    e.printStackTrace();
}
<?php
require_once('./lib/Beyonic.php');
Beyonic::setApiKey("ab594c14986612f6167a975e1c369e71edab6900");

$accounts = Beyonic_Currency::getAll();
?>
import beyonic
beyonic.api_key = 'ab594c14986612f6167a975e1c369e71edab6900'

currencies = beyonic.Currency.list()
require 'beyonic'
Beyonic.api_key = 'ab594c14986612f6167a975e1c369e71edab6900'

currencies = Beyonic::Currency.list

Sample Response

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 7,
      "name": "Rwandan Francs",
      "code": "RWF",
      "country": {
        "iso": "RW",
        "iso3": "RWA",
        "iso_numeric": 646,
        "name": "RWANDA",
        "printable_name": "Rwanda",
        "phone_prefix": "250",
        "supported": true
      },
      "usd_rate": 897.5
    },
    {
      "id": 6,
      "name": "Tanzania Shillings",
      "code": "TZS",
      "country": {
        "iso": "TZ",
        "iso3": "TZA",
        "iso_numeric": 834,
        "name": "TANZANIA, UNITED REPUBLIC OF",
        "printable_name": "Tanzania, United Republic of",
        "phone_prefix": "255",
        "supported": true
      },
      "usd_rate": 2303.0
    }
  ]
}

Filtering Currencies

The Currency API doesn’t currently support filtering.