--- title: Collection - Storefront API description: | A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. api_version: 2025-10 api_name: storefront type: object api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/objects/collection md: https://shopify.dev/docs/api/storefront/latest/objects/collection.md --- # Collection object Requires `unauthenticated_read_product_listings` access scope. A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. ## Fields * description [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null Stripped description of the collection, single line with HTML tags removed. * truncate​At [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int) ### Arguments Truncates a string after the given length. *** * description​Html [HTML!](https://shopify.dev/docs/api/storefront/latest/scalars/HTML) non-null The description of the collection, complete with HTML formatting. * handle [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null A human-friendly unique string for the collection automatically generated from its title. Limit of 255 characters. * id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) non-null A globally-unique ID. * image [Image](https://shopify.dev/docs/api/storefront/latest/objects/Image) Image associated with the collection. * metafield [Metafield](https://shopify.dev/docs/api/storefront/latest/objects/Metafield) Token access required 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. * namespace [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) ### Arguments The container the metafield belongs to. If omitted, the app-reserved namespace will be used. * key [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required The identifier for the metafield. *** * metafields [\[Metafield\]!](https://shopify.dev/docs/api/storefront/latest/objects/Metafield) non-null Token access required A list of [custom fields](https://shopify.dev/docs/apps/build/custom-data) that a merchant associates with a Shopify resource. * identifiers [\[Has​Metafields​Identifier!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/HasMetafieldsIdentifier) required ### Arguments The list of metafields to retrieve by namespace and key. The input must not contain more than `250` values. *** * online​Store​Url [URL](https://shopify.dev/docs/api/storefront/latest/scalars/URL) The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is currently not published to the Online Store sales channel. * products [Product​Connection!](https://shopify.dev/docs/api/storefront/latest/connections/ProductConnection) non-null List of products in the collection. * first [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int) ### Arguments Returns up to the first `n` elements from the list. * after [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) Returns the elements that come after the specified cursor. * last [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int) Returns up to the last `n` elements from the list. * before [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) Returns the elements that come before the specified cursor. * reverse [Boolean](https://shopify.dev/docs/api/storefront/latest/scalars/Boolean) Default:false Reverse the order of the underlying list. * sort​Key [Product​Collection​Sort​Keys](https://shopify.dev/docs/api/storefront/latest/enums/ProductCollectionSortKeys) Default:COLLECTION\_DEFAULT Sort the underlying list by the given key. * filters [\[Product​Filter!\]](https://shopify.dev/docs/api/storefront/latest/input-objects/ProductFilter) Returns a subset of products matching all product filters. The input must not contain more than `250` values. *** * seo [SEO!](https://shopify.dev/docs/api/storefront/latest/objects/SEO) non-null The collection's SEO information. * title [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null The collection’s name. Limit of 255 characters. * tracking​Parameters [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) URL parameters to be added to a page URL to track the origin of on-site search traffic for [analytics reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/default-reports/behaviour-reports). Returns a result when accessed through the [search](https://shopify.dev/docs/api/storefront/current/queries/search) or [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) queries, otherwise returns null. * updated​At [Date​Time!](https://shopify.dev/docs/api/storefront/latest/scalars/DateTime) non-null The date and time when the collection was last modified. *** ## Map ### Fields and connections with this object * <->[CollectionConnection.nodes](https://shopify.dev/docs/api/storefront/latest/connections/CollectionConnection#returns-nodes) * {}[CollectionEdge.node](https://shopify.dev/docs/api/storefront/latest/objects/CollectionEdge#field-CollectionEdge.fields.node) * {}[PredictiveSearchResult.collections](https://shopify.dev/docs/api/storefront/latest/objects/PredictiveSearchResult#field-PredictiveSearchResult.fields.collections) * {}[Product.collections](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-Product.fields.collections) ### Possible type in * [Menu​Item​Resource](https://shopify.dev/docs/api/storefront/latest/unions/MenuItemResource) * [Metafield​Parent​Resource](https://shopify.dev/docs/api/storefront/latest/unions/MetafieldParentResource) * [Metafield​Reference](https://shopify.dev/docs/api/storefront/latest/unions/MetafieldReference) *** ## Queries * [collection](https://shopify.dev/docs/api/storefront/latest/queries/collection) query Fetch a specific `Collection` by one of its unique attributes. * id [ID](https://shopify.dev/docs/api/storefront/latest/scalars/ID) ### Arguments The ID of the `Collection`. * handle [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) The handle of the `Collection`. *** * [collections](https://shopify.dev/docs/api/storefront/latest/queries/collections) query List of the shop’s collections. * first [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int) ### Arguments Returns up to the first `n` elements from the list. * after [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) Returns the elements that come after the specified cursor. * last [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int) Returns up to the last `n` elements from the list. * before [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) Returns the elements that come before the specified cursor. * reverse [Boolean](https://shopify.dev/docs/api/storefront/latest/scalars/Boolean) Default:false Reverse the order of the underlying list. * sort​Key [Collection​Sort​Keys](https://shopify.dev/docs/api/storefront/latest/enums/CollectionSortKeys) Default:ID Sort the underlying list by the given key. * query [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) Apply one or multiple filters to the query. Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more information about using filters. * collection\_type * title * updated\_at *** * [collection​By​Handle](https://shopify.dev/docs/api/storefront/latest/queries/collectionByHandle) query Deprecated * handle [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required ### Arguments The handle of the collection. *** *** ## \Collection Queries ### Queried by * \[collection](https://shopify.dev/docs/api/storefront/latest/queries/collection) * \[collections](https://shopify.dev/docs/api/storefront/latest/queries/collections) *** ## Interfaces * * [Has​Metafields](https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields) interface * [Node](https://shopify.dev/docs/api/storefront/latest/interfaces/Node) interface * [Online​Store​Publishable](https://shopify.dev/docs/api/storefront/latest/interfaces/OnlineStorePublishable) interface * [Trackable](https://shopify.dev/docs/api/storefront/latest/interfaces/Trackable) interface *** ## ||-Collection Implements ### Implements * ||-[Has​Metafields](https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields) * ||-[Node](https://shopify.dev/docs/api/storefront/latest/interfaces/Node) * ||-[Online​Store​Publishable](https://shopify.dev/docs/api/storefront/latest/interfaces/OnlineStorePublishable) * ||-[Trackable](https://shopify.dev/docs/api/storefront/latest/interfaces/Trackable)