--- title: Collect description: After creating a custom collection, add products to it by creating a collect for each product. Each collect associates one product with one custom collection. api_version: 2025-10 api_name: admin-rest api_type: rest source_url: html: https://shopify.dev/docs/api/admin-rest/latest/resources/collect md: https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md --- ![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg) The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). # Collect Requires `products` access scope. The Collect resource connects a product to a custom collection. ![](https://shopify.dev/assets/api/reference/collect.png) Collects are meant for managing the relationship between products and custom collections. For every product in a custom collection there is a collect that tracks the ID of both the product and the custom collection. A product can be in more than one collection, and will have a collect connecting it to each collection. Unlike many Shopify resources, collects aren't apparent to store owners. Collects are for placing products in custom collections only. [Smart collections](https://shopify.dev/docs/admin-api/rest/reference/products/smartcollection) use rules to determine which products are their members. Creating a collect that links a product to a smart collection results in a **403 Forbidden** error. For more information on custom collections, see the [CustomCollection](https://shopify.dev/docs/admin-api/rest/reference/products/customcollection) resource. \# ## Endpoints * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#post-collects) [/admin/api/latest/collects.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#post-collects) Adds a product to a custom collection [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionAddProducts?example=adds-a-product-to-a-custom-collection) [collectionAddProducts](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionAddProducts?example=adds-a-product-to-a-custom-collection) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#get-collects) [/admin/api/latest/collects.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#get-collects) Retrieves a list of collects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) [collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/product) [product](https://shopify.dev/docs/api/admin-graphql/latest/queries/product) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#get-collects-collect-id) [/admin/api/latest/collects/{collect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#get-collects-collect-id) Retrieves a specific collect by its ID deprecated * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#get-collects-count) [/admin/api/latest/collects/count.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#get-collects-count) Retrieves a count of collects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) [collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) * [del](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#delete-collects-collect-id) [/admin/api/latest/collects/{collect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect#delete-collects-collect-id) Removes a product from a collection [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionRemoveProducts?example=removes-a-product-from-a-collection) [collectionRemoveProducts](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionRemoveProducts?example=removes-a-product-from-a-collection) *** ## The Collect resource ### Properties *** collection\_id deprecated The ID of the custom collection containing the product. *** created\_at deprecated The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the collect was created. *** id deprecated A unique numeric identifier for the collect. *** position deprecated The position of this product in a manually sorted custom collection. The positions are not guaranteed to be consecutive. This value is applied only when the custom collection is sorted manually. *** product\_id deprecated The unique numeric identifier for the product in the custom collection. *** sort\_value deprecated This is the same value as `position` but padded with leading zeroes to make it alphanumeric-sortable. This value is applied only when the custom collection is sorted manually. *** updated\_at deprecated The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the collect was last updated. *** {} ## The Collect resource ```json { "collection_id": 841564295, "created_at": "2018-04-25T13:51:12-04:00", "id": 841564295, "position": 2, "product_id": 632910392, "sort_value": "0000000002", "updated_at": "2018-04-25T13:51:12-04:00" } ``` *** ## postAdds a product to a custom collection [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionAddProducts?example=adds-a-product-to-a-custom-collection) [collectionAddProducts](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionAddProducts?example=adds-a-product-to-a-custom-collection) Adds a product to a custom collection. ### Parameters *** api\_version string required *** ### Examples Create a new link between an existing product and an existing collection Request body collect​ Collect resource Show collect properties collect.product\_​id:​921728736 deprecated The unique numeric identifier for the product in the custom collection. collect.collection\_​id:​841564295 deprecated The ID of the custom collection containing the product. Creating a collect without a product or collection ID fails and returns an error post ## /admin/api/2025-10/collects.​json ```bash curl -d '{"collect":{"product_id":921728736,"collection_id":841564295}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 201 Created { "collect": { "id": 1071559574, "collection_id": 841564295, "product_id": 921728736, "created_at": "2025-10-01T15:07:14-04:00", "updated_at": "2025-10-01T15:07:14-04:00", "position": 2, "sort_value": "0000000002" } } ``` ### examples * #### Create a new link between an existing product and an existing collection ##### ```curl curl -d '{"collect":{"product_id":921728736,"collection_id":841564295}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const collect = new admin.rest.resources.Collect({session: session}); collect.product_id = 921728736; collect.collection_id = 841564295; await collect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session collect = ShopifyAPI::Collect.new(session: test_session) collect.product_id = 921728736 collect.collection_id = 841564295 collect.save! ``` ##### ```node // Session is built by the OAuth process const collect = new shopify.rest.Collect({session: session}); collect.product_id = 921728736; collect.collection_id = 841564295; await collect.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"collect":{"id":1071559574,"collection_id":841564295,"product_id":921728736,"created_at":"2025-10-01T15:07:14-04:00","updated_at":"2025-10-01T15:07:14-04:00","position":2,"sort_value":"0000000002"}} ``` * #### Creating a collect without a product or collection ID fails and returns an error ##### ```curl curl -d '{"collect":{"body":"foobar"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const collect = new admin.rest.resources.Collect({session: session}); collect.body = "foobar"; await collect.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session collect = ShopifyAPI::Collect.new(session: test_session) collect.body = "foobar" collect.save! ``` ##### ```node // Session is built by the OAuth process const collect = new shopify.rest.Collect({session: session}); collect.body = "foobar"; await collect.save({ update: true, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity{"errors":{"product":["can't be blank"],"collection":["can't be blank"],"product_id":["must belong to John Smith Test Store"],"collection_id":["must belong to John Smith Test Store"]}} ``` *** ## getRetrieves a list of collects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) [collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/product) [product](https://shopify.dev/docs/api/admin-graphql/latest/queries/product) Retrieves a list of collects. **Note:** This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to [Make paginated requests to the REST Admin API](https://shopify.dev/api/usage/pagination-rest). ### Parameters *** api\_version string required *** fields Show only certain fields, specified by a comma-separated list of field names. *** limit ≤ 250 default 50 The maximum number of results to show. *** since\_id Restrict results to after the specified ID. *** ### Examples Retrieve all collects for the shop Retrieve only collects for a certain collection Query parameters collection\_​id=​841564295 The ID of the custom collection containing the product. Retrieve only collects for a certain product Query parameters product\_​id=​632910392 The unique numeric identifier for the product in the custom collection. get ## /admin/api/2025-10/collects.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "collects": [ { "id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001" }, { "id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001" } ] } ``` ### examples * #### Retrieve all collects for the shop ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.all({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.all( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.all({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"collects":[{"id":455204334,"collection_id":841564295,"product_id":632910392,"created_at":null,"updated_at":null,"position":1,"sort_value":"0000000001"},{"id":773559378,"collection_id":395646240,"product_id":632910392,"created_at":null,"updated_at":null,"position":1,"sort_value":"0000000001"}]} ``` * #### Retrieve only collects for a certain collection ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json?collection_id=841564295" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.all({ session: session, collection_id: "841564295", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.all( session: test_session, collection_id: "841564295", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.all({ session: session, collection_id: "841564295", }); ``` #### response ```json HTTP/1.1 200 OK{"collects":[{"id":455204334,"collection_id":841564295,"product_id":632910392,"created_at":null,"updated_at":null,"position":1,"sort_value":"0000000001"},{"id":1071559575,"collection_id":841564295,"product_id":921728736,"created_at":"2025-10-01T15:07:15-04:00","updated_at":"2025-10-01T15:07:15-04:00","position":2,"sort_value":"0000000002"}]} ``` * #### Retrieve only collects for a certain product ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects.json?product_id=632910392" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.all({ session: session, product_id: "632910392", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.all( session: test_session, product_id: "632910392", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.all({ session: session, product_id: "632910392", }); ``` #### response ```json HTTP/1.1 200 OK{"collects":[{"id":455204334,"collection_id":841564295,"product_id":632910392,"created_at":null,"updated_at":null,"position":1,"sort_value":"0000000001"},{"id":773559378,"collection_id":395646240,"product_id":632910392,"created_at":null,"updated_at":null,"position":1,"sort_value":"0000000001"}]} ``` *** ## getRetrieves a specific collect by its IDdeprecated Retrieves a specific collect by its ID. ### Parameters *** api\_version string required *** collect\_id string required *** fields Show only certain fields, specified by a comma-separated list of field names. *** ### Examples Retrieve a collect with a certain ID Path parameters collect\_​id=​455204334 string required get ## /admin/api/2025-10/collects/455204334.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects/455204334.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "collect": { "id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001" } } ``` ### examples * #### Retrieve a collect with a certain ID ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects/455204334.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.find({ session: session, id: 455204334, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.find( session: test_session, id: 455204334, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.find({ session: session, id: 455204334, }); ``` #### response ```json HTTP/1.1 200 OK{"collect":{"id":455204334,"collection_id":841564295,"product_id":632910392,"created_at":null,"updated_at":null,"position":1,"sort_value":"0000000001"}} ``` *** ## getRetrieves a count of collects [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) [collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection) Retrieves a count of collects. ### Parameters *** api\_version string required *** ### Examples Count all collects for the shop Count only collects for a certain collection Query parameters collection\_​id=​841564295 The ID of the custom collection containing the product. Count only collects for a certain product Query parameters product\_​id=​632910392 The unique numeric identifier for the product in the custom collection. get ## /admin/api/2025-10/collects/count.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "count": 2 } ``` ### examples * #### Count all collects for the shop ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.count({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.count( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.count({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"count":2} ``` * #### Count only collects for a certain collection ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects/count.json?collection_id=841564295" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.count({ session: session, collection_id: "841564295", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.count( session: test_session, collection_id: "841564295", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.count({ session: session, collection_id: "841564295", }); ``` #### response ```json HTTP/1.1 200 OK{"count":1} ``` * #### Count only collects for a certain product ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/collects/count.json?product_id=632910392" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.count({ session: session, product_id: "632910392", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.count( session: test_session, product_id: "632910392", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.count({ session: session, product_id: "632910392", }); ``` #### response ```json HTTP/1.1 200 OK{"count":2} ``` *** ## delRemoves a product from a collection [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionRemoveProducts?example=removes-a-product-from-a-collection) [collectionRemoveProducts](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionRemoveProducts?example=removes-a-product-from-a-collection) Removes a product from a collection. ### Parameters *** api\_version string required *** collect\_id string required *** ### Examples Delete the link between a product an a collection Path parameters collect\_​id=​455204334 string required del ## /admin/api/2025-10/collects/455204334.​json ```bash curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/collects/455204334.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK {} ``` ### examples * #### Delete the link between a product an a collection ##### ```curl curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/collects/455204334.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Collect.delete({ session: session, id: 455204334, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.delete( session: test_session, id: 455204334, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Collect.delete({ session: session, id: 455204334, }); ``` #### response ```json HTTP/1.1 200 OK{} ```