Creates a new checkout session and returns a checkout_url to redirect your customer to.
The customer picks their preferred payment provider on the hosted page (or you pre-select one via provider). PayBridge notifies your returnUrl after the payment completes or fails.
Flow modes (set via flow):
hosted (default) — render the PayBridge picker. If provider is set, that option is pre-selected, but the customer can still switch.redirect — skip the picker and 302 the customer straight to the chosen provider. Requires provider. On cancellation at the provider, the customer is sent to your cancelUrl (or returnUrl?status=cancelled if no cancelUrl is set).Cancel handling: cancelUrl is optional. When omitted, cancellations fall back to returnUrl with ?session_id=...&status=cancelled appended. The hosted picker only renders a “Cancel” link when cancelUrl is explicitly provided.
Idempotency: Pass an Idempotency-Key header to safely retry failed requests without creating duplicate sessions. The key is scoped to your project and expires after 24 hours.
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.
Your PayBridge API key. Obtain one from the dashboard under Settings → API Keys. Prefix: pk_sandbox_ for testing, pk_live_ for production.
A unique string (UUID recommended) to make this request idempotent. Safe to retry on network failures.
Payment amount in paisa. Must be an integer between 1,000 (Rs. 10) and 100,000,000 (Rs. 10,00,000). eSewa, Khalti, and Fonepay reject anything below Rs. 10.
1000 <= x <= 10000000010000
Your page URL. The customer is redirected here after payment (success or failure).
"https://yourapp.com/checkout/complete"
Must be NPR. Other currencies are not yet supported.
NPR Where the customer lands when they cancel — both at the provider and via the "Cancel" link on the hosted picker. Optional. When omitted, cancellations fall back to returnUrl with ?session_id=...&status=cancelled appended, and the hosted picker hides its Cancel link entirely.
"https://yourapp.com/checkout/cancelled"
Pre-select a provider. Omit to let the customer choose on the hosted page. Required when flow is redirect.
esewa, khalti, fonepay hosted (default) renders the PayBridge picker (provider pre-selected if set). redirect skips the picker and forwards straight to the provider — requires provider.
hosted, redirect Human-readable purchase description (max 200 chars). Providers that support it — like Khalti's purchase_order_name — surface this on their hosted checkout page. Falls back to a generic placeholder when omitted.
200"Order #1001"
Arbitrary key-value data (max 8 KB). Returned on the payment object and in webhook payloads.
{
"order_id": "order_123",
"customer_id": "cust_456"
}Optional customer details pre-filled on the checkout page.
Checkout session created.
"cs_01j9x2k3m4n5p6q7r8s9t0u1v2"
true when created with a live key, false for sandbox.
Redirect your customer to this URL to complete payment.
"https://checkout.paybridgenp.com/checkout/cs_01j9x2k3m4n5p6q7r8s9t0u1v2"
Echoes the requested flow. Defaults to hosted when omitted on creation.
hosted, redirect Pre-selected provider, or null if the customer will pick on the hosted page.
esewa, khalti, fonepay