templates/options endpoint provides an interface for managing template options. Through this interface you can list all options defined in the template, retrieve and edit their settings, and read and save the values of individual options.
Options are defined in the template and then maintained in the Admin Interface or through this API. The definition itself (name, type, and constraints) is fixed by the template and cannot be changed through the API. How options are defined and read in the template is described in the Options document.
Supported methods
Specification of all supported methods.Data fields
Methods for template options
The following methods make it possible to list the defined options, read and edit their settings, and retrieve and save the values of individual options. Their use requires the appropriate read or write permissions for template data.GET templates/options
This method returns a list of all options defined in the template. Each entry contains the definition of the respective option (includingname, type, constraints, and attachTo) as well as the editable label and description.
The endpoint works like all other searchable API endpoints and supports filtering, sorting, and pagination.
Read permissions for template data are required.
Example
Response
Filter fields
name, type, attachTo
Sort fields
name, type
Error codes
GET templates/options/{name}
This method returns the settings of a single option by its name. Read permissions for template data are required.Example
Response
constraints.values is only present for options of type Enum.
Error codes
PUT templates/options/{name}
This method updates the settings of an option. Onlylabel and description can be changed. All other parameters are fixed by the definition in the template and cannot be changed through the API.
Write permissions for template data are required.
Example
Request Body
Response
Error codes
GET templates/options/{name}/value/{nodeId}
This method returns the maintained value of an option. The parameter{nodeId} is only required if attachTo was specified in the option’s definition. For global options (without attachTo) it is omitted.
Since the value is maintained per subshop, the URL should contain the subshopId parameter. If it is not provided, the first subshop of the shop is used.
Read permissions for template data are required.
Example
Response
Error codes
PUT templates/options/{name}/value/{nodeId}
This method saves the value of an option. The parameter{nodeId} is only required if attachTo was specified in the option’s definition. For global options (without attachTo) it is omitted.
Since the value is maintained per subshop, the URL should contain the subshopId parameter. If it is not provided, the first subshop of the shop is used.
Write permissions for template data are required.
