Documents API
Generate, check, download, preview, and deliver invoice documents.
Document endpoints turn receivable state into client-ready invoice output. Regenerate a PDF after invoice content or template changes. Treat download URLs as short-lived credentials.
/v1/receivables/documentsEndpoints and Schemas
| Method | Path | Request schema | Success response |
|---|---|---|---|
POST | /pdf/generate | GeneratePDFRequest | GeneratePDFResponse |
POST | /pdf/batch | BatchGeneratePDFRequest | BatchGeneratePDFResponse |
GET | /pdf/{invoiceId}/status | none | PDFStatusResponse |
GET | /pdf/{invoiceId}/download | none | DownloadUrlResponse |
GET | /preview/{invoiceId} | none | PreviewResponse |
POST | /pdf/{invoiceId}/regenerate | none | RegeneratePDFResponse |
POST | /email | EmailInvoiceRequest | EmailInvoiceResponse |
POST | /email/schedule | ScheduleEmailRequest | ScheduleEmailResponse |
PDF Generation
{
"invoiceId": "550e8400-e29b-41d4-a716-446655440000",
"regenerate": false
}regenerate defaults to false, and the API can then return a document that exists. The response shows if a PDF already existed. It includes invoiceId, invoiceNumber, filePath, and generation time when available.
Batch generation accepts 1–50 invoiceIds. Check each entry in results. A successful batch response does not mean that every requested document got a file path.
Status and Downloads
PDF status is ready or not_generated. The download response returns a pre-signed downloadUrl and expiresAt. Do not persist the URL as a permanent document identifier, send it to analytics, or show it to a different organization. Request a new URL after expiration.
Email Delivery Request
| Field | Type | Needed | Constraints |
|---|---|---|---|
invoiceId | UUID string | yes | Invoice to deliver. |
recipientEmail | email string | yes | Primary recipient. |
cc | email array | no | Maximum 10 addresses. |
bcc | email array | no | Maximum 10 addresses. |
subject | string | no | Maximum 500 characters. |
body | string | no | Maximum 5,000 characters. |
attachPDF | boolean | no | Defaults to true. |
scheduledFor | ISO 8601 date-time | schedule only | Must represent future delivery time. |
{
"invoiceId": "550e8400-e29b-41d4-a716-446655440000",
"recipientEmail": "[email protected]",
"subject": "Invoice INV-0042",
"body": "Please find the invoice attached.",
"attachPDF": true
}Email operations can create external side effects. Disable duplicate submission. Show the final recipients and subject before you send. Do not retry an interrupted request blindly.