For developers
Mobile money in your product, with a few lines of code.
One API for Airtel Money, TNM Mpamba and bank payments. Create a checkout, send money out, and get a signed webhook for every payment.
const primepay = new PrimePay(process.env.PRIMEPAY_SECRET_KEY);
const session = await primepay.checkout.sessions.create({
amount: 24390,
currency: "MWK",
methods: ["airtel_money", "tnm_mpamba", "bank"],
success_url: "https://yourshop.mw/thanks",
});
res.redirect(session.url);Quickstart
From sandbox to live in three steps.
Build and test without moving real money. Switch to live keys once your business is verified.
Get your sandbox keys
Open an account and copy your test keys from the dashboard.
Make a test payment
Use a sandbox number to try success, failure and timeouts.
Go live
Verify your business, swap in your live keys, and take real payments.
Webhooks
Know the moment money moves.
PrimePay calls your server for every event, signed with your webhook secret. Check the signature, then update the order.
checkout.completedA customer paid a checkout or payment link.payment.failedA payment was declined, cancelled or timed out.payout.sentA payout reached the mobile money number or bank.settlement.paidA settlement landed in your bank account.
const rawBody = express.raw({ type: "application/json" });
app.post("/webhooks/primepay", rawBody, (req, res) => {
const event = primepay.webhooks.verify(
req.body,
req.headers["primepay-signature"],
process.env.PRIMEPAY_WEBHOOK_SECRET,
);
if (event.type === "checkout.completed") {
markOrderPaid(event.data.reference);
}
res.sendStatus(200);
});Sandbox
Test numbers for every outcome.
Use these with your sandbox keys. Any PIN works, and no real money moves.
| Network | Number | What happens |
|---|---|---|
0990 000 001 | Payment succeeds | |
0990 000 002 | Fails: not enough balance | |
0990 000 003 | Customer never enters PIN | |
TNM Mpamba | 0880 000 001 | Payment succeeds |
TNM Mpamba | 0880 000 002 | Fails: wrong PIN |
TNM Mpamba | 0880 000 404 | Number check fails |
Resources
Everything else you’ll need.
- API referenceEvery endpoint, field and error code.
- GuidesCheckout, payment links, payouts and webhooks, step by step.
- Payment links APICreate links in bulk from your own system.
Is something not working?
See the live state of payments, payouts and the dashboard, and any work in progress.
Yes. Every account gets sandbox keys as soon as it’s created, and nothing in the sandbox moves real money.
No. Build and test with sandbox keys straight away. You only need a verified business to get live keys.
Any language that can make HTTPS requests. The docs have examples in Node.js, PHP and cURL.
Use a tunnel such as ngrok to expose your local server, add its URL in the dashboard, and send test events from there.
Check the status page first. If everything is normal there, contact support with the payment ID and the time of the request.
Get your sandbox keys.
Open an account and make your first test payment in minutes.
