curl, so there is nothing to install.
Before you begin
- A PrimePay account. Sign up on the dashboard.
- A test secret key (
sk_test_…) from your account’s API keys page. - A webhook endpoint added under Settings › Webhooks: a public
https://address on your server where PrimePay sends payment results. A payment is refused withwebhook_url_requireduntil you have one.
Keep secret keys on your server. Never put one in a mobile app, a web page or a public repository.
Take a test payment
1
List the operators
Each mobile money operator has an id. You send that id as Copy the
provider when you create a payment.refId of Airtel Money or TNM Mpamba from the response.2
Create the payment
Send the amount, the customer’s number, the operator and your own order number. The You get
Idempotency-Key makes a retry safe: the same key never charges twice.202 Accepted with a reference and "status": "processing". On the live API the customer now sees a PIN prompt on their phone. In the sandbox any number pays, and the payment finishes on its own about 3 seconds later.3
Check the result
Use the When
reference from the last step.status is success, the payment is complete and you can hand over the goods.Next steps
Payments
Every field, the payment statuses and refunds.
Webhooks
Receive results and check their signature.
Testing in sandbox
What the sandbox does and doesn’t cover.
Payment links
Take payments without building a checkout.

