#chongz_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1248001168076963931
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello
Have you seen https://docs.stripe.com/billing/subscriptions/webhooks yet?
That details the different Events here
You mostly want to use customer.subscription.updated and customer.subscription.deleted
Hey there! Thanks for the quick response - ah i see this looks like what i'm looking for.
As a follow-up is there an easy way to see what the expected payload for this would be? I'm assuming there would be a subscription ID somewhere in there that i could match on with the one I store in my DB (mine doesn't store any notion of the Stripe customer ID).
Yeah the payload will always be the complete Subscription object (https://docs.stripe.com/api/subscriptions/object) and it will also contain previous_attributes (see: https://docs.stripe.com/api/events/object#event_object-data-previous_attributes) which will indicate what has actually changed
Best thing to do though is to test this stuff out in test mode
You can use test clocks (https://docs.stripe.com/billing/testing/test-clocks) to help simulate the timing
Massive, that's all I needed. Thank you! ๐