PayBridge NP supports time-based trials on subscriptions. Trials are configured at the plan level and can be overridden per subscription.Documentation Index
Fetch the complete documentation index at: https://docs.paybridgenp.com/llms.txt
Use this file to discover all available pages before exploring further.
How trials work
- Set
trialDayson a plan (or passtrialDays/trialEndsAtwhen creating a subscription). - The subscription starts in a
trialingstate - no invoice is generated during the trial window. - 72 hours before the trial ends, PayBridge sends a
subscription.trial_will_endwebhook and emails the customer a heads-up. - When the trial ends, PayBridge generates the first paid invoice, emails the hosted payment link to the customer, and fires
subscription.trial_ended. - The customer pays the invoice manually - Nepal’s redirect-based payment providers (eSewa, Khalti, Fonepay) don’t support saved-card auto-charging, so we never silently charge after a trial.
Setting a trial on a plan
Per-subscription override
PasstrialDays or trialEndsAt on POST /v1/billing/subscriptions to override the plan default:
trialEndsAt wins. When neither is provided, the plan’s trialDays is used. trialDays: 0 disables the trial.
Ending a trial early
UsePOST /v1/billing/subscriptions/{id}/end-trial to convert the subscription immediately. The first paid invoice is generated synchronously and returned in the response. Idempotent - repeated calls return 409 trial_not_active.
Extending a trial
POST /v1/billing/subscriptions/{id}/extend-trial with { "trialEndsAt": "…" } pushes the end date forward. Must be strictly after the current trial end, and the trial must still be active. The 72h reminder is re-armed for the new end date.
Webhooks
| Event | When it fires |
|---|---|
subscription.trial_will_end | ~72h before trialEndsAt. Exactly once per trial. |
subscription.trial_ended | When the first paid invoice is generated. |
subscription.trial_extended | When extend-trial is called. |
Disabling the trial feature
SetTRIALS_ENABLED=false in the API environment to kill-switch all trial endpoints and the scheduler cycle. Existing trialing subscriptions continue until their trialEndsAt elapses.