PayEast merchant API documentation
Accept customer-authorized payments through PayEast. These public guides cover merchant applications, mandates, charges, reconciliation, disputes and webhook verification.
| Environment | API base URL |
|---|---|
| Live | https://api.payeast.app/v1 |
| Sandbox | https://dev.payeast.app/v1 |
API version: 2026-12-05. Responses include X-PayEast-Version and X-PayEast-Request-Id.
Get started
- Create and test your merchant application in the developer sandbox. Sandbox limits are strict: 20 requests a minute and 100 a day.
- Protect your merchant credentials on your server.
- Ask the customer to accept a merchant mandate by customer number or QR code.
- Create a charge with an idempotency key.
- Verify the result through signed webhooks and reconcile it with your order.
Public guides
- Merchant authentication
- Merchant API reference
- Merchant apps and QR
- Webhooks
- Developer sandbox
- Security and data handling
- OpenAPI specification
Customer authorization
Adding a customer is not consent to charge them. Customers must first accept your merchant mandate. Charges require the applicable customer approval unless the customer has explicitly enabled autopay and the charge meets its limits and applicable checks.
Support
Contact support@payeast.app. Include relevant request IDs, but no passwords, PINs, tokens or secrets.
Merchant authentication
Merchant endpoints use your application's client ID and client secret, sent from your server using HTTP Basic authentication.
curl https://api.payeast.app/v1/merchant/payments \
--user '<client_id>:<client_secret>'
The values above are placeholders. Read credentials from a server-side secret store; never put real credentials in a command shared with others, browser code, mobile code, logs or support messages.
Environments
Use sandbox credentials only with https://dev.payeast.app/v1 and live credentials only with https://api.payeast.app/v1. Credentials are not interchangeable.
A test client secret works for 90 days. After that, create a new one in the developer sandbox. Live credentials are not affected by this rule.
Errors
An invalid or unavailable credential returns 401 invalid_client. A disallowed action returns 403. Handle rate limits and retryable failures according to the API reference. Rotate credentials if exposure is suspected.
Customer permission
Application authentication identifies your merchant application. It does not authorize a customer charge. Obtain an accepted mandate first and follow the customer's approval requirements.
Merchant API reference
Base URL: https://api.payeast.app/v1. Sandbox: https://dev.payeast.app/v1. Use server-side HTTP Basic application credentials.
Conventions
Send JSON over HTTPS. Amounts must be positive, with at most two decimals. Use an Idempotency-Key for charge creation and retain your order reference. Quote X-PayEast-Request-Id when contacting support. Do not fulfill an order until a verified successful result matches its expected amount, currency and reference.
Rate limits
| Applies to | Limit |
|---|---|
| Live application | 300 requests a minute |
| Sandbox (test) application | 20 requests a minute and 100 a day |
/v1/merchant/* and /v1/oauth/revoke, per IP address |
120 a minute |
Over a limit the answer is 429 rate_limited. Wait before retrying; do not retry in a tight loop. Limits are counted in fixed windows.
GET /v1/health
Health check (no authentication)
Responses
| HTTP status | Meaning |
|---|---|
200 |
OK |
POST /v1/mandates
A merchant app adds a customer by customer number. The customer gets a prompt and an e-mail to ACCEPT charges from the app; only an accepted customer can be charged. (Authenticated as the app.)
Request fields
| Field | Required | Type | Details |
|---|---|---|---|
customer_number |
Yes | string | |
reason |
Yes | string | What the customer is signing up for, shown to them minLength: 3. maxLength: 200. |
recurring |
No | boolean | |
reference |
No | string | maxLength: 100. |
Responses
| HTTP status | Meaning |
|---|---|
201 |
Mandate pending acceptance |
401 |
Missing, invalid, expired or revoked token |
409 |
declined_recently |
422 |
Unknown customer number, no wallet in that currency, etc. |
429 |
too_many_requests_for_customer |
GET /v1/mandates/{id}
Read a mandate of your app (status pending, active, declined or revoked)
Responses
| HTTP status | Meaning |
|---|---|
200 |
Mandate |
404 |
No such object for this connection |
POST /v1/mandates/qr
A merchant app asks for a link QR code to show its customer. The customer scans it with PayEast's Scan and accepts; no customer number is needed. The code works once and expires after 5 minutes. (Authenticated as the app.)
Request fields
| Field | Required | Type | Details |
|---|---|---|---|
reason |
Yes | string | minLength: 3. maxLength: 200. |
recurring |
No | boolean | |
reference |
No | string | maxLength: 100. |
Responses
| HTTP status | Meaning |
|---|---|
201 |
A QR code to show. Draw qr_url as a QR code. |
401 |
Missing, invalid, expired or revoked token |
403 |
not_a_merchant_app |
429 |
rate_limited |
GET /v1/mandates/qr/{id}
Read a link QR code of your app. status is pending, approved, declined or expired; when approved it carries the mandate_id and the customer_number.
Responses
| HTTP status | Meaning |
|---|---|
200 |
QR status |
404 |
No such object for this connection |
POST /v1/charges
The APP charges a customer who accepted it (POST /mandates), by customer number (authenticated as the app). Autopay up to the customer's own limit, otherwise a phone prompt approved with PIN + 2FA; unusual charges always ask. 409 customer_not_linked if they have not accepted.
Request fields
| Field | Required | Type | Details |
|---|---|---|---|
customer_number |
Yes | string | |
amount |
Yes | number | |
currency |
Yes | string | |
description |
No | string | maxLength: 200. |
reference |
No | string | maxLength: 100. |
return_url |
No | string | |
expires_in |
No | integer | minimum: 60. maximum: 86400. default: 900. |
Responses
| HTTP status | Meaning |
|---|---|
201 |
Payment of kind charge, status requires_approval, requires_second_factor true |
400 |
Invalid request |
401 |
Missing, invalid, expired or revoked token |
409 |
Idempotency conflict, not cancellable, or app not configured |
422 |
Unknown customer number, no wallet in that currency, etc. |
429 |
too_many_prompts or too_many_pending_approvals |
GET /v1/charges/{id}
Read a charge of your app (authenticated as the app)
Responses
| HTTP status | Meaning |
|---|---|
200 |
Payment |
404 |
No such object for this connection |
POST /v1/charges/{id}/cancel
Withdraw a charge that is still waiting for approval (the customer's prompt disappears)
Responses
| HTTP status | Meaning |
|---|---|
200 |
Payment |
409 |
Idempotency conflict, not cancellable, or app not configured |
GET /v1/merchant/payments
Every payment of YOUR APP with PayEast's transaction ids, for reconciliation (authenticated as the app)
Responses
| HTTP status | Meaning |
|---|---|
200 |
List |
401 |
Missing, invalid, expired or revoked token |
GET /v1/merchant/disputes
The disputes about payments YOUR APP charged (authenticated as the app, not a customer)
Responses
| HTTP status | Meaning |
|---|---|
200 |
List |
401 |
Missing, invalid, expired or revoked token |
GET /v1/merchant/disputes/{id}
Retrieve one of your app's disputes
Responses
| HTTP status | Meaning |
|---|---|
200 |
Dispute |
404 |
No such object for this connection |
POST /v1/merchant/disputes/{id}/respond
Your app replies to a dispute (the customer is notified; never moves money)
Request fields
| Field | Required | Type | Details |
|---|---|---|---|
text |
Yes | string | minLength: 2. maxLength: 2000. |
evidence_urls |
No | array |
Responses
| HTTP status | Meaning |
|---|---|
201 |
The dispute, now merchant_responded |
400 |
Invalid request |
401 |
Missing, invalid, expired or revoked token |
404 |
No such object for this connection |
409 |
Idempotency conflict, not cancellable, or app not configured |
Response fields
Download the OpenAPI specification for complete request and response schemas.
Developer support
Contact support@payeast.app.
Merchant apps: add a customer, then charge them
A merchant app is a business system that accepts customer payments through PayEast. It authenticates with its own client ID and secret using server-side HTTP Basic; see merchant authentication.
The rule that keeps customers safe: adding someone's details is not consent to charge them. The customer must first accept your app; only then can you charge, and every charge is shown to them for approval (PIN + two-factor) unless they switched on autopay for your app with a limit of their own.
Every merchant app starts in the developer sandbox. A business that wants to use the PayEast API for its customers signs up to the sandbox (https://dev.payeast.app), creates a test app there, uploads its logo, tests with test money, and only then requests to go live. PayEast does not create merchant apps any other way. The logo uploaded in the sandbox is the one customers see in production too.
1. Link a customer: by customer number, or by QR code
By customer number (you already know it): POST /v1/mandates with customer_number, reason, optional recurring and reference. The customer gets a prompt on their phone and an e-mail to accept. See the API reference.
By QR code (the customer is in front of your screen; no number needed): POST /v1/mandates/qr.
POST /v1/mandates/qr (HTTP Basic client_id:client_secret)
{ "reason": "Chorus plan, monthly", "recurring": true, "reference": "cust-77" }
201 { "object": "mandate_qr", "id": "cqr_…", "status": "pending",
"qr_url": "https://beta.payeast.app/connect/scan?s=…", "expires_at": "2026-11-29T12:10:00Z" }
- Draw
qr_urlas a QR code on your screen (any QR library). - The customer opens PayEast on their phone, chooses Scan on the home page and points it at the code. A phone camera works too: it opens the same PayEast screen.
- PayEast shows who is asking (your app name and logo) and why (your
reason). The customer taps Add and confirms with their app PIN or fingerprint; that is their acceptance. The mandate is created active with autopay off. They get a notice and an e-mail, and can remove your app any time in PayEast → Settings → Transactions → Merchant Apps. - You learn the outcome in two ways: the
mandate.acceptedwebhook (withcustomer_number,reason,reference), and by pollingGET /v1/mandates/qr/{id}→statusispending,approved(withmandate_idandcustomer_number),declinedorexpired.
A QR code works once and expires after 5 minutes. If it expires, ask for a new one (at most 20 per hour per app); do not keep an old code on screen. Test apps can only link their developer and testers who accepted an invitation.
2. Charge
POST /v1/charges by customer_number (use the one from the webhook or the poll). A customer who has not accepted you gets 409 customer_not_linked. The rules for autopay, limits, unusual charges and prompts are in the API reference. Outcomes arrive as payment.* webhooks, and the money goes to your app's receiving PayEast account.
3. Money limits
PayEast limits what a customer can send by their verification level (not verified, basic, full: per payment, per day, per month). A charge over a limit is refused with a plain sentence naming it; show it as is.
4. Where to read more
Authentication · API reference · Webhooks · Sandbox · OpenAPI (/mandates, /mandates/qr, /mandates/qr/{id}, /charges).
Updates
| Date | Change | Who must act |
|---|---|---|
| 2026-12-05 | Tighter sandbox: one named test app per developer; testers must accept an invitation; 20 requests a minute and 100 a day; test secrets expire after 90 days; stricter webhook addresses. See the sandbox guide. | Everyone testing: re-invite testers and handle 429 rate_limited |
| 2026-11-29 | Merchant apps start in the developer sandbox and upload their logo there; the same logo is used in the sandbox and in production, and going live needs it. See the sandbox guide. | Merchant apps: sign up at dev.payeast.app and upload your logo |
| 2026-11-29 | Link by QR code: POST /v1/mandates/qr, GET /v1/mandates/qr/{id}; the customer scans with PayEast's Scan and accepts. API version 2026-11-29. |
Merchant apps that want it: add the call and show the QR |
Webhooks
PayEast calls your server when something changes, so you do not have to poll. Register one HTTPS address per app. For a test app you set it in the developer sandbox; for a live app, ask PayEast to change it. The address must use a public domain name on port 443: no IP address, and no PayEast address.
Events
type |
When | data |
|---|---|---|
payment.succeeded |
Payment completed and money moved, including a permitted merchant autopay | { "object": <payment> } |
payment.declined |
The customer declined | { "object": <payment> } |
payment.cancelled |
You cancelled it via the API | { "object": <payment> } |
payment.expired |
Nobody approved before approval_expires_at |
{ "object": <payment> } |
dispute.created |
A customer raised a dispute about a merchant payment | { "object": <dispute> } |
dispute.updated |
A reply, a status change, a withdrawal or an outcome | { "object": <dispute> } |
mandate.accepted |
A merchant app: the customer accepted charges from you (after POST /v1/mandates) |
{ "object": { "id": "mnd_…", "status": "active", "customer_number", "reason", "reference" } } |
mandate.declined |
The customer declined | same object, status declined |
mandate.revoked |
The customer removed your app in Settings (open charges are cancelled) | same object, status revoked |
While an app is suspended nothing is delivered to it: events wait and keep their retries (1 min, 5 min, 30 min, 2 h, 6 h, 24 h), and are marked failed if the app is still not active after the last one. A webhook address that does not resolve to a public server follows the same retry ladder instead of being retried for ever.
The payment object describes the merchant charge. Verify its amount, currency and reference against your order.
The request
POST to your address, Content-Type: application/json:
{
"id": "5b3f2c1e-…",
"object": "event",
"type": "payment.succeeded",
"created": 1790000000,
"data": { "object": { "id": "pay_…", "kind": "charge", "status": "succeeded", "amount": 25000, "currency": "UGX",
"reference": "ord_1001", "transaction_id": "TXN-…", "payer_customer_number": "PE-…", "payee_customer_number": "PE-…" } }
}
Headers:
| Header | |
|---|---|
PayEast-Signature |
t=<unix seconds>,v1=<hex> — see below |
PayEast-Event-Id |
The event id. The same on every retry. |
User-Agent |
PayEast-Webhooks/1.0 |
Verifying the signature
v1 is the hex HMAC-SHA256 of the string "<t>.<raw request body>" using your webhook secret (whsec_…, given to you with your credentials). Verify against the raw bytes you received, not a re-serialised object, compare in constant time, and reject timestamps more than 5 minutes old.
// Node / Express — use express.raw({ type: 'application/json' }) for this route
import crypto from 'node:crypto';
export function verifyPayEast(rawBody, header, secret, toleranceSeconds = 300) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const a = Buffer.from(expected), b = Buffer.from(parts.v1 || '');
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
# Python
import hmac, hashlib, time
def verify_payeast(raw_body: bytes, header: str, secret: str, tolerance=300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t = int(parts.get("t", "0"))
if not t or abs(time.time() - t) > tolerance:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))
Responding and retries
- Answer any 2xx within 10 seconds to acknowledge. Do your real work after answering.
- Anything else (or a timeout) is retried after 1 min, 5 min, 30 min, 2 h, 6 h, 24 h; after that the event is marked failed. Contact support if delivery remains unsuccessful.
- Delivery is at least once and not guaranteed to be in order. De-duplicate on
PayEast-Event-Id, and make your handler idempotent: a secondpayment.succeededfor a payment you already marked paid must change nothing. - Redirects are not followed. The address must be public
https— private, loopback and local addresses are refused.
Do not trust the webhook alone for money decisions
The signature proves the message came from PayEast. For a high-value order, you can also GET /v1/charges/{id} with your merchant credentials and check status === "succeeded" and that amount, currency and reference match what you expect before you deliver goods.
Identifiers in the payload
The payment object in data.object carries three different IDs: payeast_ref (= id, PayEast's pay_... reference), partner_reference (= reference, your own transaction ID, returned unchanged) and audit_id (= transaction_id, the TXN-... entry in PayEast's books, for support and audit only, null until money moved). The envelope id / PayEast-Event-Id identifies the delivery. Contact support@payeast.app for integration-specific guidance.
Developer sandbox
Test your integration without moving real money before requesting production access.
Environments
| Environment | API base URL |
|---|---|
| Sandbox | https://dev.payeast.app/v1 |
| Live | https://api.payeast.app/v1 |
Test credentials work only in the sandbox. Live credentials work only on the live API. Keep both sets of credentials server-side and separate.
Set up an application
- Open the developer sandbox and sign in with your email and a code. This makes a separate sandbox account that holds no money. Sign up for a developer profile there (one per account). The developer console is only available to accounts that signed up in the sandbox.
- Create your test app. You have one named test app; the sandbox API and the developer console both use it.
- Provide your logo, webhook address and testers. Credentials are shown once: store them on your server and never include them in frontend code.
Testers
You can invite up to 5 testers by PayEast email. Each person is emailed the invitation with instructions, and must accept it, within 14 days, in PayEast under Settings → Developers. Until then your app cannot involve them. A tester can stop at any time, and removing a tester ends their connection at once. You can send 10 invitations a day; a declined invitation can be sent again after 7 days.
Sandbox limits
- 20 requests a minute and 100 a day per test app (
429 rate_limitedafter that). - A test client secret works for 90 days.
- Webhook addresses must be
httpson a public domain name, port 443: no IP address and never a PayEast address. - The sandbox website opens only the developer, connection and sign-in screens. It cannot move money, create agent tokens or issue live credentials.
Test the integration
No money moves in the sandbox. Test charges are approved by your testers with one tap on a screen marked Test mode. A customer who is not your accepted tester gives 422 sandbox_recipient_not_allowed. Check mandates, approved, declined and expired charges, webhook signatures, and that a repeated delivery does not fulfil an order twice.
Request production access
Complete your sandbox tests and submit the application details requested in the developer portal. Production access is subject to approval. Do not use live customers or real funds until access and service availability have been confirmed.
Questions: support@payeast.app.
Security and data handling
Protect credentials
Keep client secrets, webhook secrets and customer tokens on your server, in a managed secret store. Do not include them in browser bundles, mobile apps, logs, analytics, source repositories or support messages. Rotate credentials if exposure is suspected.
Do not give your PayEast credentials, test or live, to an AI agent or other automated tool that can read them or call PayEast on its own. Run such tools without access to your secret store.
Obtain customer consent
Application credentials identify your merchant application. Obtain an accepted customer mandate before creating a charge. Customers control whether they accept a mandate and enable autopay. Never ask for a PayEast password, PIN or authentication code in your application.
Confirm outcomes
Use idempotency keys for supported creation calls. Verify the payment status and expected amount, currency and reference before fulfilling an order. A return URL alone is not proof of payment.
Verify webhook signatures against the raw request body, reject stale or invalid signatures, and deduplicate by event ID. Make handlers safe to retry.
Respect customer data
Collect only the fields needed for the approved feature. Retain data only as necessary, protect it against unauthorized access, and honor applicable deletion and retention obligations. Follow the data-protection laws that apply to your service.
Report a security concern
Contact support@payeast.app promptly if credentials may have been exposed or a payment appears unauthorized. Include relevant request IDs but no secrets. Do not test against accounts or data you are not authorized to access.
Public integration documentation · Updated 5 December 2026.
Download OpenAPI specificationMarkdown: developers · overview · authentication · api-reference · merchant-apps · webhooks · sandbox · security
Questions? support@payeast.app