About this endpoint
What it does
Generates a preset invoice document from JSON invoice data. You can choose the output format and page options, and the response returns render metadata plus the rendered document information.
Request Body
| Parameter | Type | Description |
|---|---|---|
| data | Object | Invoice content. |
| data.date | String | Issue date, any display format. |
| data.number | String | Invoice number. |
| data.seller | Object | Seller party details. |
| data.seller.name | String | Seller name. |
| data.seller.email | String | Seller email address. |
| data.seller.phone | String | Seller phone number. |
| data.seller.tax_id | String | VAT / tax registration number. |
| data.seller.address | String Array | Address lines. Maximum 8 items. |
| data.buyer | Object | Buyer party details. |
| data.buyer.name | String | Buyer name. |
| data.buyer.email | String | Buyer email address. |
| data.buyer.phone | String | Buyer phone number. |
| data.buyer.tax_id | String | VAT / tax registration number. |
| data.buyer.address | String Array | Address lines. Maximum 8 items. |
| data.items | Object Array | Line items. Minimum 1 item, maximum 200 items. |
| data.items[].quantity | Number | Quantity. Default: 1. Minimum 0, maximum 1000000. |
| data.items[].tax_rate | Number | Percent applied to this line. Default: 0. Minimum 0, maximum 100. |
| data.items[].unit_price | Number | Unit price. Minimum -1000000000, maximum 1000000000. |
| data.items[].description | String | Line item description. Maximum length 500. |
| data.notes | String | Additional notes. Maximum length 4000. |
| data.title | String | Document title. Default: Invoice. Maximum length 64. |
| data.currency | String | Symbol or code printed before amounts. Default: €. Maximum length 8. |
| data.due_date | String | Due date. |
| data.logo_base64 | String | PNG/JPEG logo, base64. Maximum length 2800000. Intended for payloads up to 2 MiB. |
| page | Object | Paper size and margins for PDF output. |
| page.size | ENUM | Paper size. Allowed values: A4, Letter, Legal, A3, A5. Default: A4. |
| page.margin_mm | Number | Uniform page margin in millimetres. Default: 18. Minimum 0, maximum 50. |
| page.orientation | ENUM | Page orientation. Allowed values: portrait, landscape. Default: portrait. |
| format | ENUM | Output format. Allowed values: json, html, pdf, docx. Default: json. The schema notes that pdf, html or docx return the bytes, while json returns a PDF data URI plus metadata. |
| download | Boolean | Send Content-Disposition: attachment so browsers save the file. Default: false. |
Response
Returns a JSON object with render metadata and output details. The object includes bytes as an integer, cache as a string, pages as an integer or null, engine as a string, format as a string, data_uri as a string, warnings as an array of strings, queued_ms as an integer, render_ms as an integer, media_type as a string, and engine_version as a string.
| Parameter | Type | Description |
|---|---|---|
| bytes | Integer | Output size in bytes. |
| cache | String | Cache result. Allowed values: hit, miss. |
| pages | Integer | PDF page count. Nullable; null for DOCX/HTML. |
| engine | String | Render engine name. |
| format | String | Output format. Allowed values: docx, pdf, html. |
| data_uri | String | data:<media_type>;base64,… |
| warnings | String Array | Warning messages returned by the renderer. |
| queued_ms | Integer | Time spent queued, in milliseconds. |
| render_ms | Integer | Time spent rendering, in milliseconds. |
| media_type | String | Media type of the rendered output. |
| engine_version | String | Renderer version. |



