Introduction
Hosted Checkout is a pre-built payment page. You create an order from your server, hand the returned session to the EximPe JS SDK, and the buyer completes the payment on EximPe’s page — card and UPI credentials never touch your servers.No UI to build
One SDK call opens a payment page that already handles every method you have enabled
Nothing sensitive to hold
Card and UPI credentials are entered on EximPe’s page, so they stay outside your PCI scope
Verified server-side
Confirm every outcome from your backend — never from the browser redirect alone
Collection is only half the flow. When a payment is captured it goes to Under Review if the order already has every detail its purpose code needs. Otherwise it goes to Action Required until you send what is missing. See Step 5.
Prerequisites
Before you begin, ensure you have:- Credentials: Your
X-Client-IDandX-Client-Secret.X-API-Versionis optional. Send3.0.0; the response echoes it back - Domain Whitelist: Your website domain whitelisted for integration
- Return URL: A URL on your site that EximPe redirects the buyer back to
- Webhook URL: A secure endpoint to receive payment status updates
- Encryption Key: Needed to verify the callback hash in Step 4
PSP callers additionally send
X-Merchant-ID naming the sub-merchant the order belongs to.- Your backend creates an order and receives a
session_id. - Your frontend opens the checkout page with that session, via the EximPe JS SDK.
- Your backend confirms the outcome from the Order Status API or the webhook.
- Your backend verifies the callback hash on the redirect to your
return_url. - You send the compliance details the payment still needs.
Step 1: Create an order
Create the order from your backend — never from the browser, which would expose your client secret.collection_mode has no server-side default — send "hosted_payment" explicitly. Omitting it (or sending an unrecognised value) fails with {"collection_mode": "Invalid collection mode"}.mop_type is optional here. Include it (upi, credit_card, debit_card, card, net_banking, wallet) only to limit the checkout page to one method. card offers both credit and debit cards; it is refused at order creation with {"mop_type": "CARD is not enabled for this account."} when card payments are not enabled on your account.Create Order API
Every parameter, constraint, and response field for this endpoint.
Step 2: Open the checkout page
1
Include the JS SDK
Load the SDK from a versioned URL with Subresource Integrity (SRI):
2
Initialize the SDK
mode is required and must be sandbox or production; anything else throws ERR_SDK_001. It also picks the API host for you — https://api-pacb-uat.eximpe.com in sandbox, https://api-pacb.eximpe.com in production.3
Open the checkout
Pass the
session_id from Step 1:Error handling
checkout() returns a promise — always attach a .catch(). An invalid or expired session surfaces as a 401:
Treat any
401 from checkout() as an invalid or expired session. The error.code can be ERR_AUTH_000 or ERR_AUTH_004. Common causes: the session is older than 15 minutes, it is malformed, or it has already been used for a completed payment. In every case the fix is the same — create a new order.Complete example
Step 3: Verify the payment
Once the buyer completes or abandons the payment, EximPe redirects them to yourreturn_url — the same redirect happens whether the payment succeeded or failed. Confirm the real outcome from your backend before you deliver anything.
Use the
order_id from Step 1 here — not the session_id.Get Order Status API
Full request and response reference.
Webhooks
Get pushed the outcome instead of polling for it.
Step 4: Verify the callback hash
When EximPe redirects to yourreturn_url, it POSTs the payment details as form data, signed with a hash. Verify that hash before you read anything else from the body.
Sample callback
The hash is an HMAC-SHA256 over exactly six fields, in this order, joined with
|, keyed by your encryption key:
return_url handler, then still confirm the order status from Step 3:
Step 5: Assert compliance
When a payment is captured it goes to Under Review if the order already has every detail its purpose code needs. Otherwise it goes to Action Required until you send what is missing.LRS Verification
What an LRS payment needs, and how to send it.
B2B Services Verification
What a B2B services payment needs, and how to send it.
Security Notes
Create orders server-side
Your
X-Client-Secret must never reach the browser. Create the order from your backend and send only the session_id to the frontend.Verify before you deliver
Confirm
payment_successful from the Order Status API or the webhook. The redirect to your return_url proves nothing on its own.Pin the SDK
Load the SDK from a versioned URL with an
integrity attribute, so a changed file at the CDN cannot execute on your page.Keep secrets out of requests
Never put your encryption key, salt, or a plaintext hash string into a payment request or anything the browser can read.
Need Help?
API Reference
📚 Create Order, Get Order Status, and the v3 webhook payloads