---
title: >-
  Create smart collections automatically with
  PRODUCT_CATEGORY_ID_WITH_DESCENDANTS - Shopify developer changelog
description: >-
  Shopify’s developer changelog documents all changes to Shopify’s platform.
  Find the latest news and learn about new platform opportunities.
source_url:
  html: >-
    https://shopify.dev/changelog/posts/introducing-productcategoryidwithdescendants-in-collectionrulecolumn-for-smart-collections
  md: >-
    https://shopify.dev/changelog/posts/introducing-productcategoryidwithdescendants-in-collectionrulecolumn-for-smart-collections.md
metadata:
  effectiveApiVersion: 2025-07
  affectedApi:
    - displayName: Admin GraphQL API
      handle: admin-graphql
  primaryTag:
    displayName: API
    handle: api
  secondaryTag:
    displayName: New
    handle: new
  indicatesActionRequired: false
  createdAt: '2025-04-04T13:11:36-04:00'
  postedAt: '2025-04-14T12:00:00-04:00'
  updatedAt: '2025-04-17T11:47:07-04:00'
  effectiveAt: '2025-04-14T12:00:00-04:00'
---

April 14, 2025

# Create smart collections automatically with PRODUCT\_CATEGORY\_ID\_WITH\_DESCENDANTS

DateApril 14, 2025

Version[2025-07](https://shopify.dev/changelog?api_version=2025-07)

FlagsNew

SurfacesAPI

Affected APIs[Admin GraphQL API](https://shopify.dev/changelog?api_type=admin-graphql)

We've introduced a new `PRODUCT_CATEGORY_ID_WITH_DESCENDANTS` column to the `CollectionRuleColumn`. This field is [used for automated collections](https://shopify.dev/docs/api/admin-graphql/unstable/enums/CollectionRuleColumn) 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](https://github.com/Shopify/product-taxonomy/tree/main). 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 `PRODUCT_CATEGORY_ID_WITH_DESCENDANTS`, 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](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionCreate).
