#bill92_webhooks

1 messages ยท Page 1 of 1 (latest)

neon groveBOT
#

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

bright flint
#

Hi there

modern linden
#

Sorry, I forgot to mention that I'm working with the invoice.paid event

bright flint
#

Just to be clear, what kind of email are you hoping to send?

modern linden
#

for sure, here it goes..

bright flint
#

Like, will there be a call to action for these customers or more like an FYI-type message?

modern linden
#

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

bright flint
#

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.

modern linden
#

listening to two events? but they are async and order is not guaranteed ๐Ÿค”

bright flint
#

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

modern linden
#

this is an event of invoice.paid where the billing_reason is subscription_update

bright flint
#

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?

modern linden
#

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

bright flint
#

Right, in that case I recommend retrieving the Subscription and comparing its details to what you have in your database to see what changed

neon groveBOT