Skip to main content
Network failures happen. If your server sends a POST /v1/checkout request and the connection drops before you receive a response, you don’t know whether PayBridgeNP created the session or not. Retrying blindly can create duplicate checkout sessions for the same order. PayBridgeNP supports idempotency keys on POST /v1/checkout to make retries safe.

How it works

Pass a unique Idempotency-Key header with your request:
If the request succeeds, PayBridgeNP stores the key and response. If you retry with the same key, PayBridgeNP returns the original response without creating a new session - even if the original request completed successfully.

Key rules

  • Use UUID v4 - random, unguessable, one per logical operation (not per HTTP request)
  • Scope is per project - the same key can be reused across different projects
  • Keys expire after 24 hours - after that, the same key creates a new session
  • Supported on the write endpoints that create resources - POST /v1/checkout, POST /v1/refunds, POST /v1/webhooks, and the billing POSTs (plans, customers, subscriptions, invoices, and their actions). GET requests are idempotent by design and ignore the key

Generating a UUID v4

Using with the SDK

On retry, pass the same key that was stored with the order:

Concurrent request conflict

If two requests with the same key arrive at exactly the same time, one of them will receive a 409 Conflict:
This is safe to retry after a short delay - it means a parallel request is already in flight.

When to use idempotency keys