#abhishek_docs
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1423264435186831411
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
is your goal to update an existing Subscription? or create a new Subscription that you know will upgrade mid-cycle?
i want to update existing subscription with proration mid-cycle.
Scenario:
-
User has an active subscription: 10 mailboxes (monthly) + 2 domains (yearly)
-
User wants to upgrade mid-cycle: add 5 more mailboxes + 1 new domain
-
I need them to pay BEFORE the subscription updates (not after)
Checkout Sesison is only for creating brand new subscriptions, not updating them. but once you have a Subscription, then you can update it yes. This is explained here: https://docs.stripe.com/billing/subscriptions/change-price
the issue is that when I update the subscription per those docs:
stripe.subscriptions.update(subscriptionId, {
items: [
{ id: mailboxItemId, quantity: 15 }, // Update from 10 to 15
{ price: newDomainPriceId, quantity: 1 } // Add new domain
],
proration_behavior: "always_invoice"
})
The subscription updates immediately (user gets 15 mailboxes right away), and then invoices are created for them to pay later.
My problem: I need the opposite flow - payment first, then subscription update.
Is there a way to:
- Generate the prorated invoice WITHOUT updating the subscription yet
- User pays the invoice
- Subscription updates only after invoice.payment_succeeded webhook