/templates endpoint provides an interface for managing template compilation in the shop system. Through this interface you can start the compilation process, query the current progress and status, and view a list of past compilation results.
In addition, you can determine how many steps are required for the full compilation process.
Supported methods
List of all supported methods.Data fields for template compilation
Example
Methods for template compilation
The following methods let you start the template compilation process, monitor its progress, and view past compilation results.GET templates/results
This method gives you access to a list of previous template compilation runs. Each entry contains information about status, duration, the number of errors and warnings as well as the subshops and users involved. The results can be filtered and sorted to analyze specific compilation runs. To use this endpoint, the corresponding permissions to read template data must be available.Example
Response
Filter fields
createdAt, duration, errorCount, warningCount, user, subshopId
Sort fields
createdAt, duration, durationMillis, errorCount, warningCount, subshopId, status
Error codes
GET templates/compilationSteps
This method returns the total number of compilation steps performed when building the templates. Each template file is assigned a fixed three-step sequence: translating, parsing and linking. Therefore the response returns the number of files × 3. To use this endpoint, the corresponding permissions to read template data must be available.Example
Response
In this example 4 templates were processed, and each compilation run consists of 3 steps (translating, parsing, linking), which results in 12 steps in total.Error codes
GET templates/compile
This method returns the current status of the running compilation process. As long as the compilation is not yet finished, the response contains information about progress. After completion, the endpoint additionally returns details about any warnings or errors. The status query refers to a single subshop. For shops with several subshops, the desired subshop must be specified via thesubshopId parameter in the request; without this specification, the default subshop is used. For shops with several subshops, GET templates/compile must be called separately for each subshop.
To use this method, the corresponding permissions to read template data must be available.
Example
Response (compilation not yet finished)
Response (compilation finished)
Error codes
POST templates/compile
This method starts the compilation and publication of all templates. The current text snippets are taken into account and embedded into the templates. The compilation refers to a single subshop. For shops with several subshops, the desired subshop must be specified via thesubshopId parameter in the request; without this specification, the default subshop is used. For shops with several subshops, POST templates/compile must be called separately for each subshop.
To trigger this operation, the corresponding permissions to publish template data must be available.
