# Khalti Payment Gateway Integration in Nepal – WebApp Nepal

> WebApp Nepal integrates the Khalti merchant gateway into WooCommerce or custom sites, with server-side verification, for shops, ticketing, school fees and bookings.

Source: https://webappnepal.com/service/khalti
Provider: WebApp Nepal, Kathmandu, Nepal
Updated: 2026-08-07T21:07:55.000000Z

A Pokhara-based adventure equipment rental business had built a booking website where customers could browse gear, select rental dates, and reserve equipment. The checkout step asked customers to pay by bank transfer and send a confirmation screenshot. The owner checked Viber every morning before opening the shop to confirm which bookings had actually been paid and which were just reservations with no money behind them. On peak season weekends, fifteen to twenty pending bookings would sit unconfirmed overnight while the owner manually cross-referenced bank statements, Viber messages, and the booking list. Equipment that was held against unpaid bookings could not be rented to walk-in customers willing to pay immediately. The reconciliation work alone consumed an hour of every morning. After integrating Khalti merchant payment gateway into the booking system, payments were confirmed automatically at the moment the customer paid. The morning reconciliation disappeared. Walk-in inventory availability was accurate in real time. The bookings that had been financial uncertainty became confirmed, paid reservations the moment a customer completed checkout.



Khalti is one of Nepal's two dominant digital payment platforms alongside eSewa, with over six million registered users and a particularly strong presence among Nepal's younger urban demographic - the university students, young professionals, and technology-comfortable buyers who are the primary customers of Nepal's online businesses in Kathmandu, Pokhara, Lalitpur, and Bharatpur. Khalti wallet users carry a loaded balance they use across hundreds of merchant integrations for mobile recharges, utility bills, ticketing, food delivery, and online shopping. A Nepal business website that integrates Khalti as a payment method is embedded in the same payment ecosystem its customers already live in. Khalti's merchant gateway also accepts credit and debit cards - Visa, Mastercard, and Nepal-issued cards - alongside Khalti wallet payments, making it a broader payment acceptance solution than a wallet-only integration. WebApp Nepal integrates Khalti payment gateway for Nepal businesses across WooCommerce, custom PHP, Node.js, Next.js, and React Native applications - building confirmed, server-verified checkout flows that convert browser visits into paid orders without manual confirmation steps.



WebApp Nepal integrates Khalti merchant payment gateway for Nepal businesses running domestic e-commerce stores, ticketing and event platforms, booking and reservation systems, school and college fee collection portals, subscription and membership platforms, and mobile applications targeting Nepali users. Integration covers Khalti's current API standard (Khalti Payment Gateway v2 with server-side payment initiation and verification), webhook configuration for payment event notifications, idempotency handling for duplicate request protection, and the merchant account setup process through Khalti's merchant portal. Every integration WebApp Nepal delivers confirms payment through Khalti's server-to-server lookup API before any order is marked as paid - not from the redirect URL that the customer controls after leaving Khalti's payment page.




#### Khalti Merchant Account Setup




##### Who Can Open a Khalti Merchant Account



Nepal-registered business entities and individual professionals operating as registered sole proprietors can open a Khalti merchant account. Eligible entities include private limited companies, public limited companies, partnership firms, sole proprietorships with PAN registration, NGOs and INGOs with Nepal registration, cooperatives, educational institutions, hospitals, and event organisations. The Khalti merchant account is registered to the business name, linked to the business's registered mobile number, and issued a merchant live secret key that authenticates all API calls on behalf of the merchant. For businesses that operate multiple websites or applications - a group running a school, a hostel, and a bookshop under separate brands - separate Khalti merchant accounts are required for each distinct business entity, as each account settles separately to its linked bank account. WebApp Nepal advises clients on account structure before integration begins, because the merchant key issued at registration is the authentication credential for every API call in the integration.




##### Khalti Merchant Account Registration Process



Khalti merchant account registration is completed through the Khalti merchant portal at khalti.com. Business entities submit: company registration certificate, PAN certificate, company seal (for limited companies), memorandum of association or business registration deed, a board resolution or authorisation letter naming the account operator, and citizenship document of the authorised individual. Sole proprietors submit PAN registration and citizenship document. After document submission, Khalti's merchant verification team reviews the application and conducts KYC verification. On approval, the merchant receives live API credentials - the live secret key used for server-side API authentication - and access to the Khalti merchant dashboard for transaction monitoring, settlement requests, and API key management. The review process typically takes three to five business days from complete document submission. Khalti also provides test credentials - a test secret key and test environment endpoint - that allow development and testing to begin before the production merchant account is approved. WebApp Nepal begins integration development using test credentials in parallel with the client's merchant account registration, so that the integration is ready for production deployment when credentials are issued.




##### Khalti Merchant Dashboard and Settlement



The Khalti merchant dashboard at khalti.com gives merchants a real-time view of transaction history, payment amounts, and settlement balances. Payments received through the Khalti merchant gateway accumulate in the merchant's Khalti balance. Settlement to the merchant's linked Nepal bank account is initiated by the merchant from the dashboard. Khalti supports settlement to accounts at Nepal's major commercial banks. Settlement requests submitted on business days are typically processed within one to two business days. The merchant dashboard also provides transaction-level reports that WebApp Nepal formats as part of the integration handover documentation - showing how to reconcile dashboard transaction records with the merchant's own order management records using the Khalti transaction ID stored against each order.




#### Khalti Payment Gateway API - Technical Overview




##### Khalti Payment Gateway v2 - Initiate and Verify



Khalti's current payment gateway operates on a two-step server-side flow: payment initiation and payment verification. Unlike older payment gateway implementations that post a form directly to the gateway and rely on a redirect response, Khalti v2 uses server-side API calls at both ends of the payment. At initiation, the merchant's server calls Khalti's payment initiation API with the transaction amount, a merchant-generated unique transaction pidx (payment identifier), the customer's return URL and website URL, and item or purchase details. Khalti returns a pidx (the payment identifier for this transaction) and a payment URL. The customer is redirected to this Khalti-issued payment URL, where they authenticate with their Khalti account or pay by card. After payment, Khalti redirects the customer to the merchant's return URL with the pidx and transaction ID as URL parameters. The merchant's server then calls Khalti's payment lookup API with the pidx to verify the payment status server-to-server before accepting the transaction as confirmed. This server-side initiation and server-side verification architecture means neither the payment amount nor the payment result passes through the browser in a way that can be manipulated by the customer.




##### Payment Initiation API Call



Khalti's payment initiation API accepts a POST request to Khalti's initiation endpoint authenticated with the merchant's live secret key in the Authorization header. The request body includes: the return URL (the merchant page the customer is sent to after payment), website URL (the merchant's domain), the transaction amount in paisa (Khalti uses paisa as the amount unit - NPR 100 is submitted as 10000 paisa to avoid floating-point currency errors), the purchase order ID (the merchant's own order reference, used for reconciliation), and optional customer information (name, email, phone) and product details. Khalti responds with a pidx and a payment URL. The pidx is stored against the pending order in the merchant's database - it is the reference used for the verification lookup and for Khalti merchant dashboard reconciliation. The payment URL is the URL to which the customer is redirected. WebApp Nepal's integrations generate the initiation API call server-side, store the pidx in the order record, and redirect the customer to Khalti's hosted payment page.




##### Payment Verification API Call



After Khalti redirects the customer to the return URL, the merchant's server calls Khalti's payment lookup API with the pidx received at initiation. Khalti responds with the authoritative payment status - completed, pending, refunded, expired, or user_cancelled - along with the transaction ID, amount confirmed, fee deducted, and net refundable amount. The merchant's server compares the returned amount against the expected order amount before marking the order as paid. If the returned amount does not match the expected amount, the payment is flagged for manual review rather than auto-confirmed. WebApp Nepal's integrations implement this amount comparison as a double verification against both status and amount - a payment confirmation that returns a lower amount than the order value is treated as a discrepancy regardless of the status field. Only a verification response showing status: Completed and the correct amount triggers automatic order confirmation in WebApp Nepal's Khalti integrations.




##### Khalti Accepts Cards as Well as Wallet



Khalti's hosted payment page accepts payment from three sources: the customer's Khalti wallet balance, Khalti-linked bank accounts via connect IPS, and Visa or Mastercard credit and debit cards. This means a Nepal business integrating Khalti merchant gateway gets card acceptance capability alongside Khalti wallet acceptance through a single integration. A customer who does not have a Khalti wallet - or whose wallet balance is insufficient - can pay with their card on the same Khalti payment page. For Nepal businesses targeting both Khalti wallet users and card-holding customers who are not on eSewa or Khalti, this multi-method acceptance is commercially valuable. The merchant integration does not change based on the payment method the customer chooses on Khalti's payment page - the same initiation and verification API flow applies regardless of whether the customer paid by wallet or card.




##### Khalti Test Environment



Khalti provides a test environment at test-pay.khalti.com with test API credentials for development and integration testing. Test transactions use fake amounts and do not move real money. Khalti's test environment includes test Khalti wallet accounts with predefined test credentials that WebApp Nepal uses to simulate the complete payment flow - initiation, Khalti payment page interaction, return redirect, and verification lookup - before switching to the production environment. WebApp Nepal tests each integration in the test environment with: successful payment flow, payment abandoned by the customer, payment verification with a mismatched amount, and expired pidx handling. All flows are confirmed before the integration is switched to live credentials and a final production validation is run with a real small-amount transaction.




#### Khalti Integration for Nepal Websites and Platforms




##### WooCommerce Khalti Integration



For Nepal businesses running WooCommerce - the e-commerce platform that powers the majority of Nepal's online stores - Khalti integration is implemented as a WooCommerce payment gateway plugin that adds Khalti as a checkout payment option. WebApp Nepal's WooCommerce Khalti integration covers: registration of Khalti as a WooCommerce payment method with configurable display name and description, secure storage of the Khalti live secret key in WooCommerce payment settings, server-side payment initiation API call on checkout form submission (not a client-side redirect), pidx storage against the WooCommerce order for verification and reconciliation, success return URL handler that calls Khalti's lookup API server-side before updating WooCommerce order status, failure and cancellation URL handlers that restore the cart for retry, WooCommerce order notes updated with the Khalti transaction ID and confirmation details for merchant reconciliation, and order confirmation email triggered by WooCommerce's standard completion hook after payment verification is confirmed. The plugin is tested in Khalti's test environment before the live secret key is configured.




##### Custom PHP Khalti Integration



For Nepal websites built on custom PHP frameworks or plain PHP without WooCommerce - school fee management systems, hospital billing portals, cooperative member payment platforms, event registration systems - WebApp Nepal implements Khalti integration using PHP's cURL functions for both the initiation and verification API calls. The integration is structured as a payment service class that isolates the Khalti API communication from the application's order management and business logic. The class exposes two methods: initiate payment (accepts order details, calls Khalti's initiation endpoint, returns the pidx and payment URL) and verify payment (accepts the pidx from the return URL, calls Khalti's lookup endpoint, returns the verified status and amount). Application controllers call these methods without containing any Khalti API logic directly. This separation makes it straightforward to update the Khalti API communication layer when Khalti modifies its endpoints or authentication format without touching the application's business logic.




##### Node.js and Next.js Khalti Integration



For Nepal applications built on Node.js backends or Next.js with server-side API routes, WebApp Nepal implements Khalti integration using axios or the built-in fetch API for the initiation and verification calls, with the Khalti live secret key stored as a server-side environment variable. Next.js applications handle Khalti integration through API routes: a payment initiation route that accepts the order details from the checkout page, calls Khalti's initiation endpoint server-side, and returns the payment URL to the frontend for redirect; and a verification route that handles the return URL callback, calls Khalti's lookup API, and updates the order status before rendering the confirmation page. For React single-page applications backed by a Node.js API server, the same server-side boundary applies - the initiation and verification calls are Node.js backend API calls, not browser fetch calls, keeping the Khalti secret key on the server. WebApp Nepal reviews the application's request routing before scoping Node.js or Next.js integrations to confirm that the secret key and API calls are correctly placed on the server side.




##### React Native Mobile App Khalti Integration



Nepal mobile applications built in React Native and targeting Nepali users integrate Khalti through a combination of backend API endpoints and React Native WebView for the Khalti-hosted payment page. The mobile app calls the backend's payment initiation endpoint to receive the Khalti payment URL, opens that URL in a React Native WebView, and monitors URL changes in the WebView for the redirect to the merchant's return URL - which signals the customer has finished on Khalti's payment page. On detecting the return URL redirect, the app calls the backend's payment verification endpoint, which calls Khalti's lookup API server-side and returns the confirmed payment status to the mobile app. The mobile app renders the confirmation screen based on the backend's verified response. The Khalti secret key is never embedded in the React Native app binary. WebApp Nepal has integrated Khalti into React Native applications for Nepali food delivery platforms, ticketing apps, and membership card applications where Khalti wallet payment is the primary payment method for the user base.




#### Khalti Integration Security Considerations




##### Live Secret Key Security



The Khalti live secret key is the authentication credential for every API call the merchant makes to Khalti's platform. A compromised live secret key allows an attacker to make API calls on the merchant's behalf, including initiating payment requests and querying transaction data. WebApp Nepal stores the Khalti live secret key exclusively as a server-side environment variable - in a .env file on the server outside the web root, in a cloud secrets manager for cloud-hosted applications, or in a platform environment configuration for services like Railway, Render, or AWS Elastic Beanstalk. The key is never placed in browser JavaScript, mobile application code, or committed to a version control repository. If a live secret key is accidentally exposed - for example, if it appears in a public GitHub repository - the key must be rotated immediately through the Khalti merchant dashboard, and WebApp Nepal updates the server-side configuration with the replacement key without any downtime to the checkout flow.




##### Amount Verification Before Order Confirmation



Khalti's payment verification API returns the amount confirmed in paisa along with the payment status. WebApp Nepal's integrations compare the returned amount against the expected order amount stored in the merchant's database before confirming the order as paid. This comparison is the defence against an underpayment scenario where a customer initiates a Khalti payment for a manipulated lower amount and the merchant's system accepts the payment verification status without checking the amount. For a merchant selling a NPR 5,000 product, a payment verification that returns status Completed but an amount of NPR 50 is a failed payment, not a successful one. The amount field in the verification response is checked against the order total in the database - the comparison uses the database value, not any URL parameter the customer could modify.




##### Pidx Storage and Idempotency



Each Khalti payment initiation returns a unique pidx that identifies the specific payment session. WebApp Nepal stores this pidx against the pending order record at the moment of initiation, before the customer is redirected to Khalti's payment page. On the return URL callback, the pidx from the URL parameter is matched against the stored pidx for the order - if they do not match, the callback is rejected. This prevents a scenario where a customer submits a pidx from a different transaction in the return URL to attempt to claim confirmation of the wrong payment. The pidx field in the order payments table carries a uniqueness constraint to prevent the same pidx from confirming multiple orders in the event the return URL is loaded more than once by a browser reload or network retry.




#### Khalti Integration for Specific Nepal Industries




##### Event Ticketing and Concerts



Nepal's event organisers - music concerts, comedy shows, cultural programmes, sports events, and public exhibitions - use Khalti merchant integration for online ticket sales because Khalti's user base is concentrated in the urban, young, entertainment-consuming demographic that attends these events. An event organiser in Kathmandu selling concert tickets at NPR 500 to NPR 2,000 per seat needs a payment system that works at the moment the event is announced and does not require the ticket buyer to have a bank account or credit card. Khalti wallet payment handles this: the ticket buyer completes the transaction in under thirty seconds from the phone they are already holding. WebApp Nepal builds Khalti-integrated event ticketing systems for Nepal organisers with: seat or category selection, automatic ticket quantity limit enforcement to prevent overselling, Khalti payment checkout, QR code ticket generation on payment confirmation, and email or SMS ticket delivery. For recurring event organisers, the ticketing platform is built as a reusable tool they can configure for each new event without developer involvement.




##### Food Delivery and Restaurant Orders



Nepal's food delivery platforms and restaurant online ordering systems targeting Kathmandu Valley and Pokhara customers use Khalti as a primary prepayment option alongside cash on delivery. Khalti wallet payment for food orders eliminates the cash handling complexity of delivery - the delivery person does not need to carry change, the customer does not need exact cash, and the restaurant receives confirmed payment before the order enters the kitchen. WebApp Nepal integrates Khalti into food ordering systems with a real-time order confirmation flow: payment initiation at order placement, Khalti verification on return, immediate kitchen notification on confirmed payment, and live order status tracking linked to the confirmed payment record. For restaurant platforms managing multiple outlets under one ordering system, Khalti payment confirmation is linked to the specific outlet's order queue.




##### Education - Fee and Course Payment



Nepal schools, colleges, coaching institutes, and online learning platforms use Khalti merchant integration for fee and course payment collection. The student and younger-adult demographic that makes up the majority of Nepal's educational institution users is also Khalti's primary user base - these users have Khalti installed and funded as their everyday payment app. Fee payment through Khalti eliminates the queue at the school cashier for families who bank at a different institution, the manual receipt writing that creates reconciliation work, and the cash handling risk for institutions managing large daily fee collection volumes. WebApp Nepal builds Khalti-integrated fee payment portals for Nepal educational institutions with student identification login (roll number, admission ID, or registration number), fee structure display showing due amounts by category and period, partial payment support where institutions allow installments, payment receipt generation on confirmation, and an administrative reconciliation panel showing payments received by date, student, and fee category.




##### Subscriptions and Membership Platforms



Nepal businesses running subscription or membership models - online news portals, digital content platforms, gym and fitness memberships, professional association memberships, cooperative share subscriptions - use Khalti for recurring payment collection from Nepali subscribers. Khalti does not currently support fully automated recurring billing (autopay) in the same way as a card subscription - each billing cycle requires the subscriber to actively approve the payment. WebApp Nepal implements subscription reminder flows for Khalti-integrated Nepal platforms: an automated email or SMS is sent to the subscriber when their renewal is due, with a Khalti payment link for one-click renewal; the subscriber clicks the link, pays through Khalti, and the payment verification updates their subscription expiry in the platform automatically. For platforms with a large subscriber base, the renewal reminder and payment link generation are handled by a scheduled background job that runs daily and sends reminders to subscribers whose renewal falls within the next seven days.




##### NGOs and Crowdfunding



Nepal NGOs, community organisations, and crowdfunding campaigns use Khalti merchant integration for domestic donation collection because Khalti's frictionless wallet payment makes small donations as easy as a mobile recharge. A disaster relief campaign, a school scholarship fund, or a community infrastructure project that previously relied on cash collection boxes or bank transfer instructions can accept digital donations starting from NPR 10 through a Khalti payment link shared on social media. WebApp Nepal builds Khalti donation and crowdfunding pages for Nepal organisations with configurable campaign pages showing progress toward a funding target, preset and custom donation amount options, Khalti payment checkout, real-time donation counter updated on each verified payment, donor acknowledgement with the Khalti transaction reference, and an administrative dashboard showing total raised, donor list, and daily collection summary. For organisations with existing donor CRM systems, the Khalti payment integration records are bridged to the CRM on payment confirmation.




##### Booking and Reservation Systems



Nepal businesses that manage bookings with limited capacity - adventure gear rental, photography studio bookings, yoga and fitness class reservations, vehicle rental, private tutor session bookings - use Khalti payment to convert tentative reservations into confirmed, paid bookings. The scenario the Pokhara gear rental owner described at the start of this page - inventory held against unpaid bookings, manual morning reconciliation - is the problem Khalti payment integration solves for every reservation-based business. When a booking is confirmed only after Khalti payment verification, every confirmed booking in the system has a corresponding Khalti transaction ID. There is no ambiguity about which bookings are paid and which are placeholders. Inventory availability is accurate because only paid bookings reduce the available count. WebApp Nepal builds Khalti-integrated booking systems for Nepal businesses where the specific constraint is that capacity is limited and unpaid reservations have a real opportunity cost.




#### Khalti Integration Pricing in Nepal



Khalti merchant gateway integration by WebApp Nepal for a WooCommerce store - plugin development, initiation and verification API implementation, test environment testing, live key configuration, production validation, and integration documentation - costs NPR 20,000 to NPR 40,000. A custom Khalti integration for a non-WooCommerce Nepal application (custom PHP, Node.js, Next.js) with server-side initiation and verification, amount validation, pidx idempotency handling, and admin transaction log costs NPR 35,000 to NPR 65,000. Khalti integration for a React Native mobile application with backend API endpoints and WebView payment flow costs NPR 45,000 to NPR 75,000. Integration as part of a new website or application project - ticketing platform, school fee system, booking portal, or donation page - is included within the overall project scope rather than priced separately. Khalti's own merchant transaction fee and settlement terms are disclosed by Khalti at merchant account registration and are separate from WebApp Nepal's development fee.



Nepal businesses that have been managing payments through Viber screenshots, manual bank reconciliation, and next-morning confirmation calls are operating a payment system that costs them time every day and costs them conversions every week. Khalti merchant gateway integration replaces that manual process with automatic payment confirmation at the moment the customer pays - the order is confirmed, the inventory is updated, the receipt is sent, and the merchant's dashboard shows a new transaction, all without any manual step. WebApp Nepal has built Khalti integrations for booking systems, ticketing platforms, school fee portals, and e-commerce stores across Nepal - each integration built to the specific payment flow the business operates rather than a template checkout dropped into an existing site. Contact WebApp Nepal to scope your Khalti merchant gateway integration and receive a timeline and NPR cost before development begins.

## Frequently asked questions

### What is the Khalti merchant payment gateway?

The Khalti merchant payment gateway is a payment acceptance service that allows Nepal-registered businesses and registered sole proprietors to receive payments from Khalti wallet users and card holders (Visa and Mastercard) on their websites, applications, and portals. The merchant is issued a live secret key used to authenticate server-side API calls for payment initiation and verification. Payments received accumulate in the merchant's Khalti balance and are settled to the merchant's linked Nepal bank account on request. WebApp Nepal integrates the Khalti merchant gateway for WooCommerce stores, custom PHP sites, Node.js and Next.js applications, and React Native mobile apps.

### Does Khalti only accept Khalti wallet payments, or does it accept cards too?

Khalti's hosted payment page accepts three payment methods: Khalti wallet balance, Khalti-linked bank accounts via connectIPS, and Visa or Mastercard credit and debit cards. A Nepal business integrating Khalti merchant gateway gets wallet and card acceptance through a single integration. A customer without a Khalti wallet or with insufficient wallet balance can pay with their Visa or Mastercard card on the same Khalti payment page. The merchant integration does not change based on the customer's chosen payment method - the same initiation and verification API flow applies regardless.

### Who can open a Khalti merchant account in Nepal?

Nepal-registered businesses and registered sole proprietors can open a Khalti merchant account. Eligible entities include private limited companies, public limited companies, partnership firms, sole proprietorships with PAN registration, NGOs, INGOs, cooperatives, educational institutions, hospitals, and event organisations. The merchant account is registered in the business name, linked to the business's registered mobile number, and issued a live secret key for API authentication. WebApp Nepal advises clients on the merchant account setup process before integration work begins.

### What documents are required to open a Khalti merchant account?

Business entities need: company registration certificate, PAN certificate, company seal (for limited companies), memorandum of association or business registration deed, board resolution or authorisation letter naming the account operator, and citizenship document of the authorised individual. Sole proprietors need PAN registration and citizenship document. Khalti's merchant verification team reviews the application and conducts KYC before issuing live API credentials. The process typically takes three to five business days from complete document submission. Khalti also provides test credentials that allow development to begin before the production account is approved.

### How does Khalti payment gateway v2 work?

Khalti v2 uses a two-step server-side API flow. First, the merchant's server calls Khalti's payment initiation API with order amount, purchase order ID, return URL, and customer details. Khalti returns a pidx (payment identifier) and a hosted payment URL. The customer is redirected to this URL to pay. After payment, Khalti redirects the customer to the merchant's return URL with the pidx. Second, the merchant's server calls Khalti's payment lookup API with the pidx to verify the payment status and amount server-to-server. Only after this lookup confirms status: Completed and the correct amount does the merchant system mark the order as paid. Neither the payment amount nor the result passes through the browser in a manipulable form.

### What is a pidx in Khalti payment integration?

A pidx (payment identifier) is a unique string returned by Khalti's initiation API for each payment session. It identifies the specific payment transaction and is used as the reference for Khalti's verification lookup API call. WebApp Nepal stores the pidx against the pending order record at initiation, before the customer is redirected to Khalti's payment page. On the return URL callback, the pidx from the URL is matched against the stored pidx for the order. The pidx field carries a database uniqueness constraint to prevent the same payment from confirming multiple orders in the event of a callback being received more than once.

### Why is server-side payment verification important in Khalti integration?

After a customer pays on Khalti's hosted page, Khalti redirects the customer to the merchant's return URL with the pidx in the URL parameters. These URL parameters can be observed and replayed by a technically-informed user. Server-side verification calls Khalti's payment lookup API from the merchant's backend with the pidx to receive Khalti's authoritative payment status and the confirmed amount. This call cannot be forged by the customer. WebApp Nepal makes this server-to-server verification call in every Khalti integration before marking any order as paid. An integration that updates order status based solely on the return URL parameters is vulnerable to manipulation and should not be deployed in a live payment environment.

### Does WebApp Nepal verify the payment amount in addition to the status?

Yes, and this is a critical security step. Khalti's verification API returns both a payment status and the confirmed amount in paisa. WebApp Nepal's integrations compare the returned amount against the order total stored in the merchant's database before confirming the order. A payment that returns status Completed but a lower amount than expected - for example, NPR 50 confirmed for a NPR 5,000 order - is treated as a discrepancy and flagged for manual review rather than auto-confirmed. The comparison uses the amount stored in the database at order creation, not any URL parameter submitted by the customer.

### How does WebApp Nepal integrate Khalti with WooCommerce?

WebApp Nepal implements a custom WooCommerce payment gateway plugin that adds Khalti as a checkout payment option. The plugin handles: server-side payment initiation API call on checkout submission, pidx storage against the WooCommerce order, return URL handler calling Khalti's lookup API before updating order status, amount verification before order confirmation, WooCommerce order notes updated with the Khalti transaction ID, and order confirmation email triggered after payment is verified. Abandoned payment handling restores the cart for retry. The plugin is tested in Khalti's test environment before the live secret key is configured. WooCommerce Khalti integration typically costs NPR 20,000 to NPR 40,000.

### Can Khalti be integrated with a custom PHP website?

Yes. WebApp Nepal integrates Khalti into custom PHP websites and frameworks (Laravel, CodeIgniter, plain PHP) using PHP's cURL for the initiation and verification API calls. The integration is structured as a payment service class with two methods - initiate payment and verify payment - that isolate Khalti API communication from the application's business logic. This structure makes it straightforward to update the Khalti layer when Khalti modifies its API without touching the rest of the application. Custom PHP Khalti integrations WebApp Nepal delivers include school fee systems, cooperative contribution portals, hospital billing systems, and event registration platforms.

### Can Khalti be integrated with Node.js or Next.js applications?

Yes. WebApp Nepal integrates Khalti into Node.js and Next.js applications using axios or fetch for the initiation and verification API calls, with the Khalti live secret key stored as a server-side environment variable. Next.js integrations use API routes for both initiation (accepting order details from the frontend, calling Khalti server-side, returning the payment URL) and verification (handling the return callback, calling Khalti's lookup API, updating order status). For React SPAs backed by a Node.js API, the same server-side architecture applies. The Khalti secret key never reaches the browser in any of these implementations.

### Can Khalti be integrated with a React Native mobile application?

Yes. React Native Khalti integration uses backend API endpoints for initiation and verification (server-side, with the secret key on the backend) and React Native WebView for rendering Khalti's hosted payment page within the app. The WebView monitors URL changes for the redirect to the return URL, which triggers the backend verification call. The verified status is returned to the mobile app and used to render the confirmation screen. The Khalti secret key is never embedded in the React Native app binary. React Native Khalti integration typically costs NPR 45,000 to NPR 75,000.

### Is the Khalti live secret key safe to put in frontend JavaScript or a mobile app?

No. The Khalti live secret key must never appear in browser JavaScript, React Native app code, or any client-side environment. A secret key in client-side code can be extracted from the browser's developer tools or by decompiling the mobile app binary. WebApp Nepal stores the Khalti live secret key exclusively as a server-side environment variable and uses it only in server-side API calls. If the key is accidentally exposed in a public repository or client-side code, it must be rotated immediately through the Khalti merchant dashboard and the server-side configuration updated with the new key.

### How does WebApp Nepal handle abandoned Khalti payments?

A customer who opens Khalti's payment page and closes it without completing payment leaves a pending order in the merchant's system. WebApp Nepal implements a pending order expiry mechanism: pending orders without confirmed payment are released after a configurable window (typically 30 to 60 minutes) by a scheduled background job. This frees held inventory, removes stale pending orders from the queue, and allows the customer to retry with a fresh order. The expiry window is configured to the merchant's business type - shorter for limited-inventory bookings and events with seat counts, longer for digital or unlimited-stock products.

### How does WebApp Nepal test Khalti integration before going live?

All Khalti integrations are fully tested in Khalti's test environment using test API credentials and test Khalti accounts before production credentials are used. Test scenarios include: successful payment flow (test buyer completes payment, order status updates, confirmation email sends), payment abandoned by the customer (order remains pending, cart restored), verification with a mismatched amount (payment flagged as discrepancy, order not confirmed), pidx mismatch in the return URL (callback rejected), and expired pidx handling. After all scenarios pass, the integration is switched to live credentials and a final production validation is run with a real small-amount transaction.

### Can Khalti be used for event ticketing in Nepal?

Yes, and event ticketing is one of the strongest use cases for Khalti integration because Khalti's user base is concentrated in the urban young demographic that attends concerts, comedy shows, and cultural events. WebApp Nepal builds Khalti-integrated event ticketing systems with seat or category selection, quantity limit enforcement, Khalti payment checkout, QR code ticket generation on payment confirmation, and email or SMS ticket delivery. For recurring event organisers, the system is built as a reusable platform they can configure for each new event without developer involvement.

### Can Khalti be used for school and college fee collection?

Yes. Nepal schools, colleges, coaching institutes, and online learning platforms use Khalti for fee and course payment collection because the student demographic is Khalti's primary user base. WebApp Nepal builds Khalti-integrated fee portals with student ID login, fee structure display by category and period, partial payment support for instalment arrangements, payment receipt generation on confirmation, and administrative reconciliation panels showing daily collection by student and fee category. For institutions with existing student management systems, the Khalti integration is connected to the existing system rather than replacing it.

### Does Khalti support recurring or subscription payments?

Khalti does not currently support fully automated recurring billing where the merchant charges the customer's Khalti wallet automatically on a schedule without the customer actively approving each payment. For Nepal subscription and membership platforms, WebApp Nepal implements a renewal reminder flow: an automated email or SMS is sent to the subscriber when renewal is due, with a Khalti payment link for one-click renewal. The subscriber approves the payment; the verification API call updates the subscription expiry automatically. This active-approval renewal model is different from fully automated card-on-file billing but is effective for Nepal subscription businesses where the subscriber base is Khalti-native.

### How are Khalti merchant payments settled to the merchant's bank account?

Payments received through the Khalti merchant gateway accumulate in the merchant's Khalti wallet balance. Settlement to the merchant's linked Nepal bank account is initiated by the merchant through the Khalti merchant dashboard. Khalti supports settlement to accounts at Nepal's major commercial banks. Settlement requests submitted on business days are typically processed within one to two business days. The merchant dashboard provides transaction-level reports that WebApp Nepal formats as part of the integration handover documentation for reconciliation between dashboard records and the merchant's order management system.

### What is Khalti's merchant transaction fee?

Khalti charges a merchant service fee on transactions processed through the gateway - a percentage of the transaction amount deducted before settlement to the merchant's Khalti balance. The exact rate depends on the merchant category and transaction type and is disclosed by Khalti at merchant account registration. WebApp Nepal advises clients to confirm the applicable fee rate with Khalti's merchant team before launching the integration so the fee is factored into product pricing and margin calculations before go-live. The Khalti merchant fee is separate from WebApp Nepal's integration development fee.

### How much does Khalti payment gateway integration cost in Nepal?

Khalti merchant gateway integration pricing at WebApp Nepal: WooCommerce Khalti plugin integration costs NPR 20,000 to NPR 40,000. Custom PHP, Node.js, or Next.js application integration with server-side initiation, verification, amount validation, and transaction logging costs NPR 35,000 to NPR 65,000. React Native mobile app integration with backend API and WebView payment flow costs NPR 45,000 to NPR 75,000. Integration included within the scope of a new website or application project is not priced separately. All integrations include test environment validation, live credential configuration, production validation, and handover documentation. Khalti's own merchant transaction fee applies separately.
