When You Need This
- Sell add-ons, credits, or one-time purchases to existing customers
- Upgrade or downgrade subscription plans
- Recover failed subscription payments
- Process charges without showing checkout UI
Decision Flowchart
Choose Your Approach
| I want to… | Approach | Best For |
|---|---|---|
| Show checkout and let customer confirm | SDK Checkout | Most scenarios—automatic card update on failure |
| Charge silently without UI | API-Only Charges | Silent plan changes, automated billing |
SDK Checkout
Display checkout with the customer’s saved payment method. If payment fails, they can switch to a new card instantly.Client Session Parameters
| Use Case | Parameters | Result |
|---|---|---|
| One-time payment | customer.id + plan.id | Payment only |
| Change subscription plan | customer.id + plan.id + subscription.id + proration_billing_mode | Plan updated + payment |
| Recover past-due | customer.id + subscription.id | Subscription reactivated |
For plan changes, include both the new
plan.id and the existing subscription.id. For recovery, omit plan.id—PayNext uses the subscription’s current plan.Example: One-Time Charge
cURL
id:
Payment Method Display
| Mode | Behavior |
|---|---|
saved_or_new (default) | Show saved card, allow switching to new |
new_only | Collect new card only |
- saved_or_new
- new_only
Shows the customer’s saved card with an option to add a new one.
Demo: saved_or_new checkout flow
Animated demo coming soon
API-Only Charges
Charge a customer’s saved payment method without displaying checkout UI. PayNext processes synchronously and returns the result immediately.When to Use
| Scenario | Example |
|---|---|
| One-time payment or new subscription | Add-ons, credits, or start subscription without UI |
| Change subscription plan | Silent plan upgrade/downgrade with immediate charge |
Create a Charge
cURL
Handle Failures
When a charge fails, check theadvice_code to determine next steps. See Decline Codes for the full list.
For plan changes without immediate payment, use the Schedule Plan Change API instead—no charge occurs until the next billing date.
Subscription Renewals
PayNext automatically handles subscription renewals—you don’t need to create charges manually. Use the approaches above only for:- One-time purchases (add-ons, credits)
- Silent plan upgrades/downgrades
- Manual recovery after failed renewals
For failed subscription renewals, PayNext moves the subscription to
past_due. Use Recover Subscriptions to collect payment with customer interaction.