Payments
Start payment integration free of charge through hosted checkout, Khalti and eSewa provider abstraction, callback verification, and failed payment recovery.
Provider Health
Real-time monitoring of payment provider availability and performance.
99.9%
120ms
99.7%
145ms
GPSEWA backend handles all provider communication. Your frontend never calls Khalti/eSewa directly.
Payment Flow
End-to-end payment lifecycle from checkout creation to webhook delivery.
Checkout session created
10:00:00Your server calls GPSEWA API
Customer redirected to provider
10:00:05Khalti/eSewa payment page
Customer completes payment
10:00:45Provider processes transaction
Provider callback received
10:00:46GPSEWA backend receives callback
Payment verified
10:00:47GPSEWA verifies with provider API
Webhook delivered
payment.paid event sent to your server
Create Checkout Session
POST /v1/checkout/sessions
{
"amount": 2500,
"currency": "NPR",
"provider_preference": "auto",
"success_url": "https://merchant.example/success",
"cancel_url": "https://merchant.example/cancel",
"metadata": {
"order_id": "ORD-1042",
"customer_id": "CUS-8821"
}
}The checkout session is created server-side using your secret API key (sk_test_xxx). Never expose API keys in frontend code.
Hosted Checkout
Customer-safe checkout experience with provider selection and payment completion.
Pay to
Example Merchant
NPR 2,500
Order #ORD-1042
When a customer completes payment, the provider sends a callback to GPSEWA backend.
Automatic handling of failed or abandoned payments.
Payment Status
Example payment records with various statuses.
| Payment ID | Amount | Provider | Status | Created |
|---|---|---|---|---|
| pay_abc123 | NPR 2,500 | Khalti | paid | 2 min ago |
| pay_def456 | NPR 1,200 | eSewa | processing | 5 min ago |
| pay_ghi789 | NPR 5,000 | Khalti | pending | 8 min ago |
| pay_jkl012 | NPR 800 | eSewa | failed | 15 min ago |
| pay_mno345 | NPR 3,200 | Khalti | requires review | 20 min ago |
| pay_pqr678 | NPR 1,500 | Khalti | refunded | 1 hour ago |
Webhook Events
Real-time notifications for payment lifecycle events.
Webhook Security
Always verify GPSEWA webhook signatures on your server before fulfilling orders. Each webhook includes a signature header (gpsewa-signature) signed with your webhook secret (whsec_xxx).
Verification example
const signature = req.headers['gpsewa-signature'];
const isValid = gpsewa.webhooks.verify(
req.body,
signature,
process.env.GPSEWA_WEBHOOK_SECRET
);Start accepting payments
Sign up and integrate Khalti and eSewa-ready payments through GPSEWA free of charge.