Documents and attachments

BILL enables you to upload documents for bills. In addition, you can upload supporting attachments for vendors, customers, and invoices. In this section, we explain uploading a vendor attachment and downloading a vendor attachment.



The vendor attachment, customer attachment, invoice attachment, and bill document API operations are similar. See the /v3/attachments and /v3/documents API for more information.

Uploading a vendor attachment

In your POST /v3/attachments/vendors/{vendorId} request, set the required fields.

vendorIdBILL-generated ID of the vendor. The value begins with 009.
nameFile name with extension. For example, to upload a PDF attachment titled business_details, set name as business_details.pdf.
fileAttachment file. See Supported file formats in the BILL Help Center for more information.

Sample request

In this cURL example, an attachment file is uploaded for a vendor.

curl --request POST \
--url '{baseUrl}/connect/v3/attachments/vendors/{vendorId}?name={file_name}' \
--header 'devKey: {developer_key}' \
--header 'sessionId: {session_id}' \
--header 'accept: application/json' \
--header 'content-type: */*' \
--data-binary '@{filepath}'


In the response, an attachment id is available. The value begins with att. In addition, downloadLink is the generated URL for downloading the attachment. Use the URL in a GET request to download the attachment.




When you upload an attachment, it takes a few minutes for BILL to complete the upload process and to generate a preview of the attachment. The download process will be successful only after the upload process is complete.

Download an attachment

In this cURL example, an attachment is downloaded. In the request, downloadLink is set from the upload attachment response.

curl '{downloadLink}&sessionId={session_id}' \
--output {attachment_name}