Skip to main content
POST

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

Body

application/json
amount
number

Required with description. Greater than zero, at most 2 decimal places, at most MWK 10,000,000. Don't send it with items.

Example:

15000

description
string

Required with amount. What the customer is paying for. Shown to the customer.

Maximum string length: 255
Example:

"Chitenje dress, size M"

items
object[]

Instead of amount. The amount is their total.

Required array length: 1 - 50 elements
name
string

A label for you only. Customers never see it.

Maximum string length: 100
Example:

"Instagram orders"

usage
enum<string>
default:many

many: the link can be paid any number of times. once: it closes after the first payment.

Available options:
many,
once
expiresIn
enum<string>
default:never
Available options:
never,
24h,
7d,
30d
collectName
boolean
default:true

Ask the customer for their name.

collectEmail
boolean
default:false

Ask the customer for their email.

redirectUrl
string

Where the customer goes after paying. Must be a public https:// address (sandbox also allows http://localhost). Without it, the customer sees PrimePay's receipt page.

Response

The link.

id
string
url
string

The checkout address to send to your customer.

code
string
status
enum<string>

active: can be paid. inactive: deactivated by you, can be reactivated. completed: a once link that has been paid (final). expired: its expiresAt has passed (final).

Available options:
active,
inactive,
completed,
expired
liveMode
boolean
name
string
description
string
amount
number
currency
string
Example:

"MWK"

items
object[]
usage
enum<string>
Available options:
many,
once
timesPaid
integer

The number of completed payments.

collectName
boolean
collectEmail
boolean
redirectUrl
string | null
createdAt
string<date-time>
expiresAt
string<date-time> | null
subMerchantAccountCode
string | null
subMerchantName
string | null