#rick_webhooks

1 messages ยท Page 1 of 1 (latest)

covert mirageBOT
#

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

river plankBOT
pseudo frigate
#

๐Ÿ‘‹ happy to help

#

would you mind sharing the event ID?

rotund smelt
#

"evt_1P5ldeJzWQcP2dwT9ORvBBPK"

pseudo frigate
#

you shouldn't be listening to customer.subscription.created to fulfill your subscriptions

rotund smelt
#

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?

pseudo frigate
#

instead you need to listen to invoice.paid events

#

on the invoice.paid event object you have the billing_reason

rotund smelt
#

when does billing_reason.subscription_update fire?

pseudo frigate
#

no this is not an event

#

this a property on the invoice object

rotund smelt
#

i see subscription_create and that might work for my use case

pseudo frigate
#

that you get on the invoice.paid event

rotund smelt
#

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?

pseudo frigate
#

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?

rotund smelt
#

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*

pseudo frigate
#

anytime you call subscription.update

#

and it results in an invoice

rotund smelt
#

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?

pseudo frigate
#

yes that's correct

rotund smelt
#

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

pseudo frigate
#

for more references

rotund smelt
#

thanks ill take a look