Installation
Initialization
Retries and idempotency (3.3.0)
Only GET requests are automatically retried after connection errors or HTTP 500/502/503/504 responses, up tomax_retries times (default: 2). Set
max_retries=0 to disable retries. POST, PATCH, and DELETE requests are sent once,
even when a caller supplies an idempotency key.
Every POST, PATCH, and DELETE sends an Idempotency-Key header. By default it is
a fresh UUID for each method call. All resource methods using these verbs accept
an optional keyword-only idempotency_key:
paybridgenp.checkout
checkout.create(params)
Creates a checkout session.
checkout.expire(id)
Marks a session as expired so it can no longer accept payment. Use this when you mint a fresh session for a logical purchase that already had one outstanding (e.g. a customer requesting a new payment link), so the old URL stops being payable immediately rather than waiting for its 30-minute TTL.
code: "provider_cancel_unconfirmed"; retry before creating another payable session.
paybridgenp.payments
payments.list(**kwargs)
payments.retrieve(id)
paybridgenp.webhooks
webhooks.create(**kwargs)
webhooks.list()
webhooks.delete(id)
WebhooksResource.construct_event(body, signature, secret) (static)
Verifies a webhook signature and returns the parsed event. Use this in your webhook handler.
SignatureVerificationError if:
- The signature header is missing or malformed
- The HMAC doesn’t match
- The timestamp is more than 5 minutes old (replay attack protection)
paybridgenp.billing
The billing methods provide access to plans, customers, subscriptions, and invoices. Live-mode Billing API access requires Growth or higher; sandbox Billing is available on every plan.
Plans
Customers
Subscriptions
Invoices
Not in the Python SDK yet
account, analytics, providers and sms have no resource on the Python
client — calling paybridgenp.account.get() raises AttributeError. Use the
TypeScript SDK for those, or call the endpoints directly:
GET /v1/account, GET /v1/analytics/overview, GET /v1/providers,
POST /v1/sms/notify-pending-payment.
Error handling
All SDK methods raise typed exceptions you can catch and inspect:Exception classes
Type hints
The SDK ships with apy.typed marker and full type annotations. All parameter types are exported as TypedDict classes:
Framework examples
Django
Django
Flask
Flask
FastAPI
FastAPI