The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide.

Requires 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.

Was this section helpful?
#Endpoints

Properties

collection_id
deprecated
The ID of the custom collection containing the product.

created_at
deprecated
The date and time (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 first position is 1. 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 format) when the collect was last updated.

Was this section helpful?
{}The Collect resource
{
  "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"
}

Was this section helpful?
Was this section helpful?
post
/admin/api/2024-10/collects.json
Copy
curl -d '{"collect":{"product_id":921728736,"collection_id":841564295}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2024-10/collects.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
{}Response
JSON
HTTP/1.1 201 Created
{
  "collect": {
    "id": 1071559574,
    "collection_id": 841564295,
    "product_id": 921728736,
    "created_at": "2024-09-27T06:47:48-04:00",
    "updated_at": "2024-09-27T06:47:48-04:00",
    "position": 2,
    "sort_value": "0000000002"
  }
}

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.

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.

Was this section helpful?
Was this section helpful?
get
/admin/api/2024-10/collects.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/collects.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "collects": [
    {
      "id": 358268117,
      "collection_id": 482865238,
      "product_id": 632910392,
      "created_at": null,
      "updated_at": null,
      "position": 1,
      "sort_value": "0000000001"
    },
    {
      "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"
    },
    {
      "id": 800915878,
      "collection_id": 482865238,
      "product_id": 921728736,
      "created_at": null,
      "updated_at": null,
      "position": 1,
      "sort_value": "0000000001"
    }
  ]
}

Anchor to section titled 'GET request, Retrieves a specific collect by its ID'

get
Retrieves a specific collect by its ID
deprecated

Retrieves a specific collect by its ID.

api_version
string
required

collect_id
string
required

fields
Show only certain fields, specified by a comma-separated list of field names.

Was this section helpful?
Path parameters
collectid=455204334
string
required
Was this section helpful?
get
/admin/api/2024-10/collects/455204334.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/collects/455204334.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}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"
  }
}

Was this section helpful?
Was this section helpful?
get
/admin/api/2024-10/collects/count.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/collects/count.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "count": 2
}

Removes a product from a collection.

api_version
string
required

collect_id
string
required

Was this section helpful?
Was this section helpful?
del
/admin/api/2024-10/collects/455204334.json
Copy
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2024-10/collects/455204334.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{}