Developers

Mobile money in your product, with one API

A clean REST API for collections in Tanzania: push a payment prompt to any M-Pesa, Mixx by Yas, Airtel Money or HaloPesa number and get a signed webhook when it is paid.

  1. 1

    Verify your business

    Create an account and complete verification in the dashboard.

  2. 2

    Request API access

    Under Developers › API keys, tell us what you are building. We review it quickly.

  3. 3

    Generate a key

    Create as many live keys as you need, each with its own ID. Delete any key at any time.

  4. 4

    Collect and listen

    Call POST /payments and handle the payment.succeeded webhook.

Request a payment

Send an amount and the customer’s number in any Tanzanian format. We detect the network, push the prompt and return the payment straight away with status processing.

  • Idempotency keys: retry safely, never charge twice
  • Webhooks signed with HMAC-SHA256, retried for a day
  • A pay box for landing pages: customers type 07…/06… and approve on their phone, no server needed
  • Payment links and a copy-paste checkout button
  • Per-key IP allow-lists and rate limits
<?php
$ch = curl_init('https://kashlipa.com/api/v1/payments');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('KASHLIPA_SECRET_KEY'),
        'Content-Type: application/json',
        'Idempotency-Key: order-1042',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'amount' => 25000,
        'phone' => '0754123456',
        'reference' => 'ORDER-1042',
    ]),
]);
$payment = json_decode(curl_exec($ch), true)['data'];

Endpoints

Base URL https://kashlipa.com/api/v1

POST /payments Request a payment (USSD prompt to the customer)
GET /payments/{id} Get a payment and its status
GET /payments List payments with filters
POST /payment-links Create a payment link with a hosted page
GET /payment-links List payment links
GET /balance Your available balance
GET /channels Networks you can collect with

Networks: Vodacom M-Pesa, Mixx by Yas, Airtel Money, HaloPesa.