Download documents attached to an expense with the API


As the title describes: Is it possible to download documents that are connected to an expense with the API? Like the $invoice->download() method.

Thanks in advance.

Kind regards,
Lars Jansen

Are you referring to the PHP SDK? The download method downloads the invoice PDF, not the attached documents.

You can use /api/v1/documents to get a list of all of the documents. With invoices you can use ?include=documents to get the documents, we’ll look into supporting this for expenses as well.

Thanks for the super fast answer.

I’m indeed referring to the PHP SDK because it is clearly documented for the invoice PDF, but I would like to get the attached document(s) of expenses.
So is this possible with /api/v1/documents?

I believe /api/v1/documents will return all documents in the account.

Awesome! I’ve created a pull request on the PHP SDK repository which adds that feature.

Thank you for the information.