#polar18_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/1229846297117327373
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! Hm... I'm not sure if this is possible, but let me look around a bit...
Hi! Thanks for taking a look
I could pass coupon, but won't that reset the line item discount's duration?
Yes, it would.
Thanks for confirming that option won't work
I think your best bet is to create a new coupon for the remaining time. For example, let's say you wanted the discount to apply for 30 days. If you want two 15 day phases in that time you'd need a second coupon for the 15 days of the second phase.
Unfortunately we're in a somewhat unique scenario where we don't create coupons in Stripe programatically due to some unique security requirements.
It sounds like it's currently not possible to either:
- Update an existing subscription item as part of a scheduled update
- Re-use an existing line item discount from a current subscription item
Do you think it'd be possible to add support for one of those options?
I can flag those as feature requests internally, but there's not currently a way to do either one right now in your current scenario. If you weren't switching to a new Price in the second phase it should work, but with the Price changing there's currently no way to force the existing Discount to be used in the second phase.
The other option would be to not use a Subscription Schedule for this and schedule the Subscription update on your end.
You could then update the Subscription directly, at the scheduled time, and specify the existing Subscription Item ID and carry over the existing Discount.
Understood on the current limitation, thanks. Flagging it as a feature request would be wonderful, is there a way I should reference it (request ID, ticket #, etc) in a follow up conversation I'll start with support from our Stripe account to follow along there?
Yeah, one sec, let me write it up.
Yep, we may need to look into something like that on our end. My primary concern was trying to schedule it to make sure it happens at approximately the same time as the recurring invoice so we can schedule downgrades and also avoid customers changing their subscription after the scheduled update
Thanks
Okay, you can reference FEEDBACK-36676. ๐
Thank you!
Happy to help! Good luck with it!
One thing I might try in your situation is to listen for invoice.created Events, and if I need to make a scheduled change, void the created Invoice immediately (before it exits draft status), update the Subscription, and make sure the update always produces a new Invoice.
That might get a bit wonky though...
Maybe listening for invoice.upcoming might be a better option.
Haha yeah, that was one of the alternatives we originally looked into. We were really hoping to avoid it since we lose a lot of the ideas of the recurring invoices, but might be our only choice
Yup also looked into invoice.upcoming, unfortunately I think the closest window to the new billing cycle is 3 days
Yep, it is.
There's not really a perfect solution in this case. The closest is creating the new Coupon to account for the new amount of time, but if you can't do that everything else I can think of gets way more complicated.
Yeah, totally understand - we've got a fairly funky integration at this point. I appreciate the brainstorming