Payment links (payer)
The public side of a payment link: what the payer sees, paying it, and following the payment. No account is needed to pay.
No key needed: call these from a terminal, a server or a coding agent.
Get a payment link
/api/v1/p/{code}What the payer needs to see: who is asking, how much, for what, and which methods are live for this link right now.
codestringrequiredThe link code: 6–32 letters, digits, - or _.
curl "https://api.autopayke.com/api/v1/p/Kq7mZp2xA"{
"ok": true,
"data": {
"code": "Kq7mZp2xA",
"requesterName": "Wanjiku Farm Supplies",
"verified": true,
"amount": "250000",
"currency": "KES",
"description": "Invoice 1042: fertiliser",
"status": "active",
"expiresAt": "2026-11-10T09:00:00.000Z",
"methods": [
"mobile_money"
],
"cardFeePayer": "customer"
}
}Pay a payment link
/api/v1/p/{code}/payStarts the payment. For mobile money the payer gets a prompt on their phone; for card the response carries a hosted checkout URL. Card details are never accepted by this API.
codestringrequiredThe link code.
methodstringrequiredHow the payer pays. Must be one of the link's live methods.
cardmobile_moneybankcountrystringrequiredISO 3166-1 alpha-2 code of the payer.
phonestringoptionalInternational format, required for mobile_money.
operatorstringoptionalMobile money operator code from /capabilities, e.g. Safaricom.
firstNamestringoptionalUp to 60 characters. Prefills the card checkout.
lastNamestringoptionalUp to 60 characters.
emailstringoptionalPayer's email, for the receipt.
idempotencyKeystringoptional8–80 characters. Retrying with the same key returns the same payment instead of charging twice.
curl -X POST "https://api.autopayke.com/api/v1/p/Kq7mZp2xA/pay" \
-H "Content-Type: application/json" \
-d '{
"method": "mobile_money",
"country": "KE",
"phone": "+254712345678",
"operator": "Safaricom",
"idempotencyKey": "order-1042-attempt-1"
}'{
"ok": true,
"data": {
"id": "7b1f0c7e-1f3c-4a43-9a8f-3f0d6a2b9c11",
"status": "processing",
"checkoutUrl": null,
"virtualAccount": null,
"stepRequired": "Approve the M-Pesa prompt on your phone",
"chargeAmount": "250000",
"chargeCurrency": "KES",
"feeAmount": "0",
"expiresAt": "2026-11-03T09:15:00.000Z"
}
}Get a payment's status
/api/v1/p/{code}/payments/{id}Poll this after paying until status is final (credited, failed, expired, cancelled or reversed).
codestringrequiredThe link code.
idstringrequiredThe id returned when paying.
curl "https://api.autopayke.com/api/v1/p/Kq7mZp2xA/payments/7b1f0c7e-1f3c-4a43-9a8f-3f0d6a2b9c11"{
"ok": true,
"data": {
"id": "7b1f0c7e-1f3c-4a43-9a8f-3f0d6a2b9c11",
"status": "credited",
"failureReason": null
}
}