Skip to main content
A payment collects money from a customer’s mobile money account into your account. The customer approves it on their phone, so the result arrives later, by webhook: to your endpoints under Settings › Webhooks, or to the payment’s own callbackUrl. You can also check a payment at any time with GET /v1/payments/{reference}.

Operators

Get the operators with GET /mobile-money/operators?country=MW and send an operator’s refId as provider when you create a payment. A publishable key is enough for this call.

How a payment runs

1

You create the payment

POST /v1/payments/mobile-money with the amount, the customer’s number, the operator and your merchantOrderId. The payment collects into the account that owns the API key.
2

PrimePay answers 202 Accepted

The response has a reference and "status": "processing". If the operator refuses the request straight away, the answer is 402 with "status": "failed" and a failureCode.
3

The customer approves on their phone

This can take a few seconds or a couple of minutes.
4

You get the result

A webhook tells you the payment is success or failed. Hand over the goods only on success.
Never treat a timeout or an error from PrimePay as a failed payment. Check its status first.

Fields

Payment status

Check a payment with GET /v1/payments/{reference}, or find the newest payment for an order with GET /v1/payments?merchantOrderId=ORDER-5531.

Collecting for a sub-merchant (aggregators)

Aggregator accounts collect on behalf of sub-merchants linked to them, with POST /v1/sub-merchants/{subMerchantCode}/payments/mobile-money. The body is the same as an ordinary payment, and subMerchantCode is the sub-merchant’s 8-digit account code. The sub-merchant is credited and you keep the fee the sub-merchant agreed to when they accepted your link. That fee can’t be set or changed per payment. Don’t send subMerchantAccountCode or aggregatorFee in the body.

Refunds

POST /v1/payments/{reference}/refunds sends money back to the number that paid, in full or in part. Leave out amount to refund everything still refundable.
  • Refunds need a full secret key and an Idempotency-Key header. Payments-only keys are refused.
  • A refund comes out of the payment’s money not yet settled first, then your available balance. PrimePay’s fee isn’t returned.
  • It is processing until the network answers, then success or failed. A failed refund’s money goes back to your balance.
  • Several partial refunds are fine until they add up to the payment’s amount.
GET /v1/payments/{reference}/refunds lists a payment’s refunds with refundable (what is left). GET /v1/refunds/{reference} returns one refund.

Payment errors

Refund errors