Introducing PRODUCT_CATEGORY_ID in CollectionRuleColumn and Deprecating PRODUCT_TAXONOMY_NODE_ID for automated collection creation
As of API version 2024-10, we're adding the new PRODUCT_CATEGORY_ID as a column for the which is used to create automated collections. This field maps directly to the newly added Product Category as defined in the updated standard product taxonomy and will allow for the creation of smart collections based on this new category tree.
What's new?
- Introduction of
Column: We are introducing a new column,
, in the
. This column will directly map to the category ID of a product, allowing for more precise and efficient collection rule creation based on product categories as defined in the updated standard product taxonomy.
What's deprecated?
- Deprecation of
Column: The
column is being deprecated. This column previously used the now-deprecated
field on products, the previous method for categorising products before the updated standard product taxonomy was introduced this year. Developers should transition to using the new
column to ensure newly created products that necessarily use the updated product taxonomy are included in automated collections as expected.
Developer action required
Developers are encouraged to update their implementations to use the new column when specifying product attributes for populating smart collections. The deprecated
will remain functional but is scheduled for removal in a future API version. Transitioning early will ensure smoother operations and access to the enhanced functionality provided by the new schema.
Example of updated usage
To create a smart collection using the new , modify the collection creation mutation as follows:
mutation CollectionCreate($input: CollectionInput!) {
collectionCreate(input: $input) {
userErrors {
field
message
}
collection {
id
title
descriptionHtml
handle
sortOrder
ruleSet {
appliedDisjunctively
rules {
column
relation
condition
}
}
}
}
}
{
"input": {
"title": "Our entire shoe collection",
"descriptionHtml": "View <b>every</b> shoe available in our store.",
"ruleSet": {
"appliedDisjunctively": false,
"rules": {
"column": "PRODUCT_CATEGORY_ID",
"relation": "EQUALS",
"condition": "gid://shopify/TaxonomyCategory/aa-5"
}
}
}
}
Learn more about collection creation at Shopify.dev