Shopify Collections icon

Shopify Collections

Create and manage Shopify collections through the Admin GraphQL API

Collection → Create

AI-generated

Summary

Create a new Shopify collection as either a manual or smart collection by specifying its properties such as title, handle, description, sorting order, SEO details, image, metafields, and optionally smart collection rules. Optionally add products to manual collections and publish the collection immediately after creation.

Inputs

  • Collection Type — Choose 'manual' for collections with explicitly assigned products or 'smart' for rule-based collections.
  • Title (required) — The title of the collection.
  • Handle — Custom URL handle for the collection; leave empty to let Shopify auto-generate it.
  • Description HTML — HTML description for the collection.
  • Sort Order — Sorting order for products inside the collection.
  • Template Suffix — Theme template suffix to determine the collection's front-end template.
  • SEO Title — SEO title override for the collection.
  • SEO Description — SEO description override for the collection.
  • Image URL — Public URL for the collection's image.
  • Image Alt Text — Alternative text for the collection's image for accessibility and SEO.
  • Match Mode — For smart collections only, determines if all rules must match or any rule.
  • Rules JSON — For smart collections only, JSON array of rules defining the collection membership.
  • Metafields JSON — JSON array of metafields to attach to the collection.
  • Publish Immediately — Whether to publish the collection right after creation.
  • Publication IDs — IDs of publications to publish the collection to if publishing immediately.
  • Publish Date — Optional future date to publish the collection; supported only for online store channels.
  • Product IDs — For manual collections only, list of product IDs to include in the collection.
  • Return Full Response — Return the full raw Shopify GraphQL response instead of only the collection data.

Output shape

a single collection record

Returns the newly created collection object with detailed fields such as id, title, handle, descriptionHtml, sortOrder, SEO info, image details, rules for smart collections, and up to 20 metafields. If 'Return Full Response' is true, returns the entire Shopify GraphQL payload. Errors will throw exceptions; if 'Publish Immediately' is set with 'Publication IDs', the collection is published immediately after creation; for manual collections, specified products will be added to the collection automatically.

Links

Discussion