Installation
Initialization
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.
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. Billing API access requires the Growth plan or higher.
Plans
Customers
Subscriptions
Invoices
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