Use EDPay's ready-made buyer interface. Create or retrieve the parent payment, then open hosted checkout for that same payment.
You can create a payment first and select the hosted, server-to-server, or payment-link experience afterward. The payment ID, amount, and reference remain the same across these choices. You can also integrate directly by model when your application always starts with hosted checkout. Both approaches use the same payment API.
Create the payment on your server. POST /v1/payments creates the parent record only; it does not start a gateway transaction. Keep its returned ID and your order reference.
/v1/paymentscurl -X POST "https://api-pay.edutecka.com/v1/payments" \
-H "X-EDPay-Public-Key: <PUBLIC_KEY>" \
-H "X-EDPay-Private-Key: <PRIVATE_KEY>" \
-H "Accept: application/json" \
-H "Idempotency-Key: order-2026-001-create" \
-H "Content-Type: application/json" \
-d '{
"amount_minor": 150000,
"currency": "MZN",
"reference": "ORD-2026-001",
"description": "Order payment"
}'{
"data": {
"id": "pay_0123456789abcdef0123456789abcdef",
"reference": "ORD-2026-001",
"trans_id": "TX-20261120-00001",
"amount_minor": 150000,
"currency": "MZN",
"base_amount_minor": 150000,
"base_currency": "MZN",
"base_platform_fee_minor": 9000,
"base_receiver_net_minor": 141000,
"fx_rate_set_id": null,
"fx_rate_mzn_per_unit": null,
"fx_rate_side": null,
"fx_rate_source": null,
"fx_effective_at": null,
"fx_expires_at": null,
"method": null,
"status": "pending",
"platform_fee_bps": 600,
"platform_fee_minor": 9000,
"receiver_net_minor": 141000,
"created_at": "2026-11-20T10:00:00Z",
"updated_at": "2026-11-20T10:00:00Z"
},
"meta": {
"request_id": "req_0123456789abcdef"
}
}Call the partner endpoint with the existing payment ID. The response returns an opaque browser token. Do not expose partner keys or payment IDs in buyer-facing checkout URLs. The buyer can choose an available method in the hosted page; the payment ID and reference stay attached to the same parent payment.
/v1/payments/{id}/public-checkoutRequires X-EDPay-Public-Key, X-EDPay-Private-Key, Content-Type: application/json, and Idempotency-Key. Use the token returned by this endpoint in the buyer-facing routes below.
curl -X POST "https://api-pay.edutecka.com/v1/payments/pay_0123456789abcdef0123456789abcdef/public-checkout" \
-H "X-EDPay-Public-Key: <PUBLIC_KEY>" \
-H "X-EDPay-Private-Key: <PRIVATE_KEY>" \
-H "Accept: application/json" \
-H "Idempotency-Key: order-2026-001-public-checkout" \
-H "Content-Type: application/json" \
-d '{
"embed_origin": "https://shop.example.com"
}'{
"data": {
"id": "cs_0123456789abcdef0123456789abcdef",
"token": "<OPAQUE_TOKEN>",
"expires_at": "2026-11-20T11:00:00Z"
}
}These routes use only the opaque checkout token and do not require partner keys. The browser does not receive the payment ID. Method codes are dynamic; build the selector from GET /v1/public/payment-methods. Include Idempotency-Key when submitting a method.
/v1/payments/checkouts/{token}curl "https://api-pay.edutecka.com/v1/payments/checkouts/<OPAQUE_TOKEN>" -H "Accept: application/json"{
"data": {
"id": "cs_0123456789abcdef0123456789abcdef",
"checkout_type": "public",
"payment_link": {
"id": "plink_0123456789abcdef0123456789abcdef",
"merchant_name": "Example Store",
"logo_data_url": null,
"seller_legal_name": null,
"seller_country": "MZ",
"primary_color": "#0052fc",
"layout": {
"order": [
"brand",
"security",
"amount",
"methods",
"fields"
],
"hidden": []
},
"description": "Order payment",
"items": [],
"amount_minor": "150000",
"currency": "MZN",
"environment": "sandbox",
"expires_at": "2026-11-20T11:00:00Z"
},
"expires_at": "2026-11-20T11:00:00Z",
"embed_origin": null
}
}/v1/payments/checkouts/{token}/paymentcurl -X POST "https://api-pay.edutecka.com/v1/payments/checkouts/<OPAQUE_TOKEN>/payment" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-2026-001-method-1" \
-d '{"method":"<ACTIVE_METHOD_CODE>","phone":"+25884xxxxxxx"}'{
"data": {
"status": "processing",
"method": "mpesa",
"checkout_number": 1,
"notice": "accepted_for_processing_not_payment_confirmation"
}
}/v1/payments/checkouts/{token}/payment{
"data": {
"status": "processing",
"method": "mpesa",
"amount_minor": "150000",
"currency": "MZN",
"created_at": "2026-11-20T10:01:00Z"
}
}The submit response indicates that processing was accepted; it does not confirm payment. The buyer can retrieve status through this token-scoped route. Your server should also confirm the parent with GET /v1/payments/{id} or a configured webhook. If the buyer leaves and returns, keep using this payment and reference; do not create a duplicate payment.
The platform fee is 6% in MZN. Bank payouts are made within 2 to 7 business days after the transaction.
Open the Embedded Checkout guide for modal and iframe integration.