Build your own payment interface and submit a selected method from your backend. The parent payment remains the same across supported payment experiences.
You can create a parent payment and then choose private API processing, hosted checkout, or a payment link by calling the matching child function. Or integrate directly with this server-to-server model from the start. These are supported ways to use one payment API. The payment ID, amount, and reference remain associated across the chosen experience.
Partner requests require X-EDPay-Public-Key and X-EDPay-Private-Key, Content-Type: application/json, and Idempotency-Key for writes. Never use a Bearer token. Keep both keys on your server. A 202 response means accepted for processing, not paid; a 200 response from private checkout contains a terminal attempt status.
POST /v1/payments creates the parent record only. Do not include a method here. Save data.id and data.reference with your order; use them for checkout selection and status retrieval.
/v1/paymentsBody: amount_minor (integer in minor units), currency (string), and optional reference and description. The amount and currency define the payment.
curl -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"
}
}Use the active dynamic method code returned by GET /v1/public/payment-methods. Include only fields required by that method, such as phone or channel-specific instrument data. This is a child operation on the existing payment; it keeps the original amount and reference.
/v1/public/payment-methodsPublic catalog; no partner keys. Build your method selector from the active methods and required_fields.
curl "https://api-pay.edutecka.com/v1/public/payment-methods" -H "Accept: application/json"/v1/payments/{id}/private-checkoutRequires X-EDPay-Public-Key, X-EDPay-Private-Key, Content-Type, and Idempotency-Key. The path id is data.id from the parent payment. Send method and the fields required by that method. Use this mode when your own backend and interface control the buyer interaction.
For M-Pesa and e-Mola, the customer's PIN authorization window is 60 seconds after processing starts. The API's 80-second deadline starts with the private-checkout request, so validation, queueing, and dispatch latency already consume it; the API does not wait another 80 seconds after the authorization window starts. It returns HTTP 200 with a terminal attempt, or HTTP 202 if the attempt remains pending, processing, or unknown when the deadline expires. The SDK transport timeout is 90 seconds by default. If the caller connection closes, durable processing continues and configured webhook endpoints receive the confirmed result.
curl -X POST "https://api-pay.edutecka.com/v1/payments/pay_0123456789abcdef0123456789abcdef/private-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-private-checkout" \
-H "Content-Type: application/json" \
-d '{
"method": "<METHOD_CODE_FROM_PAYMENT_METHODS>",
"phone": "+25884xxxxxxx"
}'{
"data": {
"id": "att_0123456789abcdef0123456789abcdef",
"checkout_number": 1,
"checkout_type": "private",
"method": "mpesa",
"status": "processing",
"requested_at": "2026-11-20T10:01:00Z",
"updated_at": "2026-11-20T10:01:00Z",
"completed_at": null
}
}/v1/payments/{id}Retrieve the parent payment on your server and use configured webhooks to process status changes. If a customer switches to hosted checkout or a payment link, use the corresponding child operation on this same payment ID; do not create another parent payment for the same order.
curl -X GET "https://api-pay.edutecka.com/v1/payments/pay_0123456789abcdef0123456789abcdef" \
-H "X-EDPay-Public-Key: <PUBLIC_KEY>" \
-H "X-EDPay-Private-Key: <PRIVATE_KEY>" \
-H "Accept: application/json"{
"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": "mpesa",
"status": "succeeded",
"platform_fee_bps": 600,
"platform_fee_minor": 9000,
"receiver_net_minor": 141000,
"created_at": "2026-11-20T10:00:00Z",
"updated_at": "2026-11-20T10:02:00Z"
},
"meta": {
"request_id": "req_abcdef0123456789"
}
}The platform fee is 6% in MZN. Bank payouts are made within 2 to 7 business days after the transaction.