PayBridgeNP

PayBridgeNP

developerpayment-gatewaynepal

Fonepay API Integration in Nepal: A Developer's Guide

How Fonepay's Dynamic QR payments work, what integrating Fonepay actually involves, and how to accept Fonepay through one API alongside eSewa and Khalti.

July 18, 20264 min readPayBridgeNP Team
Fonepay API Integration in Nepal: A Developer's Guide

Fonepay has one of the widest bank-app reaches of any single payment method in Nepal: its Dynamic QR can be scanned by almost any Nepali bank or wallet app, and confirmation is instant with no redirect. If you are building a checkout, adding Fonepay is one of the highest-impact things you can do. This guide explains how Fonepay works for developers, what a direct integration involves, and the simpler path that also gives you eSewa and Khalti.

What Fonepay is, for developers

Fonepay is a major Nepali payment network, licensed by Nepal Rastra Bank as a Payment System Operator. For an online checkout, the piece you care about is the Dynamic QR: you generate a QR code for a specific amount and order, the customer scans it with their own bank or wallet app, and you get a confirmation once they pay. There is no wallet balance to top up and no redirect away from your site.

What a direct Fonepay integration involves

Going straight to Fonepay is doable, but it is more than a single API call:

  1. Merchant onboarding through your bank. Fonepay merchant access is arranged through your acquiring bank, which issues your merchant credentials.
  2. Generating a Dynamic QR per transaction. For each order you build a QR request with the amount and order details and sign it with your merchant secret.
  3. Handling the result server-side. When the customer pays, you confirm the payment on your server before you treat the order as paid. Never rely on what the browser shows.
  4. Doing it all again for eSewa and Khalti. Each provider has its own onboarding, credentials, and signing scheme, so a "one wallet" integration does not cover the customers who use a different one.

On fees, there is a common question worth clearing up: there is no separate "Fonepay API cost" to pay per call. Fonepay QR is free for merchants; your commercial terms are agreed with Fonepay through your bank.

The simpler path: one API for Fonepay, eSewa, and Khalti

Instead of building and maintaining three separate provider integrations, you can accept all of them through PayBridgeNP with a single API. You create one checkout session and either let the customer pick their method or send them straight to Fonepay:

import { PayBridgeNP } from "@paybridge-np/sdk";

const paybridge = new PayBridgeNP({ apiKey: process.env.PAYBRIDGENP_API_KEY });

// Create a checkout and send the customer straight to Fonepay
const session = await paybridge.checkout.create({
  amount: 100000, // NPR 1,000.00, in paisa
  currency: "NPR",
  provider: "fonepay",
  flow: "redirect",
  returnUrl: "https://yourstore.com/order/confirm",
  customer: { name: "Ram Sharma", email: "ram@example.com" },
});

// Send the customer to session.checkout_url
// Confirm the payment from the webhook, never from the return URL
console.log(session.checkout_url);

Drop the provider and flow fields and the customer gets a hosted page where they choose between Fonepay, eSewa, and Khalti themselves. Either way, it is one integration, one dashboard, and one set of webhooks. Every payment settles straight to your own provider merchant accounts, because PayBridgeNP never holds your funds.

Building your own QR checkout

If you want the Fonepay QR embedded inside your own checkout UI rather than a hosted page, PayBridgeNP has a Direct QR API that returns an embeddable QR plus a live event stream, so your page can update the moment the customer pays.

Confirming a Fonepay payment correctly

This is the part most tutorials get wrong. A customer landing back on your success page is not proof that they paid: anyone can open that URL. Confirm the payment on your server first, using a signed webhook or by reading the payment back from the API. We cover exactly how to do this in confirming payments and verifying webhooks.

Next Steps


Related Articles

Ready to accept payments in Nepal?

Connect eSewa, Khalti, and Fonepay with a single API. Free to start, with no fund-holding and no new bank accounts.