Bulk download of expense attachments + invoice PDFs for the past month

Hello there,

My accountant has requested that I provide him with all the invoices +
expenses pdfs/pngs on the last day
of each month. I diligently upload images of all expenses, so they are
present as attachment, as for the invoices
I issue, they are of course present as PDFs.

If going the manual route using the web interface, this would require going
through a few clicks for each invoice,
and a few clicks for each expense. This does not scale very well as the
number of receipts and invoices grows.
And so I’m wondering if someone here knows how this can be done with the
API.

This would be a life saver for me.

Cheers
Stephane

Hi Stephane,

You’re in luck, we’ve recently added the ability to download invoice PDFs
via the API. This documentation should help:
https://dev.freeagent.com/docs/invoices#get-a-single-invoice-as-pdf

You can also download your uploaded attachment from your expenses.
Using the /v2/expenses endpoint, you can enumerate over all of your
expenses, each of which will contain an attachment element, for example:

“attachment”:

  •  {*
    
  •    "url":"https://api.freeagent.com/v2/attachments/3
    

https://api.freeagent.com/v2/attachments/3",*
“content_src”:“https://s3.amazonaws.com/freeagent-dev/attachments/1/original.png?AWSAccessKeyId=1K3MW21E6T8KWBY84B02&Expires=1314281186&Signature=GFAKDo%2Bi%2FsUMTYEgg6ZWGysB4k4%3D
https://s3.amazonaws.com/freeagent-dev/attachments/1/original.png?AWSAccessKeyId=1K3MW21E6T8KWBY84B02&Expires=1314281186&Signature=GFAKDo%2Bi%2FsUMTYEgg6ZWGysB4k4%3D”,*

  •    "content_type":"image/png",*
    
  •    "file_name":"barcode.png",*
    
  •    "file_size":7673*
    
  •  } *
    

Following the link to Amazon S3, you’ll be able to re-download your
uploaded attachment file.

I hope this helps!

Dave JOn 10 March 2016 at 09:45, Stephane Mikaty stephane@mikaty.net wrote:

Hello there,

My accountant has requested that I provide him with all the invoices +
expenses pdfs/pngs on the last day
of each month. I diligently upload images of all expenses, so they are
present as attachment, as for the invoices
I issue, they are of course present as PDFs.

If going the manual route using the web interface, this would require
going through a few clicks for each invoice,
and a few clicks for each expense. This does not scale very well as the
number of receipts and invoices grows.
And so I’m wondering if someone here knows how this can be done with the
API.

This would be a life saver for me.

Cheers
Stephane


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at https://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

David Jones
Support Engineering Team Lead

FreeAgent