#msomji_api
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/1399837799238078575
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- msomji_api, 20 hours ago, 24 messages
Hello
So just to clarify, you're trying to prorate the discount when moving to the next phase based on the time that has already passed for the promo?
So let's say a user gets 3 months of discount applied today and schedules an update starting next month, you want 2 months % discount applied to the next phase?
If they schedule update after 2 months then 1 months' % discount to the next one? and so on..
in essence yes, I was hoping the proration would be managed by stripe since we define that when creating the promotion
If you update the subscription immediately, then yes - Stripe would handle the discount proration but I don't think we'll be able to do this when the upgrade/downgrade is scheduled at the period end
I see
Is there a way to use stripe to help determine how to prorate then? or is this something we'd have to manage independently?
You can use Create Preview API - https://docs.stripe.com/billing/subscriptions/prorations#preview-proration to get preview of the proration calculation for the subscription and then update the Subscription Schedule's phase accordingly.
But that wouldnt tell us that the existing applied promotion is on month 1/3 or 2/3 or 3/3 , it would just indicate that the promotion would be applied in the next month
Ah yup, that's correct - sorry about that. You'd need to look at past invoices for the customer and figure out what number of invoices have received the said discount already.
I think you can list using customer + subscription parameters - https://docs.stripe.com/api/invoices/list
I wonder if we can go about a more naive way -
We activate the 3 month promotion for the 3 month period, during which time we always continue to apply the promotion to the future phases, then at the end of the 3 months, we archive the promotion in stripe. I assume that when that last scheduled update gets applied, since the promotion at that time is deactivated, it would no longer be applied to the subscription even though it was defined in the schedule?
I'm not 100% sure if that'd work as I haven't tried it myself but you can give it a quick go in test mode to see how the API behaves.
I'm not sure what happens when you apply an archived promo code to a Subscription Schedule phase
Also while I have you can you help me understand what the difference between phase.discounts and phase.items.discounts is?
When we apply a promotion that give a % discount to certain products, it seems not to make a difference if we keep it at either level
maybe just the nature of the promotion since its already limited to the prouct from creation?