#joshualaba

1 messages ยท Page 1 of 1 (latest)

candid wadiBOT
gusty nova
#

Hello ๐Ÿ‘‹

#

Yes the invoice ID shouldn't change

silver slate
#

So i should expect the consume 2 Invoice objects with the same invoiceid, but with differing attempt_count right?

gusty nova
#

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

silver slate
#

If there is an update, it will be resent via the webhook?

candid wadiBOT
silver slate
#

Also, this means that the created field in this particular invoice never changes?

gusty nova
#

If there is an update, it will be resent via the webhook?
yes you'd receive invoice.updated event

Also, this means that the
created
field in this particular invoice never changes?
Correct.

#

Anything else I can help with @silver slate ?

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

gusty nova
#

correct

silver slate
#

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.

gusty nova
#

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

silver slate
#

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

gusty nova
#

yes

silver slate
#

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?

gusty nova
#

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 ๐Ÿ™‚

silver slate
#

sorry, the it you are referring to which field?

gusty nova
#

But yeah please try the flow out in test mode

silver slate
#

ahhh okay, this is really good. thanks a lot hanzo

#

thats all from me, have a good day

gusty nova
#

NP! ๐Ÿ™‚ Happy to help
Good luck