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>'import requests
url = "https://clarus-api.com/api/templates/{id}/test"
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'X-Clarus-Subdomain': '<api-key>'}
};
fetch('https://clarus-api.com/api/templates/{id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "documents",
"attributes": {
"status": "queued",
"category": "<string>"
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Templates
Trigger test print
Generate a test print of the template to verify it renders correctly. Returns a document record with ‘queued’ status.
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>'import requests
url = "https://clarus-api.com/api/templates/{id}/test"
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'X-Clarus-Subdomain': '<api-key>'}
};
fetch('https://clarus-api.com/api/templates/{id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "documents",
"attributes": {
"status": "queued",
"category": "<string>"
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}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 withstatus: "queued". The PDF is generated asynchronously.
Downloading the Result
Once the document status changes tocompleted, use the Documents endpoints to download the generated PDF:
POST /documents/{id}/downloadto get a download URL
Error Cases
| Error | Description |
|---|---|
unsupported_template_type | The template’s type is not supported for test printing |
missing_template | No Liquid HTML attachment has been uploaded |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the template to test
Response
Test print queued successfully
Show child attributes
Show child attributes

