Developing on Invoiced

File Attachments

5min

Invoiced supports attaching files to invoices to give customers more context about a bill.

Usage

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.

1. Create a file

You can upload a file using our API or host your file somewhere publicly accessible.

To upload a local file, make the following request.

Curl


If your file is publicly hosted, make this request instead.

Curl
Java
PHP
Python
Ruby


2. Attach to an invoice

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:

Curl
Java
PHP
Python
Ruby


And the file is now attached! It will be available in the client view and dashboard as a downloadable attachment.

Retrieving attachments for an invoice

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.

Get a list of attachments for an invoice
GET
Request
Path Params
id
required
Integer
Invoice Id