Introduction Last updated: 3 days ago

Propel 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 Propel API, you will need a client ID and client secret. Both sandbox and production credentials can be generated from your Propel account under the "Settings" section, specifically in the "API Keys" area..

Propel Account

To create a Propel account, you need to register at https://pay.propel.co.ke/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

Propel API uses Bearer Token Authentication. Generate your access token using your credentials:

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

Callout Examples:

Endpoint

    https://api.propel.co.ke
  • Sandbox: https://api.propel.co.ke/api/sandbox/v1/auth/token/?grant_type=client_credentials
  • Production: https://api.propel.co.ke/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://sandbox.propel.co.ke/api/v1/auth/token/?grant_type=client_credentials' \
  -H 'Authorization: Basic <base64(client_id:client_secret)>'
<?php
$url = 'https://sandbox.propel.co.ke/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.propel.co.ke/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 PropelToken {
  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.propel.co.ke/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 Propel Wallet Number 5001
curl -X GET 'https://sandbox.propel.co.ke/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.propel.co.ke/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.propel.co.ke/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.propel.co.ke/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 Propel 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.propel.co.ke/api/sandbox/v1/accounts/transactions?MerchantCode=5**5&start_date=2024-03-01&end_date=2024-03-25&per_page=15
  • Production: https://api.propel.co.ke/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 Propel 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.propel.co.ke/sandbox.propel.co.ke/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.propel.co.ke/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.propel.co.ke/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.propel.co.ke/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, send to banks, and business-to-business (B2B) transactions.

Send To Mobile

This API enables sending money to mobile wallets eg Propel,M-pesa,Airtel e.t.c

Endpoint

  • Sandbox: https://api/sandbox/v1/send-money/send-to-mobile
  • Production: https://api/prod/v1/send-money/send-to-mobile
Request Parameters:
Field Type Description Example
MerchnatCode Numeric Propel Wallet Number 5001
Amount Numeric The amount of money being sent. 20.00
Currency String Alpha codes and numeric codes for currency representation for the recipient account KES
InitiatorTransactionReference String A unique identifier of the transaction generated by the Merchant system(Your System) 3f9c09d2-1e36-4b61-9c9a-7cbdd3ef51a4
ReceiverNumber String The customer mobile receiving funds. Mobile number must include country code, e.g., 254714511655.. "254714511655"
Channel String The code representing the entity where the receiving account belong. confirm with channel code api to retrieve the code Propel
Reason String Reason for sending the fund Salary disbursement
CallBackUrl String URL specified to receive notification from Propel upon processing of the payment request. https://webhook.site/32d070dc-ef7f-4c44-82b5-626e96826f94
Sample Request:
curl -X POST 'https://api.propel.co.ke/sandbox/api/v1/send-money/send-to-mobile' \
  -H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
  -F 'MerchantCode=5126' \
  -F 'Amount=20' \
  -F 'Currency=KES' \
  -F 'ReceiverNumber=0759231969' \
  -F 'Channel=63902' \
  -F 'Reason=test' \
  -F 'InitiatorTransactionReference=12894850' \
  -F 'CallBackUrl=https://your-callback.url'
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.propel.co.ke/sandbox/api/v1/send-money/send-to-mobile',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => array(
    'MerchantCode' => '5126',
    'Amount' => '20',
    'Currency' => 'KES',
    'ReceiverNumber' => '0759231969',
    'Channel' => '63902',
    'Reason' => 'test',
    'InitiatorTransactionReference' => '12894850',
    'CallBackUrl' => 'https://your-callback.url'
  ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>'
  ),
));

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

url = "https://api.propel.co.ke/sandbox/api/v1/send-money/send-to-mobile"
payload = {
    "MerchantCode": "5126",
    "Amount": "20",
    "Currency": "KES",
    "ReceiverNumber": "0759231969",
    "Channel": "63902",
    "Reason": "test",
    "InitiatorTransactionReference": "12894850",
    "CallBackUrl": "https://your-callback.url"
}
headers = {
    "Authorization": "Bearer <YOUR-ACCESS-TOKEN>"
}

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

public class SendMoneyMobile {
  public static void main(String[] args) throws IOException {
    String url = "https://api.propel.co.ke/sandbox/api/v1/send-money/send-to-mobile";
    String token = "<YOUR-ACCESS-TOKEN>";

    String data = "MerchantCode=5126&Amount=20&Currency=KES&ReceiverNumber=0759231969" +
                  "&Channel=63902&Reason=test&InitiatorTransactionReference=12894850" +
                  "&CallBackUrl=https://your-callback.url";

    HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
    conn.setRequestMethod("POST");
    conn.setDoOutput(true);
    conn.setRequestProperty("Authorization", "Bearer " + token);
    conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

    OutputStream os = conn.getOutputStream();
    os.write(data.getBytes());
    os.flush();
    os.close();

    BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    while ((line = br.readLine()) != null) {
      System.out.println(line);
    }
    br.close();
  }
}

Sample Response

{
  "status": true,
  "detail": "Transaction is being processed",
  "TrackingID": "5125-c0ecab3b-4615-45a9-b409-04923b3b7dcb",
  "InitiatorTransactionReference": "1289485044",
  "ResponseCode": "0",
  "ResponseDescription": "Transaction is being processed"
}
{
  "status": false,
  "message": "Duplicate InitiatorTransactionReference  detected.",
  "details": "use unique InitiatorTransactionReference.",
  "ResponseCode": "409"
}

Send To Bank

This API enables sending money to local banks. Confirm the availabe banks via the get Channels Api

Endpoint

  • Sandbox: https://api/sandbox/v1/send-money/send-to-bank
  • Production: https://prod//api/v1/send-money/send-to-bank
Request Parameters:
Field Type Description Example
MerchnatCode Numeric Propel Wallet Number 5001
Amount Numeric The amount of money being sent.Minimum is KES 100 100.00
Currency String Alpha codes and numeric codes for currency representation for the recipient account KES
InitiatorTransactionReference String A unique identifier of the transaction generated by the Merchant system(Your System) 3f9c09d2-1e36-4b61-9c9a-7cbdd3ef51a4
ReceiverNumber String The customer bank account receiving funds. 0650199612624
Channel String The code representing the entity where the receiving account belong. confirm with channel code api to retrieve the code 68
Reason String Reason for sending the fund Salary disbursement
CallBackUrl String URL specified to receive notification from Propel upon processing of the payment request. https://webhook.site/32d070dc-ef7f-4c44-82b5-626e96826f94
Sample Request:
curl -X POST https://api/sandbox/v1/send-money/send-to-bank \
  -H "Authorization: Bearer <YOUR-ACCESS-TOKEN>" \
  -F "MerchantCode=5126" \
  -F "Amount=20" \
  -F "Currency=KES" \
  -F "ReceiverNumber=0759231969" \
  -F "Channel=123456" \
  -F "Reason=test" \
  -F "InitiatorTransactionReference=12894850" \
  -F "CallBackUrl=https://webhook.site/your-callback-url"
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api/sandbox/v1/send-money/send-to-bank',
  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 => array(
    'MerchantCode' => '5126',
    'Amount' => '20',
    'Currency' => 'KES',
    'ReceiverNumber' => '0759231969',
    'Channel' => '123456',
    'Reason' => 'test',
    'InitiatorTransactionReference' => '12894850',
    'CallBackUrl' => 'https://webhook.site/your-callback-url'
  ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>'
  ),
));

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

echo $response;
?>
import requests

url = "https://api/sandbox/v1/send-money/send-to-bank"
payload = {
  "MerchantCode": "5126",
  "Amount": "20",
  "Currency": "KES",
  "ReceiverNumber": "0759231969",
  "Channel": "123456",
  "Reason": "test",
  "InitiatorTransactionReference": "12894850",
  "CallBackUrl": "https://webhook.site/your-callback-url"
}
headers = {
  "Authorization": "Bearer <YOUR-ACCESS-TOKEN>"
}

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

public class SendToBank {
  public static void main(String[] args) throws Exception {
    URL url = new URL("https://api/sandbox/v1/send-money/send-to-bank");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("POST");
    conn.setDoOutput(true);
    conn.setRequestProperty("Authorization", "Bearer <YOUR-ACCESS-TOKEN>");

    String data = "MerchantCode=5126&Amount=20&Currency=KES&ReceiverNumber=0759231969&Channel=123456&Reason=test&InitiatorTransactionReference=12894850&CallBackUrl=https://webhook.site/your-callback-url";

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

    // Handle response...
  }
}

Sample Response

{
  "status": true,
  "detail": "Transaction is being processed",
  "TrackingID": "5125-c0ecab3b-4615-45a9-b409-04923b3b7dcb",
  "InitiatorTransactionReference": "1289485044",
  "ResponseCode": "0",
  "ResponseDescription": "Transaction is being processed"
}
{
  "status": false,
  "message": "Duplicate InitiatorTransactionReference  detected.",
  "details": "use unique InitiatorTransactionReference.",
  "ResponseCode": "409"
}

Send To Paybill/Till (B2B)

This API enables sending money to Paybill and Till. Confirm the available Entities via the get Channels Api.

Endpoint

  • Sandbox: https://api.propel.co.ke/api/sandbox/v1/send-money/b2b
  • Production: https://api.propel.co.ke/api/prod/v1/send-money/b2b
Request Parameters:
Field Type Description Example
MerchnatCode Numeric Propel Wallet Number 5001
Amount Numeric The amount of money being sent.Minimum is KES 100 100.00
Currency String Alpha codes and numeric codes for currency representation for the recipient account KES
InitiatorTransactionReference String A unique identifier of the transaction generated by the Merchant system(Your System) 3f9c09d2-1e36-4b61-9c9a-7cbdd3ef51a4
BusinessNumber String The Paybill/Till receiving funds. 247247
BusinessType String Either TILL OR PAYBILL PAYBILL
AccountNumber String Nullable incase of a TILL 0650199612624
Channel String The code representing the entity where the receiving account belong. confirm with channel code api to retrieve the code 68
Reason String Reason for sending the fund Salary disbursement
CallBackUrl String URL specified to receive notification from Propel upon processing of the payment request. https://webhook.site/32d070dc-ef7f-4c44-82b5-626e96826f94
Sample Request:
curl -X POST 'https://api.propel.co.ke/api/sandbox/v1/send-money/b2b' \
  -H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
  -F 'MerchantCode=5125' \
  -F 'Amount=100' \
  -F 'Currency=KES' \
  -F 'BusinessNumber=247247' \
  -F 'Channel=63902' \
  -F 'Reason=test' \
  -F 'InitiatorTransactionReference=1247545ee744t443' \
  -F 'CallBackUrl=https://webhook.site/your-callback-url' \
  -F 'BusinessType=PAYBILL' \
  -F 'AccountNumber=0650199612624'
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.propel.co.ke/api/sandbox/v1/send-money/b2b',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => [
    'MerchantCode' => '5125',
    'Amount' => '100',
    'Currency' => 'KES',
    'BusinessNumber' => '247247',
    'Channel' => '63902',
    'Reason' => 'test',
    'InitiatorTransactionReference' => '1247545ee744t443',
    'CallBackUrl' => 'https://webhook.site/your-callback-url',
    'BusinessType' => 'PAYBILL',
    'AccountNumber' => '0650199612624',
  ],
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <YOUR-ACCESS-TOKEN>',
  ],
]);

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

url = "https://api.propel.co.ke/api/sandbox/v1/send-money/b2b"
data = {
  "MerchantCode": "5125",
  "Amount": "100",
  "Currency": "KES",
  "BusinessNumber": "247247",
  "Channel": "63902",
  "Reason": "test",
  "InitiatorTransactionReference": "1247545ee744t443",
  "CallBackUrl": "https://webhook.site/your-callback-url",
  "BusinessType": "PAYBILL",
  "AccountNumber": "0650199612624"
}

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

response = requests.post(url, headers=headers, data=data)
print(response.json())
// Java implementation would typically use HttpClient or HttpURLConnection
// Sample placeholder:

// Build POST body and send using Java HttpClient
// Set Authorization header to: Bearer <YOUR-ACCESS-TOKEN>

Sample Response

{
  "status": true,
  "detail": "Transaction is being processed",
  "TrackingID": "5125-c0ecab3b-4615-45a9-b409-04923b3b7dcb",
  "InitiatorTransactionReference": "1247545ee744t443",
  "ResponseCode": "0",
  "ResponseDescription": "Transaction is being processed"
}
{
  "status": false,
  "message": "Duplicate InitiatorTransactionReference  detected.",
  "details": "use unique InitiatorTransactionReference.",
  "ResponseCode": "409"
}

Collection:

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

Initiate Payment Request

With the Propel Request Payment API, you can initiate payment requests to users — including those not registered on Propel — 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.propel.co.ke/api/sandbox/v1/collection/initiate
  • Production: https://api.propel.co.ke/api/prod/v1/collection/initiate
Sample Request:
curl -X POST 'https://api.propel.co.ke/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.propel.co.ke/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.propel.co.ke/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": "Propel",
  "InitiatorTransactionReference": "4334315w2",
  "InvoiceNumber": "PC73",
  "ResponseCode": "0",
  "ResponseDescription": "Success. Request accepted for processing",
  "PaymentLink": "https://checkout.propel.co.ke/pay?data=TWVyY2hhbnRDb2RlPTUxMjUmQW1vdW50PTEwJkNoYW5uZWxDb2RlPTYzOTAyJkludm9pY2VOdW1iZXI9UEM3MyZFbnZpcm9ubWVudD1sb2NhbA%3D%3D"
}
{
  "status": false,
  "message": "Transaction failed. Insufficient balance.",
  "details": "Please check your balance and try again.",
  "ResponseCode": "400"
}