Hosted Checkout
Integrate EximPe Hosted Checkout to accept payments with minimal effort
EximPe Hosted Checkout is a pre-built payment page that provides an optimal payment experience. Accept payments securely with minimal integration effort while maintaining full control over your checkout flow.
Simplified Checkout
Redirect your customers to EximPe’s secure payment page to complete their payment
Secure & PCI Compliant
We handle all sensitive payment data, so you don’t need to worry about PCI compliance
Customizable
Personalize the checkout experience with your branding and preferred payment methods
Prerequisites
Before integrating EximPe Hosted Checkout, ensure you have:
- Merchant Account: An active EximPe merchant account
- Credentials: Your Client ID and Client Secret
- Test Environment: Test environment credentials (for development)
- Domain Whitelist: Whitelisted your website domain for integration
Integration Steps
The integration process consists of three essential steps:
Step 1: Creating an Order
Create an order from your backend server before initiating payment:
📚 API Reference
Create Order API - View complete documentation including all parameters, request/response formats, error codes, and examples.
Session ID Validity: The session ID generated from the order creation is valid for 15 minutes only. Ensure that customers complete their payment within this timeframe. If the session expires, you’ll need to create a new order and generate a fresh session ID.
Step 2: Opening the Checkout Page
Include JS SDK
To integrate the EximPe Checkout, include our JavaScript SDK in your HTML:
Initialize the SDK
Initialize the SDK with your environment mode:
Open EximPe Checkout
To open the checkout, you can use the eximpe.checkout() method:
Error Handling
If you attempt to use an invalid or expired session ID, you’ll receive the following error response:
Common Causes: This error typically occurs when:
- The session ID has expired (after 15 minutes)
- The session ID is malformed or invalid
- The session has already been used for a completed payment
Complete Example
Step 3: Payment Status Verification
After the customer completes or cancels the payment, EximPe will redirect them to the return_url
you specified when creating the order. This redirection happens regardless of whether the payment was successful or failed.
Post-Payment Flow:
- Success: Customer completes payment → Redirected to return_url
- Failure/Cancellation: Customer cancels or payment fails → Redirected to return_url
- Verification Required: Always verify payment status on your backend, regardless of the redirect
Payment Verification Process
- Customer completes payment → EximPe redirects to your
return_url
- On your return_url page → Call the payment verification API from your backend
- Verify payment status → Use the
order_id
to check actual payment status - Process accordingly → Deliver services only after confirming successful payment
Critical Security Note: Never rely solely on the redirect to determine payment success. Always verify the payment status using the verification API before delivering any services or products. A payment is considered successful only when the status is “payment_successful”.
Important: Use the order_id
returned from the order creation response, not the session ID. This endpoint provides the most accurate payment status confirmation.
📚 API Reference
Get Order API - View complete documentation including request/response formats, error codes, and examples for verifying payment status.
Handling Different Payment Statuses
Based on the verification API response, handle different payment statuses appropriately:
payment_successful
: Payment completed successfully → Deliver services/productspayment_failed
: Payment failed → Show failure message, offer retrypayment_pending
: Payment is being processed → Show pending statuspayment_cancelled
: Customer cancelled payment → Show cancellation message
Status Flow: The payment status may change from payment_pending
to payment_successful
or payment_failed
depending on the final processing result. Always check the latest status before taking action.
Callback Verification
When EximPe redirects to your return_url
, it sends payment details via POST request. You must verify the authenticity of this callback using the hash value provided.
Sample Callback Request:
Callback Parameters:
order_id
: Your order identifierpayment_id
: EximPe’s payment transaction IDstatus
: Payment status (payment_successful, payment_failed, etc.)message
: Human-readable status messagemop_type
: Method of payment (UPI, CARD, etc.)bank_ref_num
: Bank reference numberpayment_completed_at
: Payment completion timestamphash
: Security hash for verification
Hash Verification Required: Always verify the hash value in the callback to ensure the request is authentic and hasn’t been tampered with. Never process payment data without proper hash verification.
Security Best Practice: Implement hash verification on your return_url endpoint before processing any payment data. This prevents unauthorized access and ensures data integrity.
Hash Verification Implementation
To verify the authenticity of the callback, you need to generate an HMAC signature using your encryption key and compare it with the hash received from EximPe.
Python Implementation:
Usage Example:
Critical: Always use hmac.compare_digest()
for hash comparison to prevent timing attacks. Never use direct string comparison (==
) for security-sensitive operations.
Hash Generation Order: The hash is generated using specific fields in a specific order. Ensure you use the exact same order and fields as shown in the hash_keys
list.
Security Notes
Transaction Validation
After receiving a response from EximPe, you must validate the transaction by verifying the hash or signature (if applicable) against what you sent in the request. This ensures the transaction is secure and untampered.
Additional Security
EximPe recommends implementing transaction details APIs and webhooks/callbacks as an extra security measure. For more information, refer to the Verify Payment API and Webhooks documentation.
Record Reconciliation
Always reconcile your records with EximPe’s database after you receive the response. Use the verification APIs to confirm transaction details.
Sensitive Information
Never include sensitive information (such as salt values or plain text hash strings) in the payment request to EximPe. Sensitive information should always be kept secure and never transmitted to the client or as part of the payment request.