Invoices

Upload invoice PDF

Upload the original invoice PDF (max 10 MB). Provide exactly one of content (base64-encoded bytes) or url (a public HTTPS link we download once, at upload time). Both variants behave identically once accepted: we store our own copy of the bytes and never read the link again, so the document keeps serving even if your host later goes away, and an unreachable link fails this request outright rather than degrading for a customer later. Updates are push-only: we never re-read the link or poll for changes, so a PDF updated in your system is not reflected here until you send this request again — with fresh content, or with the url (the same url is fine; we re-download it at that moment). Each upload replaces the previous PDF; last write wins. Only invoices synced from an accounting integration accept a PDF: an invoice created through POST /invoices has no original document from your system, and returns 422 unsupported_invoice.

post/invoices/{id}/pdf

Path parameters

idstring required

Invoice ID

Request body

contentstring

The PDF document as standard base64 (RFC 4648). Must decode to a valid PDF (the file must start with the PDF header) of at most 10 MB. Mutually exclusive with url.

urlstring

A public, absolute HTTPS link to the PDF. Fetched exactly once, at upload time; we store our own copy and never read the link again — if the document behind it changes, re-send this request to publish the new version. HTTP links, redirects to non-HTTPS locations, and links resolving to private addresses are rejected. The response must be a PDF of at most 10 MB. Mutually exclusive with content.

Example request

{
  "content": "JVBERi0xLjcKJeLjz9MK...",
  "url": "https://billing.example.com/invoices/INV-1042.pdf"
}

Response

path is the stored location of the PDF, for both variants. It is an opaque identifier — retrieve the document via GET /invoices/{id}/pdf-link

pathstring

Path is the stored location of the PDF, for both the content and url variants. It is an opaque identifier, not a downloadable link — to retrieve the document, call GET /invoices/{id}/pdf-link for a signed URL.

Example response

{
  "path": "invoices/pdf/9c2f1e9a-INV-1042.pdf"
}