#joshualaba
1 messages ยท Page 1 of 1 (latest)
So i should expect the consume 2 Invoice objects with the same invoiceid, but with differing attempt_count right?
It should be the same invoice object as the before. We don't create a new invoice object for re-attempt.
Only the attempt_count increments
If there is an update, it will be resent via the webhook?
Also, this means that the created field in this particular invoice never changes?
If there is an update, it will be resent via the webhook?
yes you'd receiveinvoice.updatedevent
Also, this means that the
created
field in this particular invoice never changes?
Correct.
Anything else I can help with @silver slate ?
can u give me 1 moment
am i right to say that, when the invoice is created, it will be attempt_count = 0.
For attempt_count = 1 / attempt_count = 2, the event type will definitely be invoice.updated right no matter what
correct
attempted
boolean
Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users.
I got this from the api docs. Essentially this means when created attempted = false, count =0.
We'd also generate invoice.payment_failed event for payment failures
I got this from the api docs. Essentially this means when created attempted = false, count =0.
yes
We have great docs here that go over subscriptions <> webhook events
https://stripe.com/docs/billing/subscriptions/webhooks#events
https://stripe.com/docs/billing/subscriptions/webhooks#payment-failures
hmm.. on the invoice.payment_failed:
Essentially i have the following use case,
I want to get notified when the 1st charge fails
And the 2nd charge fails 12hrs later.
So it seems that the invoice.payment_failed will be more suitable
yes
Alright cool. So for my case I will attempt to charge the card on the Xth of every month. In that case, is it possible to retrieve this info(the actual attempted charge date) solely from the invoice.payment_failed event?
Or the only time related info I can retrieve is the created field in the invoice object?
You can retrieve it from invoice.payment_failed as it delivers invoice object as a payload
I'd recommend trying it out in test mode
that should answer most of your questions
and will allow you to understand the API much better ๐
sorry, the it you are referring to which field?
The charge parameter on the invoice should reflect the failed/declined charge (you'll need to expand it)
https://stripe.com/docs/api/invoices/object#invoice_object-charge
But yeah please try the flow out in test mode
ahhh okay, this is really good. thanks a lot hanzo
thats all from me, have a good day
NP! ๐ Happy to help
Good luck