Represents a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire, shoes, and accessories.
Collections can be defined by conditions, such as whether they match certain product tags. These are called smart or automated collections.
Collections can also be created for a custom group of products. These are called custom or manual collections.
Access Scopes
`read_products` access scope.
Fields
availablePublicationsCount:
Count -
The number of
[publications](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication)
that a resource is published to, without
[feedback errors](https://shopify.dev/docs/api/admin-graphql/latest/objects/ResourceFeedback).
description:
String! -
A single-line, text-only description of the collection, stripped of any HTML tags and formatting that were included in the description.
descriptionHtml:
HTML! -
The description of the collection, including any HTML tags and formatting. This content is typically displayed to customers, such as on an online store, depending on the theme.
feedback:
ResourceFeedback -
Information about the collection that's provided through resource feedback.
handle:
String! -
A unique string that identifies the collection. If a handle isn't specified when a collection is created, it's automatically generated from the collection's original title, and typically includes words from the title separated by hyphens. For example, a collection that was created with the title `Summer Catalog 2022` might have the handle `summer-catalog-2022`.
If the title is changed, the handle doesn't automatically change.
The handle can be used in themes by the Liquid templating language to refer to the collection, but using the ID is preferred because it never changes.
hasProduct:
Boolean! -
Whether the collection includes the specified product.
image:
Image -
The image associated with the collection.
legacyResourceId:
UnsignedInt64! -
The ID of the corresponding resource in the REST Admin API.
metafield:
Metafield -
A [custom field](https://shopify.dev/docs/apps/build/custom-data),
including its `namespace` and `key`, that's associated with a Shopify resource
for the purposes of adding and storing additional information.
privateMetafield:
PrivateMetafield -
Returns a private metafield by namespace and key that belongs to the resource.
productsCount:
Count -
The number of products in the collection.
publicationCount:
Int! -
The number of
[publications](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication)
that a resource is published to, without
[feedback errors](https://shopify.dev/docs/api/admin-graphql/latest/objects/ResourceFeedback).
publishedOnChannel:
Boolean! -
Whether the resource is published to a specific channel.
publishedOnCurrentChannel:
Boolean! -
Whether the resource is published to a
[channel](https://shopify.dev/docs/api/admin-graphql/latest/objects/Channel).
For example, the resource might be published to the online store channel.
publishedOnCurrentPublication:
Boolean! -
Whether the resource is published to the app's
[publication](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication).
For example, the resource might be published to the app's online store channel.
publishedOnPublication:
Boolean! -
Whether the resource is published to a specified
[publication](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication).
resourcePublicationsCount:
Count -
The number of
[publications](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication)
that a resource is published to, without
[feedback errors](https://shopify.dev/docs/api/admin-graphql/latest/objects/ResourceFeedback).
ruleSet:
CollectionRuleSet -
For a smart (automated) collection, specifies the rules that determine whether a product is included.
seo:
SEO! -
If the default SEO fields for page title and description have been modified, contains the modified information.
sortOrder:
CollectionSortOrder! -
The order in which the products in the collection are displayed by default in the Shopify admin and in sales channels, such as an online store.
storefrontId:
StorefrontID! -
The Storefront GraphQL API ID of the `Collection`.
As of the `2022-04` version release, the Storefront GraphQL API will no longer return Base64 encoded IDs to match the behavior of the Admin GraphQL API. Therefore, you can safely use the `id` field's value instead.
templateSuffix:
String -
The suffix of the Liquid template being used to show the collection in an online store. For example, if the value is `custom`, then the collection is using the `collection.custom.liquid` template. If the value is `null`, then the collection is using the default `collection.liquid` template.
title:
String! -
The name of the collection. It's displayed in the Shopify admin and is typically displayed in sales channels, such as an online store.
translations:
Translation! -
The published translations associated with the resource.
updatedAt:
DateTime! -
The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the collection was last modified.