Introduction Last updated: 3 days ago

R-Cash API provides a whole host of products that can facilitate you to improve your business processes and gain a better competitive edge. We expose endpoints for C2B, B2C, B2B, Utilities and Whitelabel solution

List Of APIs:
  • Authentication: enable developer to get the access token
  • Accounts: enable developer to get the account balance and account transactions
  • SendMoney: allow transfer of funs to mobile money and banks
  • Collection: Facilitates funds collection from mobile money and banks

Gets Started

To begin integrating with the R-Cash API, you will need a client ID and client secret. Both sandbox and production credentials can be generated from your R-Cash account under the "Settings" section, specifically in the "API Keys" area..

R-Cash Account

To create a R-Cash account, you need to register at https://partner.r-cash.io/register . Ensure that you provide accurate information and the required KYC documents. Based on the documents you submit, you will either be granted a business account or a personal account.

//

Authentication

R-Cash API uses Bearer Token Authentication. Generate your access token using your credentials:

With CLIENT ID and CLIENT SECRET obtained from the R-Cash account setting, You can generate an access token by making a GET request to the following endpoint

Callout Examples:

Endpoint

  • Sandbox: https://api.r-cash.io/api/sandbox/v1/auth/token/?grant_type=client_credentials
  • Production: https://api.r-cash.io/api/prod/v1/auth/token/?grant_type=client_credentials
Custom Table:
Field Type Description Example
Authorization Header Basic Auth over HTTPS, this is a base64 encoded string of an app's client ID and client secret abc123xyz
grant_type query client_credentials grant type is supported. Put this under Params Basic sk_test_456def

Sample Request

curl -X GET 'https://{{BASE_URL}}/api/v1/auth/token/?grant_type=client_credentials' \
  -H 'Authorization: Basic <base64(client_id:client_secret)>'
<?php
$url = 'https://sandbox.r-cash.io/api/v1/auth/token/?grant_type=client_credentials';
$requestBody = array(
  'client_id' => 'CLIENT_ID',
  'client_secret' => 'CLIENT_SECRET',
);
$headers = array(
  'Authorization: Basic ' . base64_encode($requestBody['client_id'] . ':' . $requestBody['client_secret']),
);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => $headers
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
from requests.auth import HTTPBasicAuth

url = "https://sandbox.r-cash.io/api/v1/auth/token/?grant_type=client_credentials"
client_id = "CLIENT_ID"
client_secret = "CLIENT_SECRET"

response = requests.get(url, auth=HTTPBasicAuth(client_id, client_secret))
print(response.json())
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Base64;

public class R-CashToken {
  public static void main(String[] args) throws Exception {
    String clientId = "CLIENT_ID";
    String clientSecret = "CLIENT_SECRET";
    String auth = clientId + ":" + clientSecret;
    String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes());

    URL url = new URL("https://sandbox.r-cash.io/api/v1/auth/token/?grant_type=client_credentials");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    conn.setRequestProperty("Authorization", "Basic " + encodedAuth);

    // Read response...
  }
}

Sample API Responses

{
  "status": true,
  "detail": "SUCCESS",
  "message": "SUCCESS",
  "access_token": "jUJf1vExMzwGQmPr6SxCyod9rrEysNsWNJdijdwGb46IZ2MkFVISHAVDo0aw",
  "expires_in": 3600,
  "token_type": "Bearer",
  "refresh_token": "ECpYlmaUWytxF8jEiJXKM110q9Trs4kPiw1AXAV805DO30RAxmHObDokWYakJx64oWmDDwKllvGO8JWq",
  "scope": "C2B/B2B/B2C",
  "ResponseCode": "0"
}
{
  "status": false,
  "detail": "Invalid credentials",
  "message": "Invalid credentials",
  "ResponseCode": "401"
}

Accounts

Accounts APIs provide essential functionalities for managing and retrieving account-related information. These APIs facilitate secure and seamless banking operations. Before diving into specific APIs, here’s what the Accounts APIs handle.

Before diving into specific APIs, here’s what the Accounts APIs handle:
  • Balance Enquiry API: Retrieves the available or current balance of an account.
  • Statements API: Fetches transaction history for a specified period
  • Account Name Lookup API : Verifies the registered name linked to an account number.
  • Collection: Facilitates funds collection from mobile money and banks

Balance Enquiry

This endpoint enables the merchant to view their account balance. To check the balance, the merchant needs to provide their merchant code as a query parameter.

Endpoint

  • Sandbox: https://api/sandbox/v1/accounts/balance?MerchantCode=5**5
  • Production: https://api/prod/v1/accounts/balance?MerchantCode=5**5
Request Parameters:
Field Type Description Example
Authorization Header Basic Auth over HTTPS, this is a base64 encoded string of an app's client ID and client secret abc123xyz
MerchantCode Numeric R-Cash Wallet Number 5001
curl -X GET 'https://sandbox.r-cash.io/api/v1/accounts/balance/?MerchantCode=50**1' \
  -H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
  -H 'Content-Type: application/json'
<?php
$merchantCode = '50**1';
$bearerToken = '<YOUR-ACCESS-TOKEN>';
$url = "https://sandbox.r-cash.io/api/v1/accounts/balance/?MerchantCode=" . $merchantCode;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer $bearerToken",
    "Content-Type: application/json"
]);

$response = curl_exec($ch);

if($response === false) {
    echo "cURL Error: " . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
import requests

merchant_code = "50**1"
access_token = "<YOUR-ACCESS-TOKEN>"
url = f"https://sandbox.r-cash.io/api/v1/accounts/balance/?MerchantCode={merchant_code}"

headers = {
    "Authorization": f"Bearer {access_token}",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
import java.net.HttpURLConnection;
import java.net.URL;

public class AccountBalance {
  public static void main(String[] args) throws Exception {
    String merchantCode = "50**1";
    String token = "<YOUR-ACCESS-TOKEN>";
    URL url = new URL("https://sandbox.r-cash.io/api/v1/accounts/balance/?MerchantCode=" + merchantCode);

    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    conn.setRequestProperty("Authorization", "Bearer " + token);
    conn.setRequestProperty("Content-Type", "application/json");

    // Read and handle response...
  }
}
Response
{
  "status": true,
  "detail": "SUCCESS",
  "message": "SUCCESS",
  "balance": {
    "MerchantCode": "50**1",
    "AvailableBalance": "100000.00",
    "Currency": "KES"
  },
  "ResponseCode": "0"
}
{
  "status": false,
  "detail": "Invalid or expired token",
  "message": "Unauthorized access",
  "ResponseCode": "401"
}

TRANSACTION STATEMENT

As a R-Cash user, you can retrieve your transaction statement directly through our API. To fetch your statement, simply make a GET request to the URL below, passing your merchant_code as a query parameter.

Endpoint

  • Sandbox: https://api.r-cash.io/api/sandbox/v1/accounts/transactions?MerchantCode=5**5&start_date=2024-03-01&end_date=2024-03-25&per_page=15
  • Production: https://api.r-cash.io/api/prod/v1/accounts/transactions?MerchantCode=5**5&start_date=2024-03-01&end_date=2024-03-25&per_page=15
Request Parameters:
Field Type Description Example
MerchnatCode Numeric R-Cash Wallet Number 5001
StartDate String The start date to filter transactions. This must be provided along with the EndDate. 2023-10-23
EndDate String This is the date to which you want to filter transactions. Note that this must be submitted together with StartDate parameter 2023-10-24
TransactionCode String An optional transaction code that can be used to filter specific transactions. "TXN12345"
curl -X GET 'https://api.r-cash.io/sandbox.r-cash.io/api/v1/accounts/transactions?MerchantCode=5125&StartDate=2024-03-01&EndDate=2024-03-25&per_page=15' \
  -H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
  -H 'Content-Type: application/json'
<?php
$merchantCode = '5125';
$startDate = '2024-03-01';
$endDate = '2024-03-25';
$perPage = 15;
$accessToken = '<YOUR-ACCESS-TOKEN>';

$url = "https://api.r-cash.io/api/v1/accounts/transactions?MerchantCode=$merchantCode&StartDate=$startDate&EndDate=$endDate&per_page=$perPage";

$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $accessToken",
        "Content-Type: application/json"
    ]
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
import requests

url = "https://api.r-cash.io/api/sandbox/v1/accounts/transactions"
params = {
    "MerchantCode": "5125",
    "StartDate": "2024-03-01",
    "EndDate": "2024-03-25",
    "per_page": 15
}
headers = {
    "Authorization": "Bearer <YOUR-ACCESS-TOKEN>",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
import java.net.HttpURLConnection;
import java.net.URL;

public class TransactionStatement {
  public static void main(String[] args) throws Exception {
    String merchantCode = "5125";
    String startDate = "2024-03-01";
    String endDate = "2024-03-25";
    int perPage = 15;
    String token = "<YOUR-ACCESS-TOKEN>";

    String urlStr = String.format(
      "https://api.r-cash.io/sandbox/api/v1/accounts/transactions?MerchantCode=%s&StartDate=%s&EndDate=%s&per_page=%d",
      merchantCode, startDate, endDate, perPage
    );

    URL url = new URL(urlStr);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    conn.setRequestProperty("Authorization", "Bearer " + token);
    conn.setRequestProperty("Content-Type", "application/json");

    // Handle response...
  }
}
Sample Response:
{
  "status": "true",
  "data": {
    "transactions": [
      {
        "id": "txn_123456",
        "amount": 1500,
        "currency": "KES",
        "type": "credit",
        "reference": "ABC123XYZ",
        "date": "2024-03-20T14:35:00Z",
        "description": "Customer payment"
      },
      {
        "id": "txn_123457",
        "amount": -500,
        "currency": "KES",
        "type": "debit",
        "reference": "XYZ789DEF",
        "date": "2024-03-21T10:20:00Z",
        "description": "Withdrawal to bank"
      }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 15,
      "total_pages": 3,
      "total_records": 45
    }
  }
}
{
  "status": "false",
  "message": "Invalid or expired access token.",
  "detail": "Invalid or expired access token.",
  "ResponseCode": 401
}

SEND MONEY

The SendMoney API allows you to transfer funds with multiple options: send to mobile money and Banks. The api allows to send to Kenya,Ethiopia And somalia

Get Countries

This API returns the list of countries where R-Cash can send money, including each country’s mobile code and default currency information.

Endpoint

  • Sandbox: {{BASE_URL}}/api/sandbox/v1/countries
  • Production: {{BASE_URL}}/api/prod/v1/countries
HTTP Method:

GET

Authentication:

This endpoint requires a valid Bearer access token in the Authorization header.

Request Parameters:

This endpoint does not require any query or body parameters.

Country Object:
Field Type Description Example
name String Country name. Ethiopia
mobile_code String Country calling / mobile code used when constructing mobile numbers for this corridor. 251
currency_name String Full name of the default currency used for payouts in that country. Ethiopian birr
currency_code String ISO 4217 currency code. ETB
currency_symbol String Display symbol for the currency. Nkf
Sample Request:
curl --location '{{BASE_URL}}/api/prod/v1/countries' \
--header 'Authorization: Bearer <YOUR-ACCESS-TOKEN>'
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{BASE_URL}}/api/prod/v1/countries',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests

url = "{{BASE_URL}}/api/prod/v1/countries"
headers = {
    "Authorization": "Bearer <YOUR-ACCESS-TOKEN>"
}

response = requests.get(url, headers=headers)
print(response.json())
import java.io.*;
import java.net.*;

public class GetCountries {
    public static void main(String[] args) throws Exception {
        String urlStr = "{{BASE_URL}}/api/prod/v1/countries";
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        conn.setRequestProperty("Authorization", "Bearer <YOUR-ACCESS-TOKEN>");

        try (BufferedReader br = new BufferedReader(
                new InputStreamReader(conn.getInputStream(), "utf-8"))) {
            StringBuilder response = new StringBuilder();
            String line;
            while ((line = br.readLine()) != null) {
                response.append(line.trim());
            }
            System.out.println(response.toString());
        }
    }
}

Sample Response

{
  "status": true,
  "ResponseCode": "000",
  "Code": "SUCCESS",
  "CodeDescription": "Request processed successfully",
  "countries": [
    {
      "name": "Ethiopia",
      "mobile_code": "251",
      "currency_name": "Ethiopian birr",
      "currency_code": "ETB",
      "currency_symbol": "Nkf"
    },
    {
      "name": "Kenya",
      "mobile_code": "254",
      "currency_name": "Kenyan shilling",
      "currency_code": "KES",
      "currency_symbol": "KSh"
    },
    {
      "name": "Somalia",
      "mobile_code": "252",
      "currency_name": "Somali shilling",
      "currency_code": "SOS",
      "currency_symbol": "Sh.so."
    }
  ]
}

Payment Gateways

This API returns a list of all available R-Cash payment gateways and their supported institutions. It can be filtered by country_code and/or destination_type (e.g. BANK, MOBILE_MONEY).

Endpoint

  • Sandbox: {{BASE_URL}}/api/sandbox/v1/payment-gateways
  • Production: {{BASE_URL}}/api/prod/v1/payment-gateways

Examples:
{{BASE_URL}}/api/prod/v1/payment-gateways?country_code=ET
{{BASE_URL}}/api/prod/v1/payment-gateways?destination_type=BANK
{{BASE_URL}}/api/prod/v1/payment-gateways?country_code=KE&destination_type=MOBILE_MONEY

HTTP Method:

GET

Authentication:

This endpoint requires a valid Bearer access token in the Authorization header.

Query Parameters:
Field Type Required Description Example
country_code String No ISO 3166-1 alpha-2 country code used to filter payment gateways (e.g. KE, ET, SO). ET
destination_type String No Type of destination to filter by. Common values include BANK and MOBILE_MONEY. BANK
Sample Request:
curl --location '{{BASE_URL}}/api/prod/v1/payment-gateways?country_code=ET&destination_type=BANK' \
--header 'Authorization: Bearer <YOUR-ACCESS-TOKEN>'
<?php
$curl = curl_init();

$url = '{{BASE_URL}}/api/prod/v1/payment-gateways?country_code=ET&destination_type=BANK';

curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>'
  ),
));

$response = curl_exec($curl);
curl_close($curl);

echo $response;
?>
import requests

url = "{{BASE_URL}}/api/prod/v1/payment-gateways"
params = {
    "country_code": "ET",
    "destination_type": "BANK",
}
headers = {
    "Authorization": "Bearer <YOUR-ACCESS-TOKEN>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
import java.io.*;
import java.net.*;

public class GetPaymentGateways {
    public static void main(String[] args) throws Exception {
        String urlStr = "{{BASE_URL}}/api/prod/v1/payment-gateways?country_code=ET&destination_type=BANK";
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        conn.setRequestProperty("Authorization", "Bearer <YOUR-ACCESS-TOKEN>");

        try (BufferedReader br = new BufferedReader(
                new InputStreamReader(conn.getInputStream(), "utf-8"))) {
            StringBuilder response = new StringBuilder();
            String line;
            while ((line = br.readLine()) != null) {
                response.append(line.trim());
            }
            System.out.println(response.toString());
        }
    }
}

Sample Response

Below is a truncated example of a successful response.

{
  "status": true,
  "ResponseCode": "000",
  "Code": "SUCCESS",
  "CodeDescription": "Request processed successfully",
  "payment_gateways": [
    {
      "payment_gateway": "ethiopian-banks",
      "label": "Ethiopian Banks",
      "country_code": "ET",
      "currency": "ETB",
      "destination_type": "BANK",
      "validation": {
        "type": "remitxpress",
        "account_label": "Account Number",
        "pattern": "/^\\d{6,30}$/"
      },
      "institutions": [
        {
          "institution_code": "231416",
          "institution_name": "Abay Bank",
          "logo_url": "https://sit.api.r-cash.io/frontend/images/gateway/abay.png"
        },
        {
          "institution_code": "231406",
          "institution_name": "Abbysinia Bank",
          "logo_url": "https://sit.api.r-cash.io/backend/images/payment-gateways/abishianbank.webp"
        }
        // ... more institutions ...
      ]
    },
    {
      "payment_gateway": "somalia-mobile-money",
      "label": "Somalia Mobile Money",
      "country_code": "SO",
      "currency": "USD",
      "destination_type": "MOBILE_MONEY",
      "validation": {
        "type": "mobile_lookup",
        "country_calling_code": "252",
        "account_label": "Mobile Number",
        "pattern": "/^(?:\\+?252\\d{8,9}|\\d{6,12})$/"
      },
      "institutions": [
        {
          "institution_code": "Evcplus",
          "institution_name": "Evcplus",
          "logo_url": "https://sit.api.r-cash.io/frontend/images/gateway/Evcplus.png"
        }
        // ... more institutions ...
      ]
    }
    // ... more payment_gateways ...
  ]
}

Account Lookup

This API validates a destination account (e.g. mobile wallet or bank account) and, where possible, returns the account holder name and normalized account details before you submit a payout.

Endpoint

  • Sandbox: {{BASE_URL}}/api/sandbox/v1/accounts/lookup
  • Production: {{BASE_URL}}/api/prod/v1/accounts/lookup
HTTP Method:

POST

Authentication:

This endpoint requires a valid Bearer access token in the Authorization header.

Request Body Parameters (JSON):
Field Type Required Description Example
CountryCode String Yes Country calling code for the destination account. 254
InstitutionCode String Yes Institution or wallet code as returned by the Payment Gateways API (e.g. MPESA, AIRTEL). MPESA
Account String Yes Account identifier to be validated. For mobile money this is the MSISDN (with or without country code, depending on corridor rules). 254714511655
Sample Request:
curl --location '{{BASE_URL}}/api/prod/v1/accounts/lookup' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
--data '{
  "CountryCode": "254",
  "InstitutionCode": "MPESA",
  "Account": "254714511655"
}'
<?php
$payload = [
  "CountryCode"      => "254",
  "InstitutionCode"  => "MPESA",
  "Account"          => "254714511655",
];

$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL            => '{{BASE_URL}}/api/prod/v1/accounts/lookup',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING       => '',
  CURLOPT_MAXREDIRS      => 10,
  CURLOPT_TIMEOUT        => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST  => 'POST',
  CURLOPT_POSTFIELDS     => json_encode($payload),
  CURLOPT_HTTPHEADER     => [
    'Content-Type: application/json',
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests

url = "{{BASE_URL}}/api/prod/v1/accounts/lookup"
payload = {
    "CountryCode": "254",
    "InstitutionCode": "MPESA",
    "Account": "254714511655"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <YOUR-ACCESS-TOKEN>"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
import java.io.*;
import java.net.*;

public class AccountLookup {
    public static void main(String[] args) throws Exception {
        String urlStr = "{{BASE_URL}}/api/prod/v1/accounts/lookup";
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("POST");
        conn.setDoOutput(true);
        conn.setRequestProperty("Content-Type", "application/json");
        conn.setRequestProperty("Authorization", "Bearer <YOUR-ACCESS-TOKEN>");

        String json = "{"
            + "\"CountryCode\":\"254\","
            + "\"InstitutionCode\":\"MPESA\","
            + "\"Account\":\"254714511655\""
            + "}";

        try (OutputStream os = conn.getOutputStream()) {
            byte[] input = json.getBytes("utf-8");
            os.write(input, 0, input.length);
        }

        try (BufferedReader br = new BufferedReader(
                new InputStreamReader(conn.getInputStream(), "utf-8"))) {
            StringBuilder response = new StringBuilder();
            String line;
            while ((line = br.readLine()) != null) {
                response.append(line.trim());
            }
            System.out.println(response.toString());
        }
    }
}

Sample Response

Response Fields:
Field Type Description Example
status Boolean Indicates if the request was processed successfully at the API level. true
ResponseCode String Standard response code. 000 indicates success. 000
Code String High-level status, e.g. SUCCESS or error identifier. SUCCESS
CodeDescription String Human-readable description of the response. Request processed successfully
account_valid Boolean Whether the destination account passed validation with the upstream provider. true
country_code String Normalized country calling code of the account. 254
e164 String Account represented in E.164 format (for mobile accounts). +254714511655
account_name String Name associated with the account as returned by the provider. KELVIN WANJIRU
full_name String Same as account_name or a more complete version where available. KELVIN WANJIRU
rcash_account String / null If the destination is mapped to an internal R-Cash account, its identifier appears here; otherwise null. null
provider String Lookup provider type used (e.g. mobile, bank). mobile
source String Indicates whether the data came from R-Cash or an external provider. external
raw Object Detailed provider response used internally for auditing or debugging. Structure may vary by provider. { ... }
{
  "status": true,
  "ResponseCode": "000",
  "Code": "SUCCESS",
  "CodeDescription": "Request processed successfully",
  "account_valid": true,
  "country_code": "254",
  "e164": "+254714511655",
  "account_name": "KELVIN WANJIRU",
  "full_name": "KELVIN WANJIRU",
  "rcash_account": null,
  "provider": "mobile",
  "source": "external",
  "raw": {
    "country_code": "254",
    "e164": "+254714511655",
    "name": "KELVIN WANJIRU",
    "hit": true,
    "provider": "KenyaNameLookupProvider",
    "raw": {
      "name": "254714511655 - KELVIN WANJIRU",
      "refNo": "TKTBOBHQFC"
    }
  }
}

Send Money

This API enables sending money to supported destinations (e.g. bank accounts, mobile wallets) using the configured R-Cash payment gateways. Use the Get Countries, Payment Gateways and Account Lookup APIs to build and validate the payout before calling this endpoint.

Endpoint

  • Sandbox: {{BASE_URL}}/api/sandbox/v1/send-money
  • Production: {{BASE_URL}}/api/prod/v1/send-money
HTTP Method:

POST

Authentication:

This endpoint requires a valid Bearer access token in the Authorization header and a JSON request body.

Request Body Parameters (JSON):
Field Type Required Description Example
MerchantCode String / Numeric Yes R-Cash wallet number of the merchant initiating the payout. 5031
Amount Number Yes Amount to be sent, in the specified currency. 100
Currency String Yes ISO 4217 currency code for the payout. ETB
DestinationCountryCode String Yes ISO 3166-1 alpha-2 country code of the payout destination. Must match a country returned by the Get Countries API. ET
PaymentGateway String Yes Payment gateway alias (corridor) from the Payment Gateways API (e.g. ethiopian-banks, kenya-mobile-money). ethiopian-banks
InstitutionCode String Yes Institution code from payment_gateways[].institutions[].institution_code (e.g. a bank code or mobile money provider code). 231406
ReceiverAccount String Yes Destination account identifier (bank account number, mobile wallet MSISDN, etc.), validated according to the selected payment gateway. 107407723
ReceiverName String Yes Recipient name. Typically obtained/confirmed via the Account Lookup API. Ambashe dek
Reason String Yes Reason or narrative for the payment. Payment
InitiatorTransactionReference String Yes Unique reference generated by the merchant’s system. Must be unique per transaction. uniqueinitiatorcode2
CallBackUrl String Recommended HTTPS URL that will receive asynchronous transaction status notifications from R-Cash. https://webhook.site/your-callback-url
SenderName String Yes (for cross-border) Sender’s full name for compliance and audit. John Doe
SenderCountryCode String Yes (for cross-border) Sender’s country (ISO 3166-1 alpha-2). US
SenderPhone String Yes (for cross-border) Sender’s phone number. 0714511655
SenderAddressLine1 String Yes (for cross-border) Sender’s primary address line. address one
SenderAddressLine2 String No Sender’s secondary address line (optional). address two
SenderCity String Yes (for cross-border) Sender’s city. Nairobi
SenderDocumentType String Yes (for cross-border) Sender’s identification document type, e.g. ID, PASSPORT. PASSPORT
SenderDocumentNumber String Yes (for cross-border) Sender’s identification document number. 1234567
Sample Request:
curl --location '{{BASE_URL}}/api/prod/v1/send-money' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
--data '{
  "MerchantCode": "5031",
  "Amount": 100,
  "Currency": "ETB",
  "DestinationCountryCode": "ET",
  "PaymentGateway": "ethiopian-banks",
  "InstitutionCode": "231406",
  "ReceiverAccount": "107407723",
  "ReceiverName": "Ambashe dek",
  "Reason": "Payment",
  "InitiatorTransactionReference": "uniqueinitiatorcode2",
  "CallBackUrl": "https://webhook.site/your-callback-url",
  "SenderName": "John Doe",
  "SenderCountryCode": "US",
  "SenderPhone": "0714511655",
  "SenderAddressLine1": "address one",
  "SenderAddressLine2": "address two",
  "SenderCity": "Nairobi",
  "SenderDocumentType": "PASSPORT",
  "SenderDocumentNumber": "1234567"
}'
<?php
$payload = [
  "MerchantCode"                  => "5031",
  "Amount"                        => 100,
  "Currency"                      => "ETB",
  "DestinationCountryCode"        => "ET",
  "PaymentGateway"                => "ethiopian-banks",
  "InstitutionCode"               => "231406",
  "ReceiverAccount"               => "107407723",
  "ReceiverName"                  => "Ambashe dek",
  "Reason"                        => "Payment",
  "InitiatorTransactionReference" => "uniqueinitiatorcode2",
  "CallBackUrl"                   => "https://webhook.site/your-callback-url",
  "SenderName"                    => "John Doe",
  "SenderCountryCode"             => "US",
  "SenderPhone"                   => "0714511655",
  "SenderAddressLine1"            => "address one",
  "SenderAddressLine2"            => "address two",
  "SenderCity"                    => "Nairobi",
  "SenderDocumentType"            => "PASSPORT",
  "SenderDocumentNumber"          => "1234567",
];

$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL            => '{{BASE_URL}}/api/prod/v1/send-money',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING       => '',
  CURLOPT_MAXREDIRS      => 10,
  CURLOPT_TIMEOUT        => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST  => 'POST',
  CURLOPT_POSTFIELDS     => json_encode($payload),
  CURLOPT_HTTPHEADER     => [
    'Content-Type: application/json',
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests

url = "{{BASE_URL}}/api/prod/v1/send-money"
payload = {
    "MerchantCode": "5031",
    "Amount": 100,
    "Currency": "ETB",
    "DestinationCountryCode": "ET",
    "PaymentGateway": "ethiopian-banks",
    "InstitutionCode": "231406",
    "ReceiverAccount": "107407723",
    "ReceiverName": "Ambashe dek",
    "Reason": "Payment",
    "InitiatorTransactionReference": "uniqueinitiatorcode2",
    "CallBackUrl": "https://webhook.site/your-callback-url",
    "SenderName": "John Doe",
    "SenderCountryCode": "US",
    "SenderPhone": "0714511655",
    "SenderAddressLine1": "address one",
    "SenderAddressLine2": "address two",
    "SenderCity": "Nairobi",
    "SenderDocumentType": "PASSPORT",
    "SenderDocumentNumber": "1234567",
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <YOUR-ACCESS-TOKEN>",
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
import java.io.*;
import java.net.*;

public class SendMoney {
    public static void main(String[] args) throws Exception {
        String urlStr = "{{BASE_URL}}/api/prod/v1/send-money";
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("POST");
        conn.setDoOutput(true);
        conn.setRequestProperty("Content-Type", "application/json");
        conn.setRequestProperty("Authorization", "Bearer <YOUR-ACCESS-TOKEN>");

        String json = "{"
            + "\"MerchantCode\":\"5031\","
            + "\"Amount\":100,"
            + "\"Currency\":\"ETB\","
            + "\"DestinationCountryCode\":\"ET\","
            + "\"PaymentGateway\":\"ethiopian-banks\","
            + "\"InstitutionCode\":\"231406\","
            + "\"ReceiverAccount\":\"107407723\","
            + "\"ReceiverName\":\"Ambashe dek\","
            + "\"Reason\":\"Payment\","
            + "\"InitiatorTransactionReference\":\"uniqueinitiatorcode2\","
            + "\"CallBackUrl\":\"https://webhook.site/your-callback-url\","
            + "\"SenderName\":\"John Doe\","
            + "\"SenderCountryCode\":\"US\","
            + "\"SenderPhone\":\"0714511655\","
            + "\"SenderAddressLine1\":\"address one\","
            + "\"SenderAddressLine2\":\"address two\","
            + "\"SenderCity\":\"Nairobi\","
            + "\"SenderDocumentType\":\"PASSPORT\","
            + "\"SenderDocumentNumber\":\"1234567\""
            + "}";

        try (OutputStream os = conn.getOutputStream()) {
            byte[] input = json.getBytes("utf-8");
            os.write(input, 0, input.length);
        }

        try (BufferedReader br = new BufferedReader(
                new InputStreamReader(conn.getInputStream(), "utf-8"))) {
            StringBuilder response = new StringBuilder();
            String line;
            while ((line = br.readLine()) != null) {
                response.append(line.trim());
            }
            System.out.println(response.toString());
        }
    }
}

Sample Responses

Response Fields:
Field Type Description Example
status Boolean Indicates if the request was accepted for processing. true
ResponseCode String Standard response code. 000 indicates success. 000
Code String High-level status, e.g. SUCCESS or DUPLICATE_REFERENCE. SUCCESS
CodeDescription String Human-readable description of the response. Request processed successfully
detail String Additional description of the processing state (e.g. “Transaction is being processed”). Transaction is being processed
TrackingID String R-Cash tracking identifier for the transaction. Use this for reconciliation and support. 5031-f11d90d3-2acd-4ed2-88a8-149583e9b979
InitiatorTransactionReference String Echo of your original unique reference for idempotency and reconciliation. uniqueinitiatorcode24
DestinationCountryCode String Destination country code for the payout. ET
PaymentGateway String Payment gateway alias used for the transaction. ethiopian-banks
InstitutionCode String Institution code used for the payout. 231406
InstitutionName String Human-readable institution name for the payout. Abbysinia Bank
ReceiverAccount String Destination account identifier used for the transaction. 107407723
ReceiverName String Recipient name as stored/confirmed at processing time. Ambashe dek
Amount Number Transaction amount in the specified currency. 50
Currency String Currency code used for the transaction. ETB
Sender Object Nested object containing the sender’s KYC details at the time of the transaction. { ... }
Sender.name String Sender’s full name. John Doe
Sender.country_code String Sender’s country code. US
Sender.phone String Sender’s phone number. 0714511655
Sender.address_line1 String Sender’s primary address line. address one
Sender.address_line2 String Sender’s secondary address line. address two
Sender.city String Sender’s city. Nairobi
Sender.document_type String Type of document used for KYC (e.g. ID, PASSPORT). PASSPORT
Sender.document_number String Document number used for KYC. 1234567
Sender.date_of_birth String / null Date of birth if provided. null
details String (error) For error cases, a more detailed explanation (e.g. duplicate reference message). Duplicate InitiatorTransactionReference detected. Use a unique reference per transaction.
{
  "status": true,
  "ResponseCode": "000",
  "Code": "SUCCESS",
  "CodeDescription": "Request processed successfully",
  "detail": "Transaction is being processed",
  "TrackingID": "5031-f11d90d3-2acd-4ed2-88a8-149583e9b979",
  "InitiatorTransactionReference": "uniqueinitiatorcode24",
  "DestinationCountryCode": "ET",
  "PaymentGateway": "ethiopian-banks",
  "InstitutionCode": "231406",
  "InstitutionName": "Abbysinia Bank",
  "ReceiverAccount": "107407723",
  "ReceiverName": "Ambashe dek",
  "Amount": 50,
  "Currency": "ETB",
  "Sender": {
    "name": "John Doe",
    "country_code": "US",
    "phone": "0714511655",
    "address_line1": "address one",
    "address_line2": "address two",
    "city": "Nairobi",
    "document_type": "PASSPORT",
    "document_number": "1234567",
    "date_of_birth": null
  }
}
{
  "status": false,
  "ResponseCode": "401",
  "Code": "DUPLICATE_REFERENCE",
  "CodeDescription": "InitiatorTransactionReference has already been used",
  "details": "Duplicate InitiatorTransactionReference detected. Use a unique reference per transaction."
}

Webhook Notifications (CallBackUrl)

When you send a transaction via the Send Money API and include a CallBackUrl, R-Cash will POST an asynchronous notification to that URL once the transaction has been processed (success or failure).

This allows you to update your internal systems without polling the R-Cash API.

Delivery

  • HTTP Method: POST
  • Content-Type: application/json
  • Endpoint: Your system’s URL as provided in CallBackUrl when calling /send-money.
Callback Payload:

Below is the general structure of the JSON payload R-Cash sends to your CallBackUrl.

Field Type Description Example
status Boolean Indicates whether the transaction completed successfully. true for success, false for failure. true
ResponseCode String Final response code. 000 indicates success; non-000 indicates an error. 000
Code String Final status code, e.g. SUCCESS, FAILED, DUPLICATE_REFERENCE, etc. SUCCESS
CodeDescription String Human-readable description of the final status. Transaction completed successfully
TrackingID String R-Cash tracking identifier for the transaction (same as in the initial /send-money response). 5031-f11d90d3-2acd-4ed2-88a8-149583e9b979
InitiatorTransactionReference String Your original transaction reference passed in the InitiatorTransactionReference field. uniqueinitiatorcode24
TransactionStatus String Terminal transaction state, e.g. SUCCESS, FAILED, REVERSED. SUCCESS
FailureReason String / null Present only when status is false. Describes why the transaction failed. Insufficient funds at destination
DestinationCountryCode String Destination country code. ET
PaymentGateway String Payment gateway alias used for processing. ethiopian-banks
InstitutionCode String Institution code used for the transaction. 231406
InstitutionName String Human-readable name of the destination institution. Abbysinia Bank
ReceiverAccount String Destination account identifier (bank account or wallet MSISDN). 107407723
ReceiverName String Recipient name at processing time. Ambashe dek
Amount Number Final processed amount. 50
Currency String Currency of the transaction. ETB
processed_at String Timestamp (ISO 8601) when the transaction reached its terminal state. 2025-11-29T12:34:56Z
Sender Object Nested object containing sender KYC information (same shape as in the send-money response). { ... }
Sample Callback Payloads:
{
  "status": true,
  "ResponseCode": "000",
  "Code": "SUCCESS",
  "CodeDescription": "Transaction completed successfully",
  "TransactionStatus": "SUCCESS",
  "FailureReason": null,
  "TrackingID": "5031-f11d90d3-2acd-4ed2-88a8-149583e9b979",
  "InitiatorTransactionReference": "uniqueinitiatorcode24",
  "DestinationCountryCode": "ET",
  "PaymentGateway": "ethiopian-banks",
  "InstitutionCode": "231406",
  "InstitutionName": "Abbysinia Bank",
  "ReceiverAccount": "107407723",
  "ReceiverName": "Ambashe dek",
  "Amount": 50,
  "Currency": "ETB",
  "processed_at": "2025-11-29T12:34:56Z",
  "Sender": {
    "name": "John Doe",
    "country_code": "US",
    "phone": "0714511655",
    "address_line1": "address one",
    "address_line2": "address two",
    "city": "Nairobi",
    "document_type": "PASSPORT",
    "document_number": "1234567",
    "date_of_birth": null
  }
}
{
  "status": false,
  "ResponseCode": "402",
  "Code": "FAILED",
  "CodeDescription": "Transaction failed at destination",
  "TransactionStatus": "FAILED",
  "FailureReason": "Destination institution rejected the transaction",
  "TrackingID": "5031-f11d90d3-2acd-4ed2-88a8-149583e9b979",
  "InitiatorTransactionReference": "uniqueinitiatorcode24",
  "DestinationCountryCode": "ET",
  "PaymentGateway": "ethiopian-banks",
  "InstitutionCode": "231406",
  "InstitutionName": "Abbysinia Bank",
  "ReceiverAccount": "107407723",
  "ReceiverName": "Ambashe dek",
  "Amount": 50,
  "Currency": "ETB",
  "processed_at": "2025-11-29T12:40:21Z",
  "Sender": {
    "name": "John Doe",
    "country_code": "US",
    "phone": "0714511655",
    "address_line1": "address one",
    "address_line2": "address two",
    "city": "Nairobi",
    "document_type": "PASSPORT",
    "document_number": "1234567",
    "date_of_birth": null
  }
}

Implementation Tips

  • Always verify the TrackingID and InitiatorTransactionReference against your records.
  • Treat callbacks as idempotent: if you receive the same TrackingID more than once, update the same transaction record.
  • Respond with HTTP 200 OK once your system has successfully processed the callback.

Collection:

The R-Cash Collection API allows users to collect funds from various channels, including R-Cash Wallet, M-PESA, Airtel Money, T-Kash, and banks..

Initiate Payment Request

With the R-Cash Request Payment API, you can initiate payment requests to users — including those not registered on R-Cash — through mobile money platforms like M-PESA, Airtel Money, T-Kash, and through banks.

Once the payment request is initiated:

  • The recipient receives an STK push prompt on their phone (where applicable).
  • A payment link is sent for convenience.
  • Clear instructions are provided to guide them through completing the payment — especially for channels like Pesalink, which require a transaction reference as the narration.

Endpoint

  • Sandbox: https://api.r-cash.io/api/sandbox/v1/collection/initiate
  • Production: https://api.r-cash.io/api/prod/v1/collection/initiate
Sample Request:
curl -X POST 'https://api.r-cash.io/api/sandbox/v1/collection/initiate' \
  -H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
  -F 'MerchantCode=5125' \
  -F 'Amount=10' \
  -F 'Currency=KES' \
  -F 'PhoneNumber=0759231969' \
  -F 'Channel=63902' \
  -F 'CallBackUrl=https://webhook.site/your-callback-url' \
  -F 'Reason=33' \
  -F 'InitiatorTransactionReference=4334315w2'
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.r-cash.io/api/sandbox/v1/collection/initiate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => [
    'MerchantCode' => '5125',
    'Amount' => '10',
    'Currency' => 'KES',
    'PhoneNumber' => '0759231969',
    'Channel' => '63902',
    'CallBackUrl' => 'https://webhook.site/your-callback-url',
    'Reason' => '33',
    'InitiatorTransactionReference' => '4334315w2',
  ],
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests

url = "https://api.r-cash.io/api/sandbox/v1/collection/initiate"
data = {
  "MerchantCode": "5125",
  "Amount": "10",
  "Currency": "KES",
  "PhoneNumber": "0759231969",
  "Channel": "63902",
  "CallBackUrl": "https://webhook.site/your-callback-url",
  "Reason": "33",
  "InitiatorTransactionReference": "4334315w2"
}

headers = {
  "Authorization": "Bearer <YOUR-ACCESS-TOKEN>"
}

response = requests.post(url, headers=headers, data=data)
print(response.json())
// Java HttpClient or HttpURLConnection setup goes here
// Sample: send POST request with fields above
// Include Authorization header: Bearer <YOUR-ACCESS-TOKEN>

Sample Response

{
  "status": true,
  "detail": "STK Push sent. Enter your PIN to complete transaction",
  "TrackingID": "5125-c1fd69f1-48b8-4b25-8801-f8fc288ce409",
  "PaymentGateway": "R-Cash",
  "InitiatorTransactionReference": "4334315w2",
  "InvoiceNumber": "PC73",
  "ResponseCode": "0",
  "ResponseDescription": "Success. Request accepted for processing",
  "PaymentLink": "https://checkout.r-cash.io/pay?data=TWVyY2hhbnRDb2RlPTUxMjUmQW1vdW50PTEwJkNoYW5uZWxDb2RlPTYzOTAyJkludm9pY2VOdW1iZXI9UEM3MyZFbnZpcm9ubWVudD1sb2NhbA%3D%3D"
}
{
  "status": false,
  "message": "Transaction failed. Insufficient balance.",
  "details": "Please check your balance and try again.",
  "ResponseCode": "400"
}