Hosted Checkout
Let Wajub host the payment experience — all payment methods, mobile-first, production-ready, customizable to your brand.
The hosted payment page (pay.wajub.com) is the fastest way to collect payments. You
initialize a transaction, redirect the customer to the authorization_url, and Wajub handles
the UI, payment method selection, reminders, and confirmation — optimized for Mobile
Money and mobile.
When to use it — and where the integration code lives
Choose the hosted page if you want to move fast and delegate payment UI compliance. This page covers what the hosted page does, when to choose it over embedding, and branding. For the redirect / inline / overlay integration code (which URL to build, which component to mount), see Wajub Components → Hosted checkout.
Initialize with options
All customization fields are passed at initialization.
https://api.wajub.com/paymentsamountintegerrequiredcurrencystringrequiredcustomerobject | inline fieldsrequireddescriptionstringoptionalcallbackstring (url)optionalreferencestringoptionalmetadataobjectoptionalTwo ways to pass the customer
You can pass payer identity either as a nested customer object or as flat root-level fields —
both are accepted:
// Form 1 — nested object (recommended for clarity)
{ "customer": { "email": "amina@example.com", "name": "Amina N." } }
// Form 2 — flat root fields (also valid)
{ "email": "amina@example.com", "name": "Amina N." }Both produce the same result. Use whichever matches your existing payload shape.
No locale or channels parameter
There is currently no locale or channels body parameter — the hosted page shows all channels
available for the team/currency, and language follows the browser/team default. Passing these
fields today has no effect.
https://api.wajub.com/paymentscurl https://api.wajub.com/payments \
-H "Authorization: pk_test.8f2b91c4d7e6a0f3" \
-H "Content-Type: application/json" \
-d '{
"amount": 25000,
"currency": "XAF",
"email": "amina@example.com",
"name": "Amina N.",
"description": "Pro subscription — May",
"callback": "https://example.com/return",
"metadata": { "order_id": "4172", "plan": "pro" }
}'{
"status": "Created",
"code": 201,
"transaction": {
"id": "trx_01JXXXXXXXXXXXXX",
"status": "pending"
},
"authorization_url": "https://pay.wajub.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"authorization_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}authorization_url embeds an opaque session token (not the transaction reference) — treat it
as an opaque redirect URL, don't try to parse or construct it yourself.
Handle customer return
After the attempt, Wajub sends the customer back to your callback URL:
https://example.com/return?reference=trx_01JXXXXXXXXXXXXX&status=succeededNever trust the browser return
The URL status parameter is indicative: a customer can close the tab or manipulate the URL.
Always verify server-side with GET /payments/{id} (or wait for the payment.succeeded
webhook) before delivering.
https://api.wajub.com/payments/{id}curl https://api.wajub.com/payments/trx_01JXXXXXXXXXXXXX \
-H "Authorization: pk_test.8f2b91c4d7e6a0f3"{
"status": "OK",
"code": 200,
"transaction": {
"id": "trx_01JXXXXXXXXXXXXX",
"status": "succeeded",
"amount": 25000,
"channel": "cm.mtn"
}
}Customize the appearance
The logo, accent color, and business name displayed on pay.wajub.com are set once and
for all in Dashboard → Settings → Brand. They automatically apply to
all your payment pages, in test as in production.
Was this page helpful?