Skip to main content
POST
Create a template

Request Structure

Required Fields

Optional Fields

All dimensions are in millimeters (mm).

Template Type Discovery

Default template type codes (IDs vary per tenant but codes are consistent): Actual template type IDs can be queried via GraphQL to find the ID for a given code.

Template Types and Liquid Variables

Each template type has access to different variables in Liquid templates. Top-level variables and their key nested properties:

dispatch_note

  • record - the goods out record (reference, created_at, status)
  • lines - goods out lines (product.code, product.description, quantity)
  • carrier - carrier details (name)
  • address - delivery address (address_1 through address_5, postcode, country_code)
  • account - stock account (name, code, address.*)
  • warehouse - warehouse (code, address.*)
  • customer - end customer (name, code)
  • subdomain - tenant info (currency.code, tax_rate.component_rate)
  • sales_order - linked sales order (reference)
  • total_weight - total weight of the shipment
  • products - product list with details

picking_note

  • goods_out_pick_list - pick list record (reference)
  • tasks - pick tasks (location, product, quantity)
  • carrier - carrier details
  • address - delivery address
  • account - stock account
  • warehouse - warehouse details
  • customer - end customer
  • subdomain - tenant info

commercial_invoice

  • shipment - shipment record (created_at)
  • packages - packages with dimensions.weight, stocks[].product.code/description/commodity_code/country_of_manufacture, stocks[].quantity, stocks[].dimensions.value/weight
  • account - stock account (name, address.*, gb_eori_number)
  • warehouse - warehouse (address.country_code)
  • subdomain - tenant info (currency.code, tax_rate.component_rate)
  • goods_out - outbound order (address.*)

invoice

  • record - invoice record
  • account - stock account
  • company - company details
  • lines - invoice lines

put_away_note

  • goods_in_receipt - receipt record
  • goods_in_receipt_lines - receipt lines
  • warehouse - warehouse details
  • account - stock account
  • supplier - supplier details
  • carrier - carrier details
  • subdomain - tenant info
  • tasks - put-away tasks

pre_receipt

  • goods_in_receipt - receipt record
  • account - stock account
  • warehouse - warehouse details
  • carrier - carrier details
  • supplier - supplier details
  • inbound_good_kind - type of inbound good
  • location - receiving location
  • lines - receipt lines

pre_pick_label

  • goods_out_pick_list - pick list record
  • goods_out - outbound order
  • product - product details

storage_unit_labels

  • stocks_lines[] - stock line records with: reference, product.code, product.description, goods_in_receipt, batch, account, location, confirmed_quantity, custom fields (boolean1-5, datetime1-5, integer1-5, string1-5)

pick_storage_unit_label

  • record - storage unit record
  • subdomain - tenant info (company details)

Liquid Template Syntax

Templates use Liquid syntax:

Workflow

  1. Create template - POST /templates with template_type_id and print parameters
  2. Upload Liquid HTML - POST /templates//attachment with your .html.liquid file
  3. Test print - PATCH /templates//test to generate a test PDF
  4. Download test - Use Documents endpoints (POST /documents//download) to retrieve the generated PDF
  5. Set as default - Optionally PATCH /templates/ with default: true

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Template created successfully

data
object