> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ramphub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# African currencies

> Sell crypto for, and buy crypto with, Kenyan shillings, Ghanaian cedis and eight more African currencies.

Besides NGN, the API trades in ten African currencies. Sells pay out to a bank account or a mobile money wallet. Buys are paid from the customer's mobile money wallet: the customer approves a payment prompt on their phone.

You use the same endpoints as for NGN: [quotes](https://docs.ramphub.io/docs/reference/quotes.md), [buy orders](https://docs.ramphub.io/docs/reference/buy-order.md), [sell orders](https://docs.ramphub.io/docs/reference/sell-order.md), the [provider bank list](https://docs.ramphub.io/docs/reference/provider-bank-list.md) and [bank resolution](https://docs.ramphub.io/docs/reference/bank-resolution.md). An African currency adds a few fields, described on this page. NGN requests are unchanged.

## Currencies

Send the code as `fiatCurrency`.

| Currency | `fiatCurrency` | Country | Sells pay out to | Buys |
| - | - | - | - | - |
| Kenyan shilling | `KES` | KE | Bank, mobile money | Yes |
| Tanzanian shilling | `TZS` | TZ | Bank, mobile money | Yes |
| Ugandan shilling | `UGX` | UG | Bank, mobile money | Yes |
| Ghanaian cedi | `GHS` | GH | Mobile money | Yes |
| Rwandan franc | `RWF` | RW | Mobile money | Yes |
| Zambian kwacha | `ZMW` | ZM | Mobile money | Yes |
| Malawian kwacha | `MWK` | MW | Mobile money | No |
| South African rand | `ZAR` | ZA | Bank | No |
| West African CFA franc | `XOF` | CI, SN, ML, BJ, TG | Mobile money | CI, SN, ML and BJ |
| Central African CFA franc | `XAF` | GA | Mobile money | No |

Which methods a currency has can change as the providers change their coverage. [Payment methods](#payment-methods) always returns the current ones.

### `country`

**country** `string`

The country as a two-letter ISO code, such as `SN`. Required for `XOF`, which is used in more than one country. Every other currency has one country, so you can leave it out. For a buy, it is the country the customer pays from.

Without it, an `XOF` request fails with a `400`: `"country is required for XOF, which is paid out in more than one country. Use one of: CI, SN, ML, BJ, TG."`

## Payment methods

`GET /api/developer/payment-methods?currency=KES`

This returns how a currency pays out (bank, mobile money, or both), which providers carry each method, and the mobile money networks. If buys are available in the currency, it also returns how the customer pays. Call it to build your payout and payment forms. Send `country` too for `XOF`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.ramphub.io/api/developer/payment-methods?currency=KES" \
  -H "x-api-key: rh_test_..."
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "success": true,
  "currency": "KES",
  "country": "KE",
  "methods": [
    {
      "type": "bank",
      "providers": ["Paycrest", "UseBread"],
      "accountNumber": "The bank account number."
    },
    {
      "type": "mobile_money",
      "providers": ["Paycrest", "UseBread"],
      "accountNumber": "The wallet's mobile number, with or without the country code. The network (bankCode) must be the one the number is registered with.",
      "networks": [
        { "bankCode": "AIRTKEPC", "bankName": "AIRTEL" },
        { "bankCode": "SAFAKEPC", "bankName": "M-PESA" }
      ]
    }
  ],
  "buy": {
    "type": "mobile_money",
    "providers": ["UseBread"],
    "accountNumber": "The mobile number that pays, with or without the country code. The payment prompt is sent to it; the network (bankCode) must be the one it is registered with.",
    "networks": [
      { "bankCode": "AIRTKEPC", "bankName": "AIRTEL" },
      { "bankCode": "SAFAKEPC", "bankName": "MPESA" }
    ]
  }
}
```

* `buy` is `null` when buys are not available in the currency or country.
* `bankName` is as the provider lists it, so the same network can be spelled differently in `methods` and `buy`. Match on `bankCode`.
* A bank method in South Africa has `"recipientPhoneRequired": true`. See [Sells](#sells).
* The request fails with a `400` (`"KES payouts are not available yet."`) when RampHub has not opened the currency.

## Bank and network codes

`bankCode` works as it does for NGN: take it from the [provider bank list](https://docs.ramphub.io/docs/reference/provider-bank-list.md) with `currency` set.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.ramphub.io/api/developer/provider-bank-list/Paycrest?currency=KES&type=mobile_money" \
  -H "x-api-key: rh_test_..."
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "success": true,
  "provider": "Paycrest",
  "banks": [
    { "bankCode": "AIRTKEPC", "bankName": "AIRTEL", "type": "mobile_money" },
    { "bankCode": "SAFAKEPC", "bankName": "M-PESA", "type": "mobile_money" }
  ]
}
```

* Each entry's `type` is `bank` or `mobile_money`. It tells you what `accountNumber` holds.
* Codes are shared between providers: a bank or wallet has the same `bankCode` on both lists, so the code works whichever provider wins the rate. A bank's code is its SWIFT code, such as `KCBLKENX` for KCB Kenya.
* The provider must pay out in the currency. Asking UseBread for TZS works; asking Paycrest for ZAR fails with a `400`.

## Sells

A sell order takes the same fields as an [NGN sell order](https://docs.ramphub.io/docs/reference/sell-order.md), with these differences:

**bankCode** `string` *required*

The bank or mobile money code from the bank list for this currency.

**accountNumber** `string` *required*

The bank account number, or the wallet's mobile number for mobile money. A mobile number can be national (`0712345678`) or international (`+254712345678`). It must belong to the network in `bankCode`.

**recipientPhone** `string`

The recipient's full mobile number, with its country code. Required for a `ZAR` bank payout, ignored for everything else.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.ramphub.io/api/developer/orders" \
  -H "x-api-key: rh_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "side": "sell",
    "amount": 20,
    "fiatCurrency": "KES",
    "asset": "USDT",
    "chain": "bsc",
    "bankCode": "SAFAKEPC",
    "accountNumber": "0712345678",
    "accountName": "ACCOUNT HOLDER NAME",
    "externalCustomerId": "cust_7f3b8a2d"
  }'
```

Before the order, you can check the account and get its holder's name with [bank resolution](https://docs.ramphub.io/docs/reference/bank-resolution.md), sending `currency`.

Only providers whose list carries your `bankCode` are considered, so the order always goes to a provider that can pay that account. The order response has the same shape as an NGN sell: send the crypto to `ourCryptoAddress`.

## Buys

An African buy is paid by mobile money only. RampHub asks the provider to send a payment prompt to the customer's phone; the customer approves it, and the crypto is sent to `walletAddress`. There is no bank account to pay into.

A buy order takes the same fields as an [NGN buy order](https://docs.ramphub.io/docs/reference/buy-order.md), plus:

**bankCode** `string` *required*

The mobile money network that pays, from `buy.networks` in [Payment methods](#payment-methods), or from `GET /api/developer/provider-bank-list/UseBread?currency=KES&type=mobile_money`.

**accountNumber** `string` *required*

The mobile number that pays, national or international. The payment prompt goes to this number, so it must be the customer's own and on the network in `bankCode`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.ramphub.io/api/developer/orders" \
  -H "x-api-key: rh_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "side": "buy",
    "amount": 15,
    "fiatAmount": 2600,
    "fiatCurrency": "KES",
    "asset": "USDC",
    "chain": "base",
    "walletAddress": "0xRecipientWalletAddress",
    "bankCode": "SAFAKEPC",
    "accountNumber": "0712345678",
    "externalCustomerId": "cust_7f3b8a2d"
  }'
```

* Quotes need neither field. Only the order does.
* Ask your customer to keep their phone nearby, and tell them a payment prompt is coming.
* A bank code instead of a network fails with a `400`: `"KES buys are paid by mobile money, not by bank: bankCode must be a network from GET /provider-bank-list/UseBread?currency=KES&type=mobile_money."`
* Buys are not available in MWK, ZAR or XAF, or in XOF from Togo. A buy quote there fails with a `400` that says where buys can be paid from, for example `"Buys in XOF are not available in TG. They can be paid from: CI, SN, ML, BJ."`

## Minimums

The usual **\$1** minimum applies. UseBread also has its own minimum per country. It applies to buys, measured by the crypto bought, and to sells, measured by what is paid out after fees:

| Country | UseBread minimum |
| - | - |
| South Africa (ZAR) | \$100 |
| Côte d'Ivoire (XOF) | \$1 |
| Everywhere else | \$10 |

Paycrest has no minimum of its own. When no provider can take a trade, the quote fails with a `400` that names each provider's reason, for example:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "statusCode": 400,
  "message": "No provider can take this KES buy. UseBread: ...",
  "error": "Bad Request"
}
```

## Test keys

With a `rh_test_` key, every currency on this page works whether or not it has been switched on for you. The request rules are the live ones: `country` for XOF, buys only where they are available, and on a buy order, `bankCode` and `accountNumber`.

* Quotes return sample prices.
* An African buy order returns `providerDetails.mobileMoney` (the network and number you sent) and `amountToPay`, instead of a bank account. No prompt is sent.
* Bank resolution returns a sample name.
* [Payment methods](#payment-methods) shows only currencies RampHub has opened, with any key. For any other currency, use the [provider bank list](https://docs.ramphub.io/docs/reference/provider-bank-list.md) to see the banks and networks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.