---
title: "Get Invoice Document"
method: GET
path: "/api/finance/invoices/{invoice_id}/document"
tags: ["finance"]
---

# Get Invoice Document

`GET /api/finance/invoices/{invoice_id}/document`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/finance/invoices/{invoice_id}/document`
- Auth: none declared

Serves a PDF for one invoice -- the imported archive when one exists,
otherwise a fresh render matching v1's own invoice-pdf.ts byte-for-byte
(Frederick, 2026-08-03: "the PDFs need to match the PDFs of version
one... All the information that's on those PDFs needs to be there.").

Frederick, 2026-07-31: "I don't have the ability to download the
invoice PDF that is in v1 and not in v2." Diagnosed as two invoices in
one gap: the 178 Invoiced.com-imported documents (migrations/
0080_invoice_documents.sql) serve fine, but the other 37 -- including
every invoice the billing worker has generated since 2026-07-31 -- had
no document anywhere, because v1 never stored one either: it rendered
fresh via PDFKit (invoice-pdf.ts) on every request. This route ports
that behavior instead of only the archive.

IMPORTED ORIGINALS ALWAYS WIN, checked first: those 178 are the actual
bytes a customer received (an invoiced.com-branded document, not v1's
own template -- confirmed by their own varying per-invoice remittance
details, which a single generator reading one company_settings row
could never produce). Re-rendering over one would silently replace a
real historical document with a document nobody actually sent. Only an
invoice with NO archived row falls through to generation -- see
app/modules/finance/invoice_pdf.py for the generator itself and its
fidelity write-up.

## Path parameters

- `invoice_id` string, uuid, required

## Query parameters

- `download` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
