Make sure an invoice's document exists, rendering it if it does not. Use this when document_file_id (or receipt_document_file_id) on the invoice is empty, for example on an invoice that was imported without a document.
If the document already exists the call returns 200 with its file id, whatever the invoice's status. Otherwise it returns 202; retrieve the invoice until the file id is set. The call queues the render only when nothing else will: the invoice document of an imported invoice, or the receipt of an invoice that an import settled. For any other invoice the render was already queued when the invoice was finalised or paid, so the call queues nothing and the document arrives from that render. The call is safe to repeat.
Generating a document on request never sends a communication to the policyholder, whatever notification templates the organization has enabled. Use send invoice to deliver it.
A missing document is only rendered for an open, paid or refunded invoice, a missing receipt only for a paid one, and only when the policy's product module has an invoice template.
Invoicing is opt-in per organization: unless the invoicing feature flag is enabled for your organization this endpoint returns 403.
400The document is missing and cannot be rendered: the invoice is a draft, void or uncollectible invoice, a receipt was requested for an invoice that is not paid or for a credit note, or the policy's product module has no invoice template.
403Invoicing is not enabled for the organization, or the caller is missing the invoices:create permission.
404No such invoice, or the caller's user group does not grant access to its policy.