Product Templates
Manage Product Templates
Retrieves all product templates. You can filter the results with query parameters.
A product template defines a set of attributes which are common for all product instances based on that template.
Required scopes
product.product_template_read
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.
The number of documents being retrieved on the page.
60
Fields to sort the response data by following order of the parameters from left to right.
Can contain multiple fields in format: field name:sort direction
separated by a comma.
The colon with sort direction
parameter is redundant and descending order is taken only if it is equal to desc
or DESC
.
Ascending order is considered in any other case.
While sorting by a localised field the following rule is taken into account:
- If a localized field contains information about a language then the language should be used. For example
name.en:ASC
. In that case en language will be used for sorting the name property. The language suffix takes precedence overAccept-Language
header. - If a localized field does not contain information about language then
Accept-Language
header will be used. For examplename:ASC
andAccept-Language: de
. In that case de will be used for sorting the name property - If a localized field does not contain information about language and
Accept-Language
header contains*
then default language from configuration service will be used as a language. For examplename:ASC
andAccept-Language: *
and default language is pl then pl will be used as a language for name property - If a localized field does not contains information about language and
Accept-Language
header does not exists in the request then default language from configuration service will be used. "
Standard query parameter used to search for specific values.
- Searching for an item by string property:
q=id:31065d5b-b62e
, whereid
is the field name and31065d5b-b62e
is its required value. - Searching for an item by localized field property:
q=name.en:T-s
wherename
is the name of the field,en
is a language code andT-s
is a required value of this field. This query works only for localized fields, which are stored in a Map format wherekey
is a language code andvalue
is translation to particular language. + Searching for items by date property. All numer-based property queries are valid also for dates. In that case the date should be placed within double quotes:q=metadata.createdAt:(>="2021-05-18T07:27:27.455Z" AND <"2021-05-20T07:27:27.455Z")
+ Searching for items with non existing or empty property:q=name.en:null
wherename.en
is a name of fields that has valuenull
. + Searching for items with existing property:q=attributes:exists
whereattributes
is a name of field that hasnon null
value. + Searching for items by multiple specific values:q=id:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494)
whereid
is name of field and strings within a bracket are it''s required value. + Searching for items by multiple fields:q=id:5c3325baa9812100098ff48f name.en:T-s
whereid
and ''name.en'' are the names of fields. All documents that contain given values of these fields are returned. Multiple fields separated by space can be specified. Multiple values for each field can be also specified in a format presented above. + Searching for items with string fields conforming to a regex:q=name.en:~ABCD12
orq=name.en:(~AB CD)
- in case of searching for strings with space, wherename
is the name of field andABCD12
orAB CD
is it''s querying regex.'
Flag indicating whether the total number of retrieved results should be returned.
The Accept-Language request HTTP header defines which languages the client is able to understand, and which locale variant is preferred. If empty, the default system language is assumed. It can be a priority list working as a fallback mechanism.
Creates a new product template.
A product template defines a set of attributes which are common for all product instances based on that template.
Required scopes
product.product_template_manage
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
The Content-Language request HTTP header defines a language or multiple languages of the request body.
- If the
Content-Language
header is set to*
, the localized fields should be provided as maps of translations, where the keys are language codes and values are the fields in their respective languages. - If the
Content-Language
header is set to a specific language, the localized fields should be provided as strings. - If the
Content-Language
header is empty, the endpoint will assume that the localized fields are provided in the default language or languages defined in the Configuration Service.
Note: You can provide the localized fields only in languages defined in the Configuration Service. In case the fields are provided in languages that are not defined in the Configuration Service, the request will be rejected.
Retrieves a specified product template's details.
A product template defines a set of attributes which are common for all product instances based on that template.
Required scopes
product.product_template_read
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Unique identifier of the product template.
Version of the product template. If the parameter is not provided, the latest version of product template is returned.
The Accept-Language request HTTP header defines which languages the client is able to understand, and which locale variant is preferred. If empty, the default system language is assumed. It can be a priority list working as a fallback mechanism.
Updates a specified product template by replacing all of its existing data with data from the request body.
Note: Every product template update creates a new version of the template. Products based on previous versions are not automatically updated. In order to see the changes (for example new attributes) on the product level, you need to update the template version in applicable products.
Required scopes
product.product_template_manage
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Unique identifier of the product template.
The Content-Language request HTTP header defines a language or multiple languages of the request body.
- If the
Content-Language
header is set to*
, the localized fields should be provided as maps of translations, where the keys are language codes and values are the fields in their respective languages. - If the
Content-Language
header is set to a specific language, the localized fields should be provided as strings. - If the
Content-Language
header is empty, the endpoint will assume that the localized fields are provided in the default language or languages defined in the Configuration Service.
Note: You can provide the localized fields only in languages defined in the Configuration Service. In case the fields are provided in languages that are not defined in the Configuration Service, the request will be rejected.
No content
Deletes a specified product template. Only product templates which are not used in products and parent variants can be deleted.
Required scopes
product.product_template_manage
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Unique identifier of the product template.
No content
Was this helpful?