Cannot use updated_at to import invoices into accounts package

Hi Hillel

I’ve been using updated_at in a curl call to download the json file with the invoices I need to import into our accounts package.

Today I hit a major issue which I cannot see a way round so your help would be much appreciated.

The system ran a number of recurring invoices in the early hours of the morning. Some old invoices were later updated with payments and then I ran the routine to import the recurring invoices from this morning into the accounts system.

Disaster - the act of marking old invoices as paid means that every invoice that has had any changes made to it since the previous accounts run is brought into the system because the updated_at value is reset (which makes sense).

What I need to use the created_at column/field but this isn’t in the json file (which ideally I could then use with curl) so I’m stuffed as far as I can see.

What have I missed?

With 100’s of invoices this is a mega problem!

[I’m self-hosting using v4.5.7]

Sorry, I’m not aware of a solution using the API.

Have you considered checking if the invoice has already been brought over in your script?

I was afraid of that :slight_smile: I’ll to do as you suggest

Thinking about it, I can cut down on the amount of processing that needs to be done by looking at balance and auto_bill in the json file.