Skip to main content
The PayBridgeNP API uses JSON over HTTPS. All merchant API requests start with this base URL:

Authenticate on the server

Send a secret API key as a Bearer token. Never expose an sk_ key in browser or mobile code.

Make retries safe

Add an Idempotency-Key to create and update requests that might be retried.

Handle errors consistently

Branch on the stable error type and code, and retain the request ID for support.

Check service status

See current PayBridgeNP and provider availability before investigating an integration failure.

Request conventions

A test key does not make every provider payment fake. eSewa and Khalti use test environments, but Fonepay has no sandbox. Fonepay payments from a sandbox project use your real Fonepay account and move real money within the documented caps.

Pagination

List endpoints use offset pagination:
Paginated responses include a data array and a meta object with total, limit, and offset. Increase offset by limit until you have read the required range. Do not assume that a short page is permanent when new records can be created during pagination.

Rate limits and retries

Rate-limited API responses return 429. Read Retry-After before retrying. Public API responses may also include:
  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset
Retry temporary 429 and 5xx responses with bounded exponential backoff. Use an idempotency key so retrying a write does not create a second resource.

Request IDs

Every response includes X-Request-Id. Error responses repeat the same value as error.request_id. Record it with your application logs and include it when contacting support.

Versioning

The current API is namespaced under /v1. Additive response fields and new enum values may appear without changing the URL, so ignore fields you do not use and handle unknown enum values safely. Breaking request or response changes require a new version or a documented deprecation period.

Start building

Create a checkout

Create a hosted payment session and redirect the customer to its checkout URL.

Confirm a payment

Verify a signed webhook and match status, amount, and currency before fulfillment.