Hosted checkout
Create a checkout and send your customer to the checkoutUrl JKAPay returns. The customer pays on a secure hosted page with a debit/credit card or mobile money, then JKAPay sends them back to your returnUrl and POSTs the final result to your webhook. You never handle card details.
How it works
- Your server calls
POST /v1/checkout/initializewith the amount and areturnUrl. - Redirect the customer's browser to the
checkoutUrlin the response. - The customer pays by card or mobile money.
- JKAPay confirms the payment and redirects the customer to your
returnUrlwithreference,clientReferenceandstatusquery parameters. - JKAPay POSTs the final transaction to your webhook. Fulfil the order from the webhook (or from Retrieve a checkout), never from the redirect alone.
/v1/checkout/initializeRequest body
"150.00" or an integer in pesewas (15000). Minimum GHS 1.00.GHS. Currently the only supported value.https URL. We append reference, clientReference and status (SUCCESS, FAILED or CANCELLED).card and mobile_money. Omit to offer every method available on your account.clientReference. Maximum 80 characters.Sample request
curl -X POST https://api.jkapay.com/v1/checkout/initialize \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "X-JKAPay-Merchant-Id: MCH_XXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"amount": "150.00",
"customer": { "email": "ama@example.com", "name": "Ama Mensah" },
"description": "Order #12345",
"returnUrl": "https://shop.example.com/orders/12345/thank-you",
"callbackUrl": "https://shop.example.com/webhooks/jkapay",
"merchantRef": "ORD-12345",
"idempotencyKey": "ORD-12345"
}'Response
The checkout object is a normal transaction plus a checkoutUrl. It starts as PENDING until the customer pays.
{
"checkout": {
"reference": "JKA_M3A8_8F2E1B4C",
"clientReference": "ORD-12345",
"status": "PENDING",
"type": "COLLECTION",
"amount": "150.00",
"fee": "0.00",
"net": "0.00",
"currency": "GHS",
"customer": {
"msisdn": null,
"name": "Ama Mensah",
"email": "ama@example.com",
"network": null
},
"description": "Order #12345",
"failureReason": null,
"metadata": null,
"initiatedAt": "2026-11-18T10:30:00.000Z",
"completedAt": null,
"checkoutUrl": "https://jkapay.com/pay/JKA_M3A8_8F2E1B4C"
}
}Handling the return
The customer lands on your returnUrl like this:
https://shop.example.com/orders/12345/thank-you?reference=JKA_M3A8_8F2E1B4C&clientReference=ORD-12345&status=SUCCESSstatus=CANCELLED means the customer left the checkout without paying. The checkout stays open, so the same checkoutUrl can be reused if they come back.
Webhooks
Checkout payments fire the same transaction.success / transaction.failed events as every other payment, with the same payload and signature. For card payments customer.msisdn and customer.network are null unless you supplied a phone number.
sk_test_… key the checkoutUrl opens a JKAPay test page instead of a real payment page. Click Pay successfully or Simulate a failed payment. You are redirected to your returnUrl and your webhook fires with "sandbox": true. No money moves. See Sandbox / test mode.Errors
400 VALIDATION_ERROR: the body failed validation, orreturnUrlisn't a public URL.401 UNAUTHENTICATED: missing, malformed, or revoked API key.403 FORBIDDEN: your account is suspended or not yet approved for live payments.502 PROVIDER_ERROR: the checkout couldn't be started. Safe to retry with the sameidempotencyKey.