Skip to main content
The PayBridgeNP Billing system handles recurring payments - create a plan, add customers, and start subscriptions. PayBridgeNP generates invoices automatically at each renewal, sends payment links to customers, and manages retries when payments fail.
In live mode, Billing requires a Growth plan or higher. In sandbox mode, every plan can build and test the full Billing lifecycle. See the sandbox limits.

Core concepts

Plans define the recurring charge - amount, interval (monthly, yearly, etc.), trial period, and dunning behavior. Plans are templates; subscriptions are instances. Customers are the people being billed. They exist independently of subscriptions - you can have a customer with no active subscriptions. Subscriptions link a customer to a plan. When you create a subscription, PayBridgeNP immediately generates the first invoice (unless there’s a trial period). Invoices are generated automatically at each billing cycle. Each invoice has a payment link that PayBridgeNP sends to the customer. Invoices go from open → paid once the customer pays, or overdue if they don’t pay in time.

Sandbox limits

Sandbox Billing is open on every plan with these account-level guardrails: Other sandbox emails are recorded but not sent. A sandbox subscription auto-expires after 12 generated invoices or 30 days without a payment. Coupons and dunning policies are mode-specific, so a sandbox coupon or policy never affects live Billing; the same code can exist once in each mode. For usage, invoice items, subscription discounts, dunning actions, and proration, use a key belonging to the subscription or invoice’s project and mode. Another project’s key cannot access these records, even within the same account. A proration target plan must also belong to that project and mode. Dunning policy definitions remain shared within an account and mode.
Instead of the hosted payment link, you can collect an invoice with a Fonepay Direct-QR (POST /v1/billing/invoices/{id}/qr) - the customer scans a QR in your own app or at a counter, and on payment the invoice is marked paid and the subscription activates automatically. See Direct-QR for Fonepay.

Step 1: Create a plan

Interval options

Dunning settings

Dunning controls what happens when a customer doesn’t pay on time:

Step 2: Create a customer

The externalCustomerId field lets you link PayBridgeNP customers to your own user records.

Step 3: Create a subscription

When a subscription is created:
  • A future startDate displays as draft. At the start date it displays as trialing when a trial follows, otherwise active.
  • A trial displays as trialing, and no invoice is generated until the trial ends.
  • An immediate subscription without a trial starts as incomplete. PayBridgeNP generates the first invoice and sends its payment link; the subscription becomes active when that invoice is paid.
Do not grant paid access from status alone. active means billing is enabled, but it can coexist with an open first invoice after a trial or an overdue renewal when the plan uses keep_active. Base access for a billing period on that period’s invoice.paid event or paid invoice record. For immediate prepaid activation, the subscription stays incomplete until the first invoice is paid; if it remains unpaid for 24 hours, it becomes incomplete_expired and the invoice is voided.

Subscription lifecycle

Subscription activation routes and the keep active, mark past due, pause, and cancel overdue actions

Activation and renewal states. An overdue invoice follows the action saved on the plan.


Managing subscriptions

Pause

No invoices are generated while paused. Resume resumes billing from the current period.

Resume

Cancel

Change plan

The current period continues on the old plan. At renewal, the subscription switches to the new plan.

Invoices

Invoices are read-only from the API - PayBridgeNP creates them automatically. Use them to display billing history to customers.

Webhook events

PayBridgeNP fires webhook events throughout the subscription lifecycle: