#noah_subscription-discounts-removed-webhooks

1 messages ยท Page 1 of 1 (latest)

warm acornBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

obtuse crown
#
  1. Don't really have any general guidance on this. It's highly dependent on your integration. If you share more details and ask something more specific I may be able to help.

  2. Likely these events aren't what you want. Are you applying discounts directly to the customer object? These will only be fired if so. If you apply them at Invoice or Subscription level, these events won't fire. The event descriptions detail when they're triggered.
    https://docs.stripe.com/api/events/types#event_types-customer.discount.created
    https://docs.stripe.com/api/events/types#event_types-customer.discount.deleted
    https://docs.stripe.com/api/events/types#event_types-customer.discount.updated

winter plinth
#

Can ignore the first question for now. These are subscription item level discounts. Are there no events that are fired for those?

obtuse crown
#

Depending on what you want to track I may be able to suggest alternatives

#

What specifically are you looking to track?

warm acornBOT
winter plinth
#

We'd like to know when they're removed from the subscription item either manually or via expiration

zenith helm
#

Hi ๐Ÿ‘‹

I'm stepping in as my colleague needs to go.

#

I think the best option for listening for removal of discounts from a Subscription object would be the customer.subscription.updated event.

#

This is fired every time a Subscription changes. To detect when a discount has been removed, you would check the previous_attributes property of the Event, which tells you what properties changed and what their previous value was.

winter plinth
#

And that event is fired when coupons expire?

zenith helm
#

The event fires every time something about the Subscription changes

winter plinth
#

Got it, thanks

#

Are you sure they aren't sent on the customer.discount.* events? I checked our dashboard and I am pretty sure we are receiving these events for discounts on subscription items (ex: evt_0RItql3MFIk84T3nwwoIvJVj)

zenith helm
#

I did not say they wouldn't show up in those events as well. But it sounded like you wanted to be aware of changes made to Subscriptions specifically so I wanted to call out that the customer.subscription.updated event would notify you of changes to a Subscription

#

But I see that the event you provided captures the removal of di_0R7Knj3MFIk84T3nCMARkcdF from the Subscription Item si_MtfnOkMt5xxQw7 for customer cus_L8f3IXMNr68jMN