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.
const 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`
});
Current subscription selected

New subscription updated (with a per month schedule) but still charging immediately
