Invoiced supports attaching files to invoices to give customers more context about a bill.
Files can be attached to invoices through the dashboard or programmatically through the API. In this guide, we will walk you through the complete steps to attach a file to an invoice through the API.
You can upload a file using our API or host your file somewhere publicly accessible.
To upload a local file, make the following request.
If your file is publicly hosted, make this request instead.
Once you have created your file, you can attach it to an invoice. This is done by passing in an array of file IDs through the attachments parameter when creating or editing an invoice.
In this example, we are going to show how to attach a single file when creating a new invoice:
And the file is now attached! It will be available in the client view and dashboard as a downloadable attachment.
You can also retrieve the existing file attachments for an invoice with a simple API query. This might be useful to synchronize the attachments for an invoice with your internal systems.