#polar18_api

1 messages ยท Page 1 of 1 (latest)

ornate totemBOT
#

๐Ÿ‘‹ 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.

maiden robinBOT
hasty river
#

Hello! Hm... I'm not sure if this is possible, but let me look around a bit...

vestal brook
#

Hi! Thanks for taking a look

hasty river
#

I could pass coupon, but won't that reset the line item discount's duration?
Yes, it would.

vestal brook
#

Thanks for confirming that option won't work

hasty river
#

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.

vestal brook
#

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:

  1. Update an existing subscription item as part of a scheduled update
  2. 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?

hasty river
#

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.

vestal brook
#

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?

hasty river
#

Yeah, one sec, let me write it up.

vestal brook
#

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

hasty river
#

Okay, you can reference FEEDBACK-36676. ๐Ÿ™‚

vestal brook
#

Thank you!

hasty river
#

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.

vestal brook
#

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

vestal brook
#

Yup also looked into invoice.upcoming, unfortunately I think the closest window to the new billing cycle is 3 days

hasty river
#

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.

vestal brook
#

Yeah, totally understand - we've got a fairly funky integration at this point. I appreciate the brainstorming