presentCustom query parameter to specify which custom attributes to include in each request.
Consider the following example:

Importing templates
Templates are imported via their own endpoint in the Admin API. You can import up to five different templates. ThePUT endpoint replaces all existing templates with your import, while the POST endpoint will only add, update, or remove the templates listed in the import.
The template import uses dangerous import protection, so if your import were to remove an existing template it will fail, and you will be asked to redo the import with the header flag force=true.
Template format
Templates are imported in JSON format. They consist of an ID, product level settings, and variant level settings. The template format is based on the product data in Storefront query responses. They have a primary (first) product, which is the one the product card belongs to, and a remainder (rest) consisting of the other products within the product group. You can either use separate rules for the first and rest of the products listed in the response, or the same rules for all of them. The same goes for variant data on each product.
Consider the example below:
template1 and template2 respectively. While the content of template2 has been omitted for brevity, the first template is defined as follows:
- For the first product in each group, return the
title,link, andsellingPrice.- For all its variants, return their
labeland customcampaignattribute.
- For all its variants, return their
- For other products in the group, return only the
linkandswatchfields.- Include none of their variants.
first product refers to the main product to be rendered while the other products are alternatives or swatches (see the modeling guide). On the variant level, there is no “primary” variant. Therefore, it usually makes no sense to use first and rest on the variant level, as whichever variant is first in the response will be arbitrary. If you think there are variant fields that you don’t need repeated for each variant, consider whether it’s possible to raise them to the product level instead.
By using maxVariants you can specify how many variants should be included (at most) on each product. If you don’t display sizes on product cards you might want to set this to 0 for the first and/or the rest of the products, as in the example above. The variants block may be omitted if maxVariants is 0.
Available fields
You can include any field specified in the API response. See the Storefront specification for the full list. Custom attributes should be prefixed withcustom. Additionally, the special syntax custom.* can be used to include all custom fields on a product or variant (this includes any typed custom fields). To include specific typed custom attributes, use the following prefixes: custom.json., custom.length., and custom.number. Note that custom.json.* and so on is not supported.
Using templates
When you have imported a template, you can start applying it in Storefront queries by includingtemplateId as a query parameter with the template ID to use. It can be applied to all requests that return product listings and will apply to all lists returned (for example, applying to both a page’s primary list and recommendation lists). Note that on the product page, the template only applies to lists on the page and not to the main product the page belongs to: all of its fields will still be returned.
The following requests support templates:
- Add to cart popup
- Autocomplete
- Cart page
- Landing page
- Product page
- Search page
Template examples
The default when no template is specified, with no custom attributes
Limit information on swatches and variants, with all custom attributes

