Before creating subscriptions, set up a recurring plan in your Dashboard. See Plans to learn how to configure billing cycles, trial periods, and pricing.
The Subscription Lifecycle
When a customer completes checkout with a recurring plan, PayNext creates a subscription and manages it through these stages:Subscription Statuses
A
past_due subscription also pauses retries when its saved payment method can no longer be charged at all, and resumes—immediately—if a card update revives it. See Dead payment methods.Create a Subscription
Include a recurringplan.id in your client session. When checkout completes, PayNext creates the subscription automatically.
subscription_v2.created webhook and schedules future renewals based on the plan’s billing cycle.
Manage Subscriptions
Change Plans
Upgrade or downgrade active subscriptions:- Dashboard — Select subscription → Change Plan
- SDK/API — See Change Subscription Plan
Cancel
You can cancel subscriptions immediately or schedule cancellation for the end of the billing cycle.Schedule cancellation (recommended)
Customer keeps access until the current billing cycle ends, then transitions tocancelled.
- Dashboard — Select subscription → Cancel → At end of billing cycle
- API —
POST /subscriptions/schedule-cancel/{id}
scheduled_for_cancellation and automatically transitions to cancelled when the cycle ends.
Cancel immediately
Ends the subscription now. Customer loses access immediately.- Dashboard — Select subscription → Cancel → Immediately
- API —
POST /subscriptions/cancel/{id}
Cancellation details
Every cancelled subscription records why it ended and when, so you can tell voluntary churn apart from dunning exhaustion, workflow rules, and fraud/dispute activity. Two fields carry this — both always present on the subscription, andnull until it’s cancelled:
For scheduled cancellations,
cancellation_details is populated at schedule time (visible on the subscription_v2.scheduled_for_cancellation event) and finalized when the subscription ends. Reactivating a subscription clears both fields back to null.
The reason is server-owned — you choose the cancellation type (
cancel_immediately or schedule_cancellation), never the reason. Your API and Dashboard cancels are always attributed merchant_initiated. A cancel request that includes a reason-like field (reason, cancellation_details, trigger_payment_id) is rejected with 400.Reactivate
Setstatus: active with PATCH /subscriptions to reactivate a scheduled_for_cancellation or cancelled subscription. What happens depends on whether the paid period (current_period_end) is still active.
When the paid period has ended, the reactivation charge determines the outcome:
- Charge succeeds →
activewith a new billing period. - Charge fails →
past_due; the subscription enters the standard dunning flow and access is not restored.
subscription_v2 event reflecting the resulting status (subscription_v2.activated on reactivation, or subscription_v2.past_due if the reactivation charge fails).
A
past_due subscription cannot be reactivated with this endpoint—collect payment via SDK checkout instead. See Recover Subscriptions.Handle Failed Payments
When a renewal payment fails, PayNext automatically retries up to 8 times. During this period, the subscription remainspast_due.
Automatic retry
PayNext attempts recovery automatically. Track progress via thesubscription_v2.past_due webhook, which carries an incremented attempt_count on each retry:
An attempt can also run ahead of its scheduled slot. For a payment declined for insufficient funds, the card network signals when the funds are likely there and the attempt runs at that moment instead—it replaces the scheduled attempt rather than adding one. See Funds-Available Retries.
Billing date on recovery
When recovery succeeds, the next billing date shifts to the recovery date plus one billing interval—not from the original renewal date. Example: A 28-day subscription was due to renew on Dec 1, but the payment failed. Recovery succeeds on Dec 5. The next billing date is Jan 2 (Dec 5 + 28 days), not Dec 29 (Dec 1 + 28 days).Recovery exhausted
If all 8 retry attempts fail, the subscription automatically transitions tocancelled.
Webhook Events
Listen for these events to keep your system in sync:
See Webhook Events for the full list and payload schemas.