#Tailor

1 messages ยท Page 1 of 1 (latest)

storm krakenBOT
frail copper
#

Hi ๐Ÿ‘‹ I'm only seeing one customer.subscription.updated event being triggered for your account, and it was generated before the request you shared. Have you taken any action to simulate that type of event since setting up the webhook endpoint?

pulsar wave
#

I have a customer, where I tried to subscribe and unsubscribe. These actions are successful, so the subscription state should change from "active" to "canceled" as far as I understand

frail copper
#

Can you share the ID of the Subscription that you used to try to trigger those events?

pulsar wave
#

I hope this is the ID that you're looking for: prod_MT6YYp3HXWex0f

frail copper
#

That's the id of a Product, so not quite what I was looking for. Subscription IDs start with sub_.

Looking at recent requests on your account, you seem to be canceling Subscriptions without making any other changes, so I believe it is expected to not be getting customer.subscription.updated events. Instead, your actions are triggering customer.subscription.deleted events, like this one:
https://dashboard.stripe.com/test/events/evt_1M4RKuK8ZNDCJlfOkChZwSEA

pulsar wave
#

oh, I see. so I should probably cancel the subscriptions in another way

frail copper
#

It'd probably be a better test if you updated the Subscription instead of trying to cancel it, unless you're specifically testing what events are generated when you cancel Subscriptions.

pulsar wave
#

What im trying to do is send confirmation emails to customers when they cancel their subscription

frail copper
#

Are you planning to allow your customers to schedule cancelations to occur in the future in addition to allowing them to cancel immediately? Or are you planning to only support one of those flows?

pulsar wave
#

Since its a usage based subscription, I let the customers cancel immediately

#

okay, I just tried setting the customers subscription from "trialing" to "active" and the endpoint got triggered ๐Ÿ™‚

#

so its not working only with the cancellation

frail copper
#

Gotcha, if you're doing immediate cancellation, then instead of changing how you cancel you may want to expand the events that your endpoint listens for to include customer.subscription.deleted

pulsar wave
#

that's a great hint as well, it helps a lot too

#

thanks a lot for your suggestions

frail copper
#

Happy to help! Best of luck with your project.

pulsar wave
#

thank you ๐Ÿ™‚