A hosted payment page for every order
Your server creates a checkout session. The customer lands on a page with your name and the methods you switched on, pays on eSewa, Khalti or Fonepay, and the order only counts as paid after we check with the provider.
- English and नेपाली
- Only methods that can take the payment
- Verified on the server
Payment confirmed
Khalti
Powered by Paymentsnp
Choose how to pay, then Payment confirmed
How a checkout runs. Four steps, one of them yours.
You write the first step. Paymentsnp handles the page, the provider round trip and the check that decides whether the order is paid.
Create a session
Your server sends the order id, the amount in paisa and where to return. The amount is set on your server, so nobody can change it in the browser.
The customer picks a method
They see your business, the amount and each method you enabled, then press one Continue button for the method they chose.
They pay on the provider's page
eSewa, Khalti or Fonepay shows its own page. Wallet PINs, passwords and OTPs are typed there, never on Paymentsnp.
We verify, then tell you
We check the payment with the provider for the exact amount, send the customer back to your site and deliver a signed webhook to your server.
What your customer sees. Only what can actually take the payment.
Your name on the page
The header carries your display name, logo and accent colour. The footer always says Powered by Paymentsnp.
English or नेपाली
The customer switches the page language with one toggle, and the choice is remembered in that browser.
Methods that can pay
A method appears only when it is enabled, its connection is ready and its credentials are saved. Khalti is hidden on amounts under Rs 10, its minimum.
| Address | paymentsnp.com/c/{token} |
|---|---|
| Session length | One hour from creation. Your server can also expire a session early. |
| Language | English or नेपाली, chosen by the customer |
| Branding | Display name, logo and accent colour from Branding |
| Methods shown | Enabled, ready and credentialed connections in the same environment (Test or Live) |
| Restricting methods | Pass allowed_methods when you create the session; the server enforces it |
| Khalti minimum | Rs 10. Below it, Khalti is not offered |
| Footer | Powered by Paymentsnp, on every checkout |
| Opening it | A full-page redirect, or a popup over your site with checkout.js |
Changing method never means paying twice. We ask the first provider before a second one starts.
The first provider is asked first
A customer who opens eSewa, gives up and comes back can choose Khalti instead. Before the second attempt starts, Paymentsnp asks eSewa what happened to the first one. If eSewa says it succeeded, the order closes as paid and nothing new starts.
Unclear answers stop the switch
If the provider cannot say yet, the API answers 409 payment_pending and the customer sees Payment in progress with a button to check again. A second payment only starts once the first is known not to have gone through.
One open attempt per order
The database allows one unresolved payment attempt per order, so two tabs or two sessions for the same order cannot start two payments at once.
Payment in progress
We're waiting for eSewa to confirm your payment. Don't pay again.
Check payment statusChoose another methodPowered by Paymentsnp
Every payment has one honest state. Unknown is not the same as failed.
These are the states your dashboard, the API and the customer's page use. A return to your success URL is never one of them, because a browser redirect proves nothing.
| State | What it means | What happens next |
|---|---|---|
| Succeeded | The provider confirmed the exact amount, by status lookup or a verified signed return. | The order closes as paid. You get payment.succeeded and the customer gets a receipt. |
| Pending | The customer went to the provider page and the provider has not answered yet. | The customer sees Payment in progress. A second method waits until this one is resolved. |
| Unknown | A provider call failed, timed out or gave an unclear answer. | Treated as possibly paid: it blocks a second payment and is never shown as paid until the provider confirms. |
| Failed | The provider says the payment did not complete. | The customer can pick a method and try again. You get payment.failed. |
| Expired | The attempt was still unresolved after 30 minutes. | A late eSewa or Khalti success is still recorded. For Fonepay, see the note below the table. |
| Manually confirmed | You recorded the payment from your provider panel's reference. | Audited and marked as not provider-verified. You get payment.manually_confirmed. |
Customers close tabs. We keep checking eSewa and Khalti anyway.
When a customer pays and never comes back, a background worker asks the provider about the attempt until it has an answer. Each answer is kept as provider evidence in the audit trail, and an answer with a different amount stops the checks instead of marking the order paid.
- Check cycle
- 60 s
- How often the worker looks for unresolved eSewa and Khalti attempts
- Checks per attempt
- About 20
- With growing gaps between them
- Total window
- About 14 h
- After that, use the re-check button in the dashboard
One call creates the page. Send the customer to checkout_url.
POST /v1/checkout/sessions needs a key with the checkout:create scope and an Idempotency-Key header. Use your order number as the key: a retry returns the same session, and the same key with a different body returns 409 idempotency_conflict.
Test keys start np_test_ and only see test data. Live keys start np_live_. Fulfil the order on the payment.succeeded webhook or by fetching the session, never on the return to success_url.
The same session works for the popup: pass its checkout_url to checkout.js.
curl https://api.paymentnp.com/v1/checkout/sessions \
-H "Authorization: Bearer np_test_..." \
-H "Idempotency-Key: checkout-order-1001" \
-H "Content-Type: application/json" \
-d '{
"order_id": "order-1001",
"amount_minor": 245000,
"currency": "NPR",
"allowed_methods": ["esewa", "khalti"],
"success_url": "https://shop.example.com/orders/1001",
"cancel_url": "https://shop.example.com/cart"
}'
# Send the customer to checkout_url from the response.import Paymentsnp from "@paymentsnp/sdk";
const pnp = new Paymentsnp({ apiKey: process.env.PAYMENTSNP_API_KEY! });
const session = await pnp.checkout.sessions.create(
{
order_id: "order-1001",
amount_minor: 245000, // NPR 2,450.00
currency: "NPR",
allowed_methods: ["esewa", "khalti"],
success_url: "https://shop.example.com/orders/1001",
},
{ idempotencyKey: "checkout-order-1001" },
);
// Redirect to session.checkout_url$paymentsnp = new \Paymentsnp\PaymentsnpClient('np_test_...');
$session = $paymentsnp->checkout->sessions->create([
'order_id' => 'order-1001',
'amount_minor' => 245000,
'currency' => 'NPR',
'success_url' => 'https://shop.example.com/orders/1001',
'cancel_url' => 'https://shop.example.com/cart',
], ['idempotency_key' => 'checkout-order-1001']);
header('Location: ' . $session['checkout_url']);from paymentsnp import Paymentsnp
client = Paymentsnp(api_key="np_test_...")
session = client.checkout.sessions.create(
{
"order_id": "order-1001",
"amount_minor": 245000,
"currency": "NPR",
"success_url": "https://shop.example.com/orders/1001",
},
idempotency_key="checkout-order-1001",
)
# Redirect to session["checkout_url"]Questions merchants ask. About hosted checkout.
Can I host the payment page on my own website?
The page itself is always served by Paymentsnp, but it can carry your brand and run on a domain you verify, such as pay.yourshop.com.np. Open it as a redirect or as a popup over your site.
Why does the customer not see Khalti on some orders?
Khalti's minimum is Rs 10, so it is hidden below that. A method is also hidden when it is switched off, its credentials are missing, or your server left it out with allowed_methods.
What happens when the hour runs out?
The session expires and the customer is asked to contact you for a new link. A payment that was already under way is still checked: a late eSewa or Khalti success is recorded.
Is the return to my success URL proof of payment?
No. It only tells you the customer came back. Fulfil on the signed payment.succeeded webhook, or fetch the session from your server.
Can I remove Powered by Paymentsnp?
No. It stays on every checkout, payment link and invoice page. There is no white-label option.

