#Michael Frost

1 messages · Page 1 of 1 (latest)

magic yoke
#

Michael Frost

robust vale
#

Hi @magic yoke!

#

I'm trying to keep track of subscription invoices in our own platform database.

#

At the moment we are still in test mode and listening to the webhooks. I get invoice.created, invoice.updated, invoice.payment_succeeded and invoice.paid only a couple of ms apart.

#

Our code should create or update an invoice record on our local database on these hooks.

magic yoke
#

It came as almost same time, right?

robust vale
#

Yes, and this is my problem: Since the create or update is async and it takes a couple of ms it creates a new local record.

magic yoke
#

Yeah unfortunately we can't guarantee the events order. It's a common ask. It’s possible that one request arrives before another one, even if they were created in the right order.

#

Normally we recommend you to handle this in the code gracefully, for example when receive an event, fetch the objects missing via the API