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.

  1. Get your sandbox keys

    Open an account and copy your test keys from the dashboard.

  2. Make a test payment

    Use a sandbox number to try success, failure and timeouts.

  3. 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.

Sandbox test numbers and what they do
NetworkNumberWhat happens
Airtel Money0990 000 001Payment succeeds
Airtel Money0990 000 002Fails: not enough balance
Airtel Money0990 000 003Customer never enters PIN
TNM Mpamba0880 000 001Payment succeeds
TNM Mpamba0880 000 002Fails: wrong PIN
TNM Mpamba0880 000 404Number check fails

Resources

Everything else you’ll need.

Is something not working?

See the live state of payments, payouts and the dashboard, and any work in progress.

View system status

FAQ

Developer questions.

Can't find what you need? Our team is happy to help.

Contact us

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.