About this endpoint
What it does
Generates a preset receipt document from structured JSON input. The request contains receipt content and optional page/output settings, and the response returns render metadata plus the generated document payload in the declared output shape.
Request Body
| Parameter | Type | Description |
|---|---|---|
| data | Object | Receipt content. Contains the receipt fields below. |
| data.date | String | Receipt date/time. Max length 32. |
| data.items | Object Array | Line items for the receipt. Min 1, max 200 items. Each item includes description and unit_price as required fields; see data.items[] rows. |
| 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. Max length 500. |
| data.notes | String | Optional notes. Max length 4000. May also be null; default null. |
| data.number | String | Receipt number. Max length 64. |
| data.currency | String | Currency symbol or code used in the receipt. Default €. Max length 8. |
| data.customer | Object | Customer details. May also be null. Contains name as required; see data.customer.* rows. |
| data.customer.name | String | Customer name. Max length 200. |
| data.customer.email | String | Customer email. May also be null. Max length 200. |
| data.customer.phone | String | Customer phone. May also be null. Max length 64. |
| data.customer.tax_id | String | VAT / tax registration number. May also be null. Max length 64. |
| data.customer.address | String Array | Address lines. Max 8 lines. |
| data.merchant | Object | Merchant details. Contains name as required; see data.merchant.* rows. |
| data.merchant.name | String | Merchant name. Max length 200. |
| data.merchant.email | String | Merchant email. May also be null. Max length 200. |
| data.merchant.phone | String | Merchant phone. May also be null. Max length 64. |
| data.merchant.tax_id | String | VAT / tax registration number. May also be null. Max length 64. |
| data.merchant.address | String Array | Address lines. Max 8 lines. |
| data.payment_method | String | Payment method text. May also be null. Max length 64. |
| page | Object | Paper size and margins for PDF output. Contains the page options below. |
| 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 and docx return 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 metadata about the render and the generated output payload. The top-level fields are bytes integer, cache string, pages integer or null, engine string, format string, data_uri string, warnings string array, queued_ms integer, render_ms integer, media_type string, and engine_version 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 | Rendering engine identifier. |
| format | String | Output format. Allowed values: docx, pdf, html. |
| data_uri | String | data:<media_type>;base64,… payload. |
| warnings | String Array | Warning messages emitted during rendering. |
| 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 | Rendering engine version. |
Notes
The format request field defaults to json, but the output schema only declares docx, pdf, and html values for the returned format field. The schema also states that json requests return a PDF data URI plus metadata, so integrate against the response shape carefully rather than assuming the requested format is echoed back unchanged.



