Hosting and software billing, paid in eSewa, Khalti and Fonepay
Your billing system keeps generating the invoices. Paymentsnp puts a Pay now button on them, checks every payment with the provider on the server, and tells your system the moment an invoice is paid.
- WHMCS module 3.0.0
- Invoices API and signed webhooks
- Read-only MCP server for support

The invoice is in your billing system. The payment is in a wallet.
A customer's hosting renewal is due. They pay your eSewa account directly and open a ticket with a screenshot. Someone in support finds the invoice, checks the wallet statement, and adds the payment by hand. If that happens after the suspension run, the site goes down for a renewal that was already paid.
Multiply that by every renewal in a month, and the support queue becomes the accounts department.
- Payments arrive without an invoice numberSupport matches amounts and names by eye, and similar amounts get crossed.
- Manual crediting is slowServices can be suspended or domains left unrenewed while a paid invoice waits in a ticket.
- Currency gets in the wayInvoices in another currency have to be converted to rupees before anyone can check the amount.
How Paymentsnp fits WHMCS. A gateway module, not a new billing system.
Pay now on every unpaid invoice
The module adds a Pay now button to unpaid invoices in the client area. Clicking it again, or in a second tab, opens the same checkout.
Converted to rupees at your rate
If the invoice is not in NPR, the amount is converted with the NPR exchange rate you keep in WHMCS, at the moment the customer clicks Pay now.
Paid on hosted checkout
The customer picks eSewa, Khalti or Fonepay. The money settles to your own merchant account.
Credited only after a check
The module fetches the payment from the Paymentsnp API and credits the invoice only when the order, exact amount, currency and environment match. A webhook does it at once; the WHMCS cron re-checks in case the customer never came back.
| Shared hosting, 12 months | NPR 6,000.00 |
| Domain renewal, 1 year | NPR 1,500.00 |
| Total due | NPR 7,500.00 |
Payment method: eSewa, Khalti or Fonepay
Built your own billing? Use the API directly.
The same building blocks the WHMCS module uses are open to your code: invoices, checkout sessions, verified payments and signed webhooks.
Invoices API
Create, finalize and send invoices with
POST /v1/invoices,/finalizeand/send. Each one gets a hosted page with a Pay button, a PDF and scheduled reminders.Signed webhooks
HTTPS only, HMAC-SHA256 signed, retried with backoff for up to 8 attempts, with delivery history and manual replay in the dashboard.
SDKs and a CLI
TypeScript, PHP and Python clients with retries, idempotency keys and typed errors. The paymentsnp command lists invoices and payments from a terminal.
# TypeScript and JavaScript (Node 18+, Bun, Deno, edge runtimes)
npm install @paymentsnp/sdk
# PHP 7.4+ (or require init.php without Composer)
composer require paymentsnp/paymentsnp-php
# Python 3.9+, standard library only
pip install paymentsnp# The key is read from the environment, never from an argument
export PAYMENTSNP_API_KEY=np_test_...
npx paymentsnp invoices list --status open
npx paymentsnp payments list --limit 10
npx paymentsnp payments get <payment_id>POST /billing/paymentsnp-webhook HTTP/1.1
Content-Type: application/json
Paymentnp-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "t.body">
Paymentnp-Event-Id: <event id>
# Event types your billing system can act on:
# invoice.finalized invoice.paid invoice.marked_paid invoice.voided
# payment.succeeded payment.failed payment.refunded checkout.expiredReconciliation. Verified is not the same as settled.
Paymentsnp shows which payments it verified. Your provider's settlement file shows what reached the bank. Reconciliation puts the two side by side.
| Import | Upload a provider or bank settlement CSV in the dashboard, or send up to 500 rows with POST /v1/reconciliation/import/bulk |
|---|---|
| Formats it reads | Bikram Sambat dates, lakh commas and Nepali digits |
| Results | Each row comes back matched, unmatched or a mismatch, with room for review notes |
| Reports | 7, 30 and 90 day provider reports, also through GET /v1/reconciliation/report |
| Exports | CSV of payments, checkouts and customers, safe to open in a spreadsheet |
| Who sees it | Owners, administrators and finance users, or an API key with the reconciliation scopes |
For support teams. Ask an assistant, not a database.
The Paymentsnp MCP server
@paymentsnp/mcp 0.1.0 lets an AI assistant that speaks the Model Context Protocol answer questions like "has invoice INV-2026-0042 been paid?" from your Paymentsnp data. It runs on your own machine with Node 20 or newer, and your API key stays there.
- Read-only by default: payments, invoices, refunds and reconciliation reports
- Writes only when you set
PAYMENTSNP_MCP_ALLOW_WRITES=true - Customer emails and phone numbers are masked unless you choose to show them
- No tool moves money, pays out or deletes anything

Products a billing team uses. Each has its own page.
- Invoices and receipts13% VAT lines, a hosted invoice with a Pay button, a PDF and scheduled reminders.
- Hosted checkoutThe payment page that offers eSewa, Khalti and Fonepay and checks each payment with the provider.
- Reconciliation and reportsMatch provider settlement files to verified payments, export CSVs.
- Branding and custom domainYour name, logo and colour on checkout, on a domain you verify.
What you need. Before the first live invoice.
Everything can be tried in test mode with the Sandbox gateway first. Live payments need your provider accounts in place.
| Merchant accounts | Your own approved eSewa, Khalti or Fonepay merchant access and credentials |
|---|---|
| An approved Paymentsnp account | Accounts are approved by hand by default, after email verification |
| For WHMCS | WHMCS 8.x on PHP 7.4 to 8.3, a public HTTPS System URL and a running cron |
| An NPR rate | If your invoices are in another currency, an NPR currency with a correct rate in WHMCS |
| An API key | Scopes checkout:create, checkout:read and payments:read for WHMCS; invoices:read and invoices:write for the invoices API |
| Allowed return origins | The origin of your billing site, added in Paymentsnp settings |
Limits. Read these before you plan renewals.
Questions from billing teams.
What if the customer pays and closes the browser?
The WHMCS cron re-checks open payments, so the invoice is credited on the next run. With a webhook set up, it is credited as soon as Paymentsnp confirms the payment.
Can an invoice be credited twice?
No. A second click opens the same checkout, a webhook is accepted once, and payments already credited by the earlier v2 module are recognised after an upgrade.
We upgraded from the v2 module. Do we start again?
No. Version 3 upgrades v2 in place. The gateway id paymentnpv2, settings, payment table and transaction id format are unchanged, so saved keys and payment history keep working.
Can customers be charged automatically on renewal?
No. Paymentsnp has no recurring billing or automatic debits. Your billing system issues the renewal invoice and the customer pays it.
Can our support assistant change data?
Only if you allow it. The MCP server is read-only unless PAYMENTSNP_MCP_ALLOW_WRITES=true is set, and even then no tool moves money, pays out or deletes anything. A refund made in the provider's panel can only be recorded.