collectionCreate (Smart Collection) using Send Admin API

Topic summary

Goal: Create and publish smart collections (rule-based) via Shopify Flow using the Admin API’s collectionCreate when a product status changes; scale to hundreds of collections.

Problem: The API call creates a manual collection, does not apply rules, and does not publish the collection.

Details seen in payload: ruleSet was outside the input object (and misspelled/spaced as “ru leSet”); relation used “IS EQUAL TO” instead of the expected “EQUALS.” Images indicate a JSON parse error.

Advice/updates:

  • Test the mutation in GraphiQL first to catch syntax/validation errors.
  • Place ruleSet inside the input object with correct field names and values (e.g., relation: EQUALS; column: TAG).
  • Include userErrors in the mutation response to surface validation issues.

Status: No confirmation yet that the corrected mutation creates a smart collection or handles publishing. Publishing specifics were not addressed in the reply and remain an open item.

Summarized with AI on December 17. AI used: gpt-5.

Hello All

I am trying to create collection using collectionCreate mutation and I want to publish that collection as well

When product status is updated

{
“input”: {
“title”: “{{product.vendor}} Mens Shocks”,
“handle”: “{{ product.vendor | downcase }}-mens-shocks”
},
“ruleSet”: {
“appliedDisjunctively”: false,
“rules”: [
{
“column”: “TAG”,
“relation”: “IS EQUAL TO”,
“condition”: “{{product.vendor}} Mens Shocks”
}
]
}
}

When I use this it creates a manual collection and does not add the products to the collection or publish the collection

1 Like

I want to makes 100s collections using flow

Here is what I have done but when I used collectionCreate mutation using Send Admin API request

It creates a manual collection and rules provided in collectionCreate does not added when collection is created

1 Like

Try running the query in graphiql first. There was a parse error in your json input:

Also be sure to include userErrors in your query:

{
  "input": {
    "title": "Mens Shocks",
    "handle": "vendor-mens-shocks",
    "ruleSet": {
      "appliedDisjunctively": false,
      "rules": [
        {
          "column": "TAG",
          "relation": "EQUALS",
          "condition": "Mens Shocks"
        }
      ]
    }
  }
}