The fastest way to integrate mobile money payments. No backend required for the basic widget.
We provide two keys in your dashboard.
Use this in your frontend code (HTML Widget, React). It is safe to expose.
Use this on your server only. Never share it or commit it to client-side code.
Base URL: https://lipafy.xyz/api
/mpesa/stk-pushInitiate an STK Push to a phone number.
curl -X POST https://lipafy.xyz/api/mpesa/stk-push \ -u sk_live_...: \ -d amount=500 \ -d phone=254712345678
/payments/{id}Check the status of a payment.
A fully typed client for managing payments and subscriptions.
npm install lipafy-sdk
Usage
import { Lipafy } from 'lipafy-sdk';
const lipafy = new Lipafy("sk_live_...");
await lipafy.payments.create({
amount: 500,
phone: "254712...",
currency: "KES"
});Coming soon. Use REST API for now.
Coming soon. Use REST API for now.
Add the snippet to your <head> and use data attributes to trigger payments.
<script src="https://lipafy.xyz/widget.js"
data-publishable-key="pk_test_..."></script>
<!-- The Button -->
<button
data-lipafy-amount="1500"
data-lipafy-merchant="My Store"
class="pay-btn"
>
Pay KES 1,500
</button>
<!-- Subscription Example -->
<button
data-lipafy-amount="2000"
data-lipafy-merchant="My SaaS"
data-lipafy-type="monthly"
data-lipafy-plan="Premium Plan"
class="pay-btn"
>
Subscribe KES 2,000/mo
</button>Lipafy handles recurring billing automatically. We support Weekly, Monthly, and Yearly cycles. We handle reminders, dunning (grace periods), and auto-cancellation.
Active
Payment successful. Service is live.
Reminder (Day -3)
We send a WhatsApp reminder 3 days before renewal.
Failure & Dunning
If payment fails, we can optionally enter a Grace Period (configurable in your dashboard). We'll send reminders every few days.
Cancellation
If the grace period expires without payment, the subscription is cancelled.
<button data-lipafy-amount="2500" data-lipafy-type="monthly" data-lipafy-plan="Premium Plan" > Subscribe KES 2,500/mo </button>
Just add data-lipafy-type="monthly" to your widget button. We handle the rest.
You don't need accurate money to test. Lipafy comes with a built-in Simulator that mimics real network conditions.
07... or 254....Lipafy sends POST requests to your callback URL for real-time payment updates.
{
"event": "payment.succeeded",
"paymentId": "pay_8a9s8d9a8s...",
"amount": 1500,
"currency": "KES",
"phone": "254712345678",
"provider": "simulated",
"timestamp": "2024-02-01T10:00:00Z"
}Lipafy provides automated customer notifications via WhatsApp. You don't need to manage templates; we handle everything.
Instant confirmation message with transaction reference sent to the user after success.
Friendly reminders sent 3 days before renewal to ensure users have funds available.