Understanding attachments in accounting systems
Most accounting systems let users attach supporting documents (PDFs, scanned images, receipts) to their bookkeeping records — typically on invoices (sales / purchase entries) and on journal entries (G/L entries). How those files are exposed varies a lot between connectors:- Some providers return a direct download URL for each attachment.
- Others only signal that a document exists and require an additional API call to fetch the file content (returned as a base64-encoded string).
- A few connectors don’t expose attachment information at all.
attachments_info object and a single retrieval endpoint.
How Chift handles attachments
Every invoice and every journal entry returned by the Accounting API includes anattachments_info object that tells you what to expect:
Status values
| Status | Meaning |
|---|---|
yes | An attachment is directly accessible. Each entry in attachments contains a filename and a url you can download immediately. |
yes_to_request | An attachment exists but requires a separate API call to retrieve the file content. |
no | No attachment is linked to this entry. |
unknown | The connector does not support attachment detection for this provider. |
attachments_info.status first, then either download the URL directly or call the dedicated attachments endpoint.
Retrieving invoice attachments
Invoices returned by the following endpoints include theattachments_info object:
- Get invoices
- Get one invoice
- Get invoices (multiple analytic plans)
- Get one invoice (multiple analytic plans)
1. When status is yes
The attachments array contains one or more entries with a direct URL. You can download the file straight from that URL — no additional API call needed.
2. When status is yes_to_request
The attachments array may be empty — the status only signals that a file is available. To get the actual content, call the Get attachments endpoint with type=invoice:
base64_string on your end to reconstruct the original PDF or image file.
Connectors such as Odoo typically fall into the
yes_to_request category for invoices.Retrieving journal entry attachments
Journal entries follow the exact same pattern as invoices. Theattachments_info object is available on:
The only difference is the type query parameter you pass when status is yes_to_request. Use type=entry:
id and a base64_string.
End-to-end flow
A typical retrieval flow looks like this, regardless of whether you’re dealing with an invoice or a journal entry:- Fetch the document (invoice or journal entry) from the corresponding
GETendpoint. - Read
attachments_info.status. - Branch on the status:
yes→ download each file from theurlinattachments.yes_to_request→ callGET /consumers/{consumer_id}/accounting/attachmentswith the righttype(invoiceorentry) and thedocument_idof the record, then decodebase64_string.no→ no file to retrieve.unknown→ the connector does not expose attachment metadata; skip or surface this to the end user.