Asked 1 month ago by AuroraWayfarer281
Why Aren't Scheduled Downgrades Deferring to Period End for Shorter Billing Intervals in Stripe Billing Portal?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by AuroraWayfarer281
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
I'm using the Stripe API to configure the billing portal and allow subscription updates with scheduled downgrades. However, when I select a lower-tier plan with a shorter billing interval, the downgrade isn’t scheduled to occur at the period end, even though my configuration appears correct.
According to the Stripe documentation from October 2024:
"You can now configure the customer portal so that subscription downgrades occur at the end of the billing cycle, rather than immediately."
I’ve ensured my Stripe SDK is updated to the latest version as well.
JAVASCRIPTconst stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: '2024-12-18.acacia' }); const configuration = await stripe.billingPortal.configurations.create({ features: { payment_method_update: { enabled: true }, subscription_cancel: { enabled: true, mode: 'at_period_end' }, subscription_update: { enabled: true, proration_behavior: 'none', default_allowed_updates: ['price'], products: subscriptionUpdateProducts, schedule_at_period_end: { conditions: [ { type: 'shortening_interval' } // Schedule downgrades at period end (Not working) ] } }, invoice_history: { enabled: true } }, business_profile: { headline: 'Manage your subscription' } }); const session = await stripe.billingPortal.sessions.create({ customer: customerId, configuration: configuration.id, return_url: `${process.env.FRONTEND_URL}/app/price/price1` });
New subscription updated (with a per month schedule) but still charging immediately
Comments 0
•Answers 2
•Views 80
Answer by TychoAI Agent • 1 month ago
Based on the documentation, when you change a subscription’s billing interval (for example, switching from a longer to a shorter interval), Stripe applies immediate adjustments rather than scheduling the change at the end of the billing cycle. In your case, because you’re moving to a plan with a shorter interval, this counts as a billing interval change—which triggers an immediate charge with a prorated adjustment.
The scheduled downgrade behavior (using schedule_at_period_end with conditions like { type: 'shortening_interval' }) applies only when the change can be deferred to the period end. Since changing the billing interval is one of the exceptions noted in the docs, it’s expected that the update is processed immediately rather than deferred.
If you intend for changes to be scheduled for the period end, you might need to ensure that the upgrade/downgrade does not involve a billing interval change. Otherwise, the immediate charge behavior is by design.
For further adjustment, you may consider:
If you believe your configuration meets your intended use case without changing the interval, double-check that the target plan’s interval matches the current subscription’s interval. Otherwise, the behavior you’re observing is consistent with how Stripe handles interval changes.
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
Answer by VoidResearcher654 • 1 month ago
The issue was that I had three separate subscription products (e.g., one month, three months, and one year), and users were switching between them. However, for the billing portal to handle subscription updates correctly, the subscriptions need to be part of a single product with multiple pricing tiers.
The correct approach is to have a single subscription product with all pricing tiers (e.g., one month, three months, one year) associated with it. Users should be allowed to change prices within the same product. If a user changes to a different product, the billing portal will process the change immediately instead of applying the correct "schedule at period end" behavior.
No comments yet.
No comments yet.