This guide walks through the full payment flow - from creating a checkout session on your server to receiving a webhook when payment succeeds.Documentation Index
Fetch the complete documentation index at: https://docs.paybridgenp.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Get your API keys
Sign up at dashboard.paybridgenp.com and copy your API key from Settings → API Keys.- Sandbox keys start with
sk_test_- use these for testing - Live keys start with
sk_live_- use these for real payments
2. Install the SDK
3. Create a checkout session
Call this from your server when a customer is ready to pay.checkout_url. They’ll see the PayBridgeNP hosted checkout page and can pay with any provider you’ve configured.
cancelUrl is optional. If you omit it, cancellations fall back to your
returnUrl with ?status=cancelled appended - and the hosted picker hides
its “Cancel” link. Set cancelUrl only if you want a dedicated cancel page
and a visible Cancel link on the picker.4. Handle the return redirect
After the customer pays (or cancels), they’re redirected to yourreturnUrl (or cancelUrl if set and the customer cancelled) with query parameters:
| Parameter | Value |
|---|---|
session_id | The checkout session ID |
status | success, failed, or cancelled |
payment_id | The payment ID (only on success) |
5. Verify payment server-side
6. Set up a webhook endpoint
Go to Webhooks in the dashboard, click Add endpoint, enter your URL, and select the events you want to receive. Save the signing secret - it’s shown only once. See the webhook verification guide for full details on signature verification.Next steps
Sandbox Testing
Test the full flow with built-in test credentials before going live.
Provider Setup
Add your real eSewa, Khalti, and Fonepay credentials.
Idempotency
Make retries safe - avoid duplicate payments on network failures.
Billing
Set up recurring subscriptions and automated invoicing.