#bill92_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/1308565894867452019
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- bill92_webhooks, 15 hours ago, 44 messages
- bill92_webhooks, 19 hours ago, 5 messages
- bill92_webhooks, 4 days ago, 25 messages
- bill_subscription-trial, 4 days ago, 20 messages
Hi there
Sorry, I forgot to mention that I'm working with the invoice.paid event
Just to be clear, what kind of email are you hoping to send?
for sure, here it goes..
Like, will there be a call to action for these customers or more like an FYI-type message?
FYI type messages
subscription_cycle: email will say "thanks for your business, we received your payment"
subscription_create welcome back to the saas, thanks for being here, we received your payment
this will happen when a subscription is canceled (whether it was on trial or not)
subscription_update: you upgraded from monthly to yearly, thanks, or vice versa
it looks like the tricky one could be dealing with the subscription_update one, since this is triggered when a subscription is updated on invoice.paid and the documentation only says that
Can you share more about subscription_update?
If you receive an invoice.paid event where billing_reason is subscription_update, I recommend also listening for customer.subscription.updated. You can inspect previous_attributes in the customer.subscription.updated payload for that particular Subscription to know what exactly changed on that Subscription to trigger the invoice.
listening to two events? but they are async and order is not guaranteed ๐ค
True
The other thing you can do is inspect the invoice.paid event then retrieve the parent Subscription at that point in time and compare it to the Subscription's details as they exist in your database
Yep, I'm familiar with this event format
So when you get an invoice.paid event with billing_reason: 'subscription_update', the next thing you'll want to know is what update specifically was made on that Subscription?
yes, if it changed from one price to another (monthly to annual, or annual to monthly) or if the user upgrade the subscription on their trial
Right, in that case I recommend retrieving the Subscription and comparing its details to what you have in your database to see what changed