#Becca

1 messages ยท Page 1 of 1 (latest)

static voidBOT
queen hull
#

HI there, if you want to get notified when an invoice is paid, you should listen to invoce.paid events

real silo
#

use case here is wanting to show a note on our subscriptions page if the user has an invoice they need to do something with, so was thinking invoice.updated status = paid marks this flag as false and open/uncollectible marks it as true

#

(like if a card is valid for subscription start but then at a later point for a renewal it's expired)

queen hull
#

Your use case looks like more about subscription. Perhaps you want to listen to subscription events instead? (i.e., customer.subscription.updated)

real silo
#

I am using customer.subscription.[created|deleted|updated] for managing what a user is currently subscribed to in our system, but thought invoice.updated would be more appropriate for this billing issue flag hrmm

#

(but yes, hosted checkout + subscriptions)

queen hull
real silo
#

hrmm. do those all not fire an invoice.updated as well? I assumed they would and thus could just listen to the 1 event instead of 4? (the 3 listed there for failure + invoice.paid)

#

lol I was gonna say that makes sense but deleted ๐Ÿ‘€

queen hull
#

Let me do a quick test to verify.

real silo
#

appreciate it!

queen hull
#

Correction -> you'll get a invoice.updated event when payment fails because the invoice's attempt_count property changes.

real silo
#

ah

queen hull
#

But you'll have hard time figuring out what triggers this invoice.updated event.

#

So my suggestion is to listen to the dedicated events instead of just invoice.updated

real silo
#

hmm ok bummer. since I just want to show a banner on our page basically telling the user "click here to go to the billing portal to resolve an issue" I was hoping listening just to 1 event would suffice

#

unfortunate

#

I wish there was documentation that compared events like these. the subscription webhooks page makes it seem like invoice.updated is perfectly acceptable so it's confusing reconciling that with guidance here (and makes me concerned about all the other things I've taken from the documentation lol)

pulsar rover
#

๐Ÿ‘‹ taking over, and I think invoice.updated could mean a lot many other things, link a small property changed, it doesn't necessary require your customer to do smth

real silo
#

right, I guess I didn't mention that I was going to use the event to look at the status and if open/uncollectible enable the flag and if open disable it.