Skip to main content
POST
Create a payment

Authorizations

Authorization
string
header
required

Your API key: sk_live_… / sk_test_… (secret), pk_live_… / pk_test_… (publishable, read-only reference data) or rk_live_… / rk_test_… (payments only).

Headers

Idempotency-Key
string
required

A new value for every new payment (a UUID is ideal), 8 to 255 characters. If your request times out, send it again with the same key to get the first result back instead of a second payment. The same key with a different body is refused.

Required string length: 8 - 255
Example:

"6f1c2b9e8a6d4c1f9b0e3a7d5c2f8e10"

Body

application/json
amount
number
required

What your customer owes. Depending on your fee setting, the customer may pay PrimePay's fee on top.

Example:

25000

currency
enum<string>
required
Available options:
MWK
customerPhone
string
required

International format, +265 and 9 digits. Must belong to the operator.

Example:

"+265991234567"

provider
string
required

An operator refId from List mobile money operators.

Example:

"7d51b653-3c6d-46eb-b3d9-7852dfee5b26"

merchantOrderId
string
required

Your order or invoice number (letters, digits, - _ . /). One active or paid payment per order.

Maximum string length: 64
Example:

"ORDER-5531"

description
string
Maximum string length: 140
Example:

"2 x School shoes"

email
string

The customer's email, for receipts and your records.

Example:

"customer@example.com"

firstName
string
Example:

"Chikondi"

lastName
string
Example:

"Banda"

callbackUrl
string

Sends this payment's webhooks here as well as to your endpoints. Must be HTTPS, on one of your webhook or allowed callback hosts. Required if you have no webhook endpoint.

Example:

"https://api.yourshop.mw/webhooks/primepay"

metadata
object

Your own key/value pairs, echoed back in webhooks.

Example:

Response

Accepted while the customer approves the payment.

reference
string
Example:

"TXN-WRYF6S2W3DQW"

status
enum<string>
Available options:
pending,
processing,
success,
failed,
expired,
cancelled,
reversed
amount
number
fee
number
currency
string
Example:

"MWK"

merchantOrderId
string
failureCode
string | null
createdAt
string<date-time>
completedAt
string<date-time> | null
subMerchantAccountCode
string | null

Set when the payment was collected for a sub-merchant.

subMerchantName
string | null
aggregatorFee
number | null

The fee you keep as the aggregator.