#dicbra

1 messages ยท Page 1 of 1 (latest)

scenic stoneBOT
cold oxide
#

Hi ๐Ÿ‘‹ I recall this is a tricky scenario, but don't recall more details offhand and will need to take a couple minutes to review it.

vale quail
#

Sure, take ur time!

#

I'll BRB smoke 5 mins.

scenic stoneBOT
cold oxide
#

Thank you for your patience!

This is tricky, as what you're describing is currently expected behavior (I'll file feedback that you'd like to see an alternative offered).

To handle this without changing the billing period, you would likely want to:

  • Add the new Price as a new Subscription Item rather than updating the existing one
  • Stop reporting usage for the previous Subscription Item and only report usage for the new one
  • When the billing cycle changes and the Invoice is generated to charge for both of those items. then update the Subscription again and remove the original Subscription Item.
vale quail
#

Since I'm already using the customer.subscription.updated webhook event, how can I distinguish when the billing period ends and it's time to remove a subscription item that is no longer being used? Is there any specific data or event parameter that I can rely on to identify this scenario?

twin tiger
#

๐Ÿ‘‹ stepping in here as toby needs to step away

vale quail
#

๐Ÿ‘‹๐Ÿป

twin tiger
#

Yeah so there won't be anything specific -- you would want to track that on your end. One thing you could do is set metadata on the Sub to indicate it needs an update and that metadata come through on the next customer.subscription.updated Event

#

The other way to handle this scenario is to just create a new Invoice for the Subscription yourself and add an Invoice Item that is equal to the amount of the usage of the Price so that you charge immediately, then update the Subscription.

#

Since you are creating a new one-off Invoice, the billing cycle won't be affected

vale quail
#

so u mean I can create one-off invoice, pay for it and after that update sub item?

scenic stoneBOT
twin tiger
#

Yep

vale quail
#

TY boss!