PDF Templates
List PDF Templates
Returns every global (non store-specific) PDF template.
Get PDF Template
Returns a single PDF template by ID, including its raw `content`, resolved `variables`, and `variables_tree`/`schema`.
Update PDF Template
Updates the `content` of a PDF template and snapshots the previous content as a new version.
Reset PDF Template to Default
Resets a PDF template back to its built-in default content and records the reset as a new version so the prior content can still be restored.
Preview PDF Template
Renders a preview of draft template content without saving it, using sample data.
Preview Packing Slip for a Sales Order
Renders the saved packing-slip template against a real sales order and returns a base64-encoded PDF in `data.pdf`.
List Sales Orders for Preview
Returns up to 20 recent sales orders (newest first) for use when picking a sample order to preview a packing slip against.
Validate PDF Template
Validates draft template content against the template type's schema without rendering it. Use this to surface unknown variables, unbalanced sections, and non-blocking warnings before saving.
List PDF Template Versions
Returns the change history for a template, newest first, as a paginated list. Each version captures the content at that point plus who changed it and why.
Get PDF Template Version
Returns a single template version by ID, including its full content snapshot.
Restore PDF Template Version
Restores a prior template version, replacing the template's current content with that version's snapshot and recording the previous content as a new version.
List Store Overrides
Returns every store-specific override for a given template type. A store override is a copy of the global template that a single store can customize independently.
Create Store Override
Creates a store-specific override from a global template. The override starts with the global template's content and can then be edited independently for that store.
Delete Store Override
Deletes a store-specific override. That store reverts to the global template of the same type.
List Template Assets
Returns every uploaded image asset available to templates. Reference an asset inside template content with its `token` (for example `{{{asset.company_logo}}}`), which renders as an inline image in the PDF.
Upload Template Asset
Uploads a new image asset for use in templates. Send the request as multipart/form-data.
Delete Template Asset
Deletes an uploaded image asset. Templates that reference the asset's token will no longer render its image.