Admin GraphQL API2025-07
Create smart collections automatically with PRODUCT_CATEGORY_ID_WITH_DESCENDANTS
We've introduced a new column to the
. This field is used for automated collections and allows you to create smart collections based on a new category tree.
This rule type dynamically includes products in a smart collection based on their product category, as defined in the updated standard product taxonomy. When a specific product category is set as a condition, this rule will match products directly assigned to the specified category and include any products categorized under its descendants.
To create a smart collection using the new , follow this process:
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_WITH_DESCENDANTS",
"relation": "EQUALS",
"condition": "gid://shopify/TaxonomyCategory/aa-5"
}
}
}
}
Learn more about collection creation in collectionCreate.
Was this section helpful?