Check Past Invoice Activity via API


Please I am trying to go through past invoices to sort an issue. We recently discovered that updating a cancelled invoice via API re-opens it and sets it to ‘Paid’. Finance recently flagged this and we are trying to see what other invoices are involved.

With over 2000 paid invoices, this is a very herculean and boring task. I am unable to use the API to find affected invoices, that is, invoices that were cancelled, and later updated via API, and now reading as Paid.

Is there a way I can resolve this?


When using the API to load invoices you can add ?include=activities to the URL to load the activities for the invoice.

cc @david

I’d suggest iterating though all invoices using ?include=activities.

You’ll be search for any activities with an activity_type_id of 59 (cancelled) who also have another activity with a more recent timestamp of 5.

The download entity route will pull the.html file itself of the history of the invoice at that point in time.

Hi David,

Thanks for sharing.

Please where can I see a mapping for the activity_type_ids to know what the codes mean


Many thanks. I will run with this.