Skip to main content
PUT
Update an 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

Create/update payload for an export template. On create, name, type, and fields are required. On update, send only the fields you intend to change.

fields keys must match the stored Manage shape for the chosen type — use the meta endpoints (/export-templates/types, /export-templates/authoring-guide, /export-templates/placeholders) to discover the shape and valid placeholders, and POST /export-templates/validate to dry-run before saving.

name
string
Maximum string length: 255
Example:

"AI Packing Slip"

type
enum<string>

Template type (immutable in practice — determines the fields shape).

Available options:
packing_slip,
supplier_purchase_order,
supplier_purchase_order_data,
assembly_order,
rfq,
invoice_pdf,
cost_layer,
receiving_report,
receiving_report_data,
work_order,
production_run,
production_run_data,
sales_order,
label_product,
label_lot,
label_location,
label_box,
label_pallet
Example:

"packing_slip"

fields
object

Raw template body — see the fields description on the export template schema.

For HTML-mode paged types set render_mode: "html" and supply page plus the body keys for the type's shape (four fragments vs. single html/css). For options mode set render_mode: "options" and supply contents.sections.

custom_fields
object[] | null

Tenant custom-field selections. Also accepted as customFields.

invoice_fields
object[] | null

Invoice-specific field selections. Also accepted as invoiceFields.

is_default_template
boolean | null

Set true to make this the default template for its type. Also accepted as isDefaultTemplate.

Example:

false

Response

Export template updated.

data
object

A PDF/HTML document export template (export_templates table). Metadata is snake_case; fields keys mirror the stored Manage shape so templates round-trip with the admin UI (render_mode, page, headerHtml, html, etc.).