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. For details and migration steps, visit our migration guide.
Collect
products
access scope.The Collect resource connects a product to a custom collection.

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 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 resource.
Endpoints
- post/admin/api/latest/collects.
json Adds a product to a custom collection - get/admin/api/latest/collects.
json Retrieves a list of collects - get/admin/api/latest/collects/{collect_
id}. json Retrieves a specific collect by its IDdeprecated - get/admin/api/latest/collects/count.
json Retrieves a count of collects - del/admin/api/latest/collects/{collect_
id}. json Removes a product from a collection
The Collect resource
Properties
The ID of the custom collection containing the product.
The date and time (ISO 8601 format) when the collect was created.
A unique numeric identifier for the collect.
The position of this product in a manually sorted custom collection. The first position is 1. This value is applied only when the custom collection is sorted manually.
The unique numeric identifier for the product in the custom collection.
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.
The date and time (ISO 8601 format) when the collect was last updated.
The Collect resource
Anchor to POST request, Adds a product to a custom collectionpostAdds a product to a custom collection
Adds a product to a custom collection.
Anchor to post-collects-examplesExamples
Create a new link between an existing product and an existing collection
Create a new link between an existing product and an existing collection
Show collect properties
The unique numeric identifier for the product in the custom collection.
The ID of the custom collection containing the product.
Creating a collect without a product or collection ID fails and returns an error
Creating a collect without a product or collection ID fails and returns an error
/admin/api/2025-07/collects. json
Response
examples
Create a new link between an existing product and an existing collection
curl -d '{"collect":{"product_id":921728736,"collection_id":841564295}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-07/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json"
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, });
# 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!
// 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
HTTP/1.1 201 Created{"collect":{"id":1071559576,"collection_id":841564295,"product_id":921728736,"created_at":"2025-07-01T14:43:01-04:00","updated_at":"2025-07-01T14:43:01-04:00","position":2,"sort_value":"0000000002"}}
Creating a collect without a product or collection ID fails and returns an error
curl -d '{"collect":{"body":"foobar"}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-07/collects.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json"
const { admin, session } = await authenticate.admin(request); const collect = new admin.rest.resources.Collect({session: session}); collect.body = "foobar"; await collect.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session collect = ShopifyAPI::Collect.new(session: test_session) collect.body = "foobar" collect.save!
// Session is built by the OAuth process const collect = new shopify.rest.Collect({session: session}); collect.body = "foobar"; await collect.save({ update: true, });
response
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"]}}
Anchor to GET request, Retrieves a list of collectsgetRetrieves a list of collects
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.
Show only certain fields, specified by a comma-separated list of field names.
The maximum number of results to show.
Restrict results to after the specified ID.
Anchor to get-collects-examplesExamples
Retrieve all collects for the shop
Retrieve all collects for the shop
Retrieve only collects for a certain collection
Retrieve only collects for a certain collection
The ID of the custom collection containing the product.
Retrieve only collects for a certain product
Retrieve only collects for a certain product
The unique numeric identifier for the product in the custom collection.
/admin/api/2025-07/collects. json
Response
examples
Retrieve all collects for the shop
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.all({ session: session, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.all( session: test_session, )
// Session is built by the OAuth process await shopify.rest.Collect.all({ session: session, });
response
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 -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects.json?collection_id=841564295" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.all({ session: session, collection_id: "841564295", });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.all( session: test_session, collection_id: "841564295", )
// Session is built by the OAuth process await shopify.rest.Collect.all({ session: session, collection_id: "841564295", });
response
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":1071559578,"collection_id":841564295,"product_id":921728736,"created_at":"2025-07-01T14:43:10-04:00","updated_at":"2025-07-01T14:43:10-04:00","position":2,"sort_value":"0000000002"}]}
Retrieve only collects for a certain product
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects.json?product_id=632910392" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.all({ session: session, product_id: "632910392", });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.all( session: test_session, product_id: "632910392", )
// Session is built by the OAuth process await shopify.rest.Collect.all({ session: session, product_id: "632910392", });
response
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"}]}
Anchor to GET request, Retrieves a specific collect by its IDgetRetrieves a specific collect by its ID deprecated
Retrieves a specific collect by its ID.
Show only certain fields, specified by a comma-separated list of field names.
Retrieve a collect with a certain ID
Retrieve a collect with a certain ID
/admin/api/2025-07/collects/455204334. json
Response
examples
Retrieve a collect with a certain ID
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects/455204334.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.find({ session: session, id: 455204334, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.find( session: test_session, id: 455204334, )
// Session is built by the OAuth process await shopify.rest.Collect.find({ session: session, id: 455204334, });
response
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"}}
Anchor to GET request, Retrieves a count of collectsgetRetrieves a count of collects
Retrieves a count of collects.
Count all collects for the shop
Count all collects for the shop
Count only collects for a certain collection
Count only collects for a certain collection
The ID of the custom collection containing the product.
Count only collects for a certain product
Count only collects for a certain product
The unique numeric identifier for the product in the custom collection.
/admin/api/2025-07/collects/count. json
Response
examples
Count all collects for the shop
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects/count.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.count({ session: session, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.count( session: test_session, )
// Session is built by the OAuth process await shopify.rest.Collect.count({ session: session, });
response
HTTP/1.1 200 OK{"count":2}
Count only collects for a certain collection
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects/count.json?collection_id=841564295" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.count({ session: session, collection_id: "841564295", });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.count( session: test_session, collection_id: "841564295", )
// Session is built by the OAuth process await shopify.rest.Collect.count({ session: session, collection_id: "841564295", });
response
HTTP/1.1 200 OK{"count":1}
Count only collects for a certain product
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/collects/count.json?product_id=632910392" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.count({ session: session, product_id: "632910392", });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.count( session: test_session, product_id: "632910392", )
// Session is built by the OAuth process await shopify.rest.Collect.count({ session: session, product_id: "632910392", });
response
HTTP/1.1 200 OK{"count":2}
Anchor to DELETE request, Removes a product from a collectiondelRemoves a product from a collection
Removes a product from a collection.
Delete the link between a product an a collection
Delete the link between a product an a collection
/admin/api/2025-07/collects/455204334. json
Response
examples
Delete the link between a product an a collection
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-07/collects/455204334.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.Collect.delete({ session: session, id: 455204334, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Collect.delete( session: test_session, id: 455204334, )
// Session is built by the OAuth process await shopify.rest.Collect.delete({ session: session, id: 455204334, });
response
HTTP/1.1 200 OK{}