Print templates

Print templates

Print template webhooks are emitted by the Accounts API when print templates are created, updated, or deleted.

Events

Action Event name
create a print template (POST /print-templates) printtemplates.created
create a sub print template (POST /sub-print-templates) printtemplates.created
update a print template (PUT /print-templates/:printTemplateId) printtemplates.updated
roll back to a version (PUT /print-templates/:printTemplateId/versions/:versionId) printtemplates.updated
delete a print template (DELETE /print-templates/:printTemplateId) printtemplates.deleted

Payload example (printtemplates.created / printtemplates.updated)

The data field contains the full print template object (same shape as the API response body printTemplate).

{
  "providerId": "5f243d100617680712e78dd7",
  "apiKey": "string",
  "data": {
    "_id": "5f243d100617680712e78dd7",
    "accountId": "5f243d100617680712e78dd7",
    "name": "string",
    "type": "product",
    "channel": "backoffice",
    "consumer": "printer",
    "format": "default",
    "status": "published",
    "templateCollectionId": "default",
    "productFamily": "ticket",
    "productId": "string",
    "mainTemplateId": "string",
    "mainTemplateAccountId": "string",
    "createdBy": "string",
    "updatedBy": "string",
    "createdAt": {"offset": "int", "value": "string"},
    "updatedAt": {"offset": "int", "value": "string"},
    "versions": []
  }
}

Payload fields (printtemplates.created / printtemplates.updated)

Field Type Description
providerId string Account ID of the provider that owns the template (24-character hex ObjectId)
apiKey string API key used for the request (X-API-KEY header)
data object The print template document. See GET /print-templates/:printTemplateId response; structure depends on type (product, invoice, order, etc.)

Payload example (printtemplates.deleted)

{
  "providerId": "5f243d100617680712e78dd7",
  "apiKey": "string",
  "data": {
    "printTemplateId": "5f243d100617680712e78dd7"
  }
}

Payload fields (printtemplates.deleted)

Field Type Description
providerId string Account ID of the provider (24-character hex ObjectId)
apiKey string API key used for the request (X-API-KEY header)
data.printTemplateId string The ID of the deleted print template (24-character hex ObjectId)