Custom Template Associations
Associate a Stencil themeʼs custom templates with products, categories, brands, and pages.
Creating template associations
To create a template association, use the Upsert custom template associations endpoint
Entity IDs
The value of the entity ID is the ID property for the given entity. For example, a category entity ID is the id
property for the particular category object you want to act upon.
To get the entity IDs for categories, products, and brands, use the Get categories, Get products, and Get brands endpoints, respectively.
To get the entity ID for a page, use the Get pages endpoint.
Getting available templates
To get a list of available custom templates for each entity type, send a request to the Get all themes endpoint, then use the variation.uuid
property as the path parameter in a request to the Get custom templates endpoint.
To get the version UUID for an active theme, use the Get a channel active theme endpoint.
Resources
Get Custom Template Associations
GET https://api.bigcommerce.com/stores/{store_hash}/v3/storefront/custom-template-associationsRequest
Get a collection of the storeʼs custom template associations across all storefronts.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
example
Response
OK
Body
dataarray[object]
example-1
Upsert Custom Template Associations
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/storefront/custom-template-associationsRequest
Upsert new custom template associations data across all storefronts. If an existing record is found for the combination of channel ID, entity ID, and type, the existing record will be overwritten with the new template.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
Body
channel_idinteger
requiredentity_typestring
requiredAllowed: product | category | brand | page
entity_idinteger
requiredfile_namestring
required
example-1
Response
Success response for batch upsert of custom template associations
Body
example
Delete Custom Template Associations
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/storefront/custom-template-associationsRequest
Delete custom template associations. At least one query parameter must be used.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
example
Response
No Content