Skip to main content
POST
Preview a saved export template

Authorizations

Authorization
string
header
required

Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.

Path Parameters

exportTemplateId
integer
required

Export template ID.

Body

application/json

Preview request. document_id is always required. For the draft-preview endpoint (POST /export-templates/preview), type and fields are also required. For the saved-preview endpoint (POST /export-templates/{id}/preview), type/fields are ignored — they come from the saved template.

document_id
integer
required

ID of the live document to render against. Interpreted by template type — see the endpoint description.

Required range: x >= 1
Example:

12345

format
enum<string>
default:html

Output format. html returns JSON with rendered markup; pdf returns a PDF (binary, or base64 in JSON when Accept: application/json).

Available options:
html,
pdf
type
enum<string>

Template type. Required for draft preview (POST /export-templates/preview); ignored for saved preview.

Available options:
packing_slip,
supplier_purchase_order,
assembly_order,
invoice_pdf,
work_order,
production_run,
sales_order
fields
object

Raw template body (must be HTML render mode). Required for draft preview; ignored for saved preview.

Response

Rendered preview. JSON for html (or pdf with Accept: application/json); raw PDF bytes for pdf.

JSON preview result. html is present for format=html; pdf_base64 replaces it for format=pdf requested with Accept: application/json.

data
object