Build with LeefiPay

Secure REST APIs, signed webhooks, and ready-made plugins. Authenticate with Bearer tokens from your dashboard.

Developer console Create developer account Business API keys OpenAPI Spec Postman Collection WooCommerce Plugin Composer Package
A

Authentication

Bearer tokens, scopes, and Test Connection.

Open documentation →
{ }

REST API

Invoices, payments, customers, and integrations.

Open documentation →

Webhooks

HMAC verification and event payloads.

Open documentation →
W

WooCommerce

Install the gateway and map dashboard credentials.

Open documentation →
C

Composer Package

Official Laravel SDK — leefipay/mpesa on Packagist.

View on Packagist →
</>

SDK examples

cURL, PHP, Node, Python, and Laravel.

Open documentation →
P

Postman

Download the v1 collection.

Download →
O

OpenAPI

Machine-readable API specification.

Download →
R

Rate limits

Per-token throttles and plan limits.

Open documentation →

Authentication

Issue credentials from Settings → API & Integrations. Send Authorization: Bearer {secret}. Base URL: https://leefipay.com/api/v1.

Webhooks

Deliveries are signed with HMAC-SHA256(timestamp + "." + body, secret) using headers X-LeefiPay-Timestamp, X-LeefiPay-Signature, and X-LeefiPay-Event.

Rate limits & errors

Default throttle is 60 requests / minute. Responses use a JSON envelope with success, message, data, and optional errors.

Composer Package

Official Laravel package for the LeefiPay M-Pesa Open API: leefipay/mpesa. STK Push, payment status, channels, and signed webhooks — without calling Daraja directly.

composer require leefipay/mpesa

Configure .env with your dashboard secret Bearer token, then:

use LeefiPay\Mpesa\Facades\LeefiPay;

$response = LeefiPay::stkPush([
    'phone' => '254700000000',
    'amount' => 100,
    'payment_channel_id' => 1,
    'reference' => 'ORDER-1001',
]);

Full install, config, and webhook docs: packagist.org/packages/leefipay/mpesa.

Examples

cURL

curl -X POST "https://leefipay.com/api/v1/integrations/test" \
  -H "Authorization: Bearer YOUR_SECRET_API_KEY" \
  -H "Accept: application/json"

Node.js

const res = await fetch('https://leefipay.com/api/v1/integrations/test', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.LEEFIPAY_SECRET}`, Accept: 'application/json' },
});
console.log(await res.json());

Python

import requests
print(requests.post(
  "https://leefipay.com/api/v1/integrations/test",
  headers={"Authorization": f"Bearer {secret}", "Accept": "application/json"},
).json())

Laravel (Composer package)

composer require leefipay/mpesa

use LeefiPay\Mpesa\Facades\LeefiPay;

LeefiPay::testConnection();

Package details and more: https://packagist.org/packages/leefipay/mpesa