#rick_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ 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/1229362393596035102
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
"evt_1P5ldeJzWQcP2dwT9ORvBBPK"
you shouldn't be listening to customer.subscription.created to fulfill your subscriptions
which webhook event would fulfill the same function?
I need to know when the subscription is first created AND payment was processed
successfully*
it seems other webhooks including payment success dont tell me if it's a new subscription. is that correct?
instead you need to listen to invoice.paid events
on the invoice.paid event object you have the billing_reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
when does billing_reason.subscription_update fire?
i see subscription_create and that might work for my use case
that you get on the invoice.paid event
i mean when will subscription_update be present as a property?
ive read in the docs that its when a subscription is no longer paused or something similar. when does a subscription pause?
is it present if they change the payment method? should i be checking for that property too? or just subscription_create?
you're asking too many questions that aren't really related
let me reiterate
first
instead of listening to the customer.subscription.created event, you listen to invoice.paid
the customer.subscription.created event sends a subscription object whereas invoice.paid sends an invoice object
on the invoice object you receive there's a property called billing_reason
if this property has a value of subscription_create this means that the first payment of a subscription has succeded
and you can now provide the subscription service to the customer
does that make sense?
yes, i got all that. im asking the other questions because they are follow ups to the original to make sure im using the webhook events correctly and checking for the proper use cases
i want to know when the property billing_reason.subscription_update is fired. the docs are not clear on what "a subscription was updated" means
not fired, present*
anytime you call subscription.update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and it results in an invoice
okay. and then i have a question regarding cancelled subscriptions
if their payment fails, i have billing set up in Stripe dashboard to cancel their subscription 1 day after 2 attempts to fulfill the payment.
should i be listening to customer.subscription.deleted? or is there a better way?
yes that's correct
i set it up this way because that one webhook seems to be able to handle failed payments AND manual cancellation via dashboard
okay. great. ill update my webhook code and test again. thanks for your help
for more references
thanks ill take a look