Skip to main content
PATCH
/
api
/
templates
/
{id}
/
test
Trigger test print
curl --request PATCH \
  --url https://clarus-api.com/api/templates/{id}/test \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Clarus-Subdomain: <api-key>'
{
  "data": {
    "id": 123,
    "type": "documents",
    "attributes": {
      "status": "queued",
      "category": "<string>"
    }
  }
}

Test Print

Triggers an asynchronous test print of the template. The system generates a PDF using sample data and returns a document record.

Prerequisites

  • The template must have a Liquid HTML attachment uploaded via POST /templates//attachment

Supported Template Types

picking_note, storage_unit_labels, pick_storage_unit_label, dispatch_note, pre_pick_label, invoice, put_away_note, pre_receipt, commercial_invoice

Response

Returns a document record with status: "queued". The PDF is generated asynchronously.

Downloading the Result

Once the document status changes to completed, use the Documents endpoints to download the generated PDF:
  • POST /documents/{id}/download to get a download URL

Error Cases

ErrorDescription
unsupported_template_typeThe template’s type is not supported for test printing
missing_templateNo Liquid HTML attachment has been uploaded

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.

Path Parameters

id
integer
required

The unique identifier of the template to test

Response

Test print queued successfully

data
object