---
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: 2026-07
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'
api_name: admin-rest
api_type: rest
---

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.md#post-collects)

  [/admin/api/latest/collects.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#post-collects)

  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.md#get-collects)

  [/admin/api/latest/collects.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#get-collects)

  Retrieves a list of collects

  [collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection)

  [product](https://shopify.dev/docs/api/admin-graphql/latest/queries/product)

* [get](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#get-collects-collect-id)

  [/admin/api/latest/collects/{collect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#get-collects-collect-id)

  Retrieves a specific collect by its ID

  **deprecated**

* [get](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#get-collects-count)

  [/admin/api/latest/collects/count.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#get-collects-count)

  Retrieves a count of collects

  [collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection)

* [del](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#delete-collects-collect-id)

  [/admin/api/latest/collects/{collect\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/collect.md#delete-collects-collect-id)

  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

[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**

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/2026-07/collects.​json

```bash
curl -d '{"collect":{"product_id":921728736,"collection_id":841564295}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2026-07/collects.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
```

{}

## Response

JSON

```json
HTTP/1.1 201 Created
{
  "collect": {
    "id": 1071559582,
    "collection_id": 841564295,
    "product_id": 921728736,
    "created_at": "2026-07-01T12:18:43-04:00",
    "updated_at": "2026-07-01T12:18:43-04:00",
    "position": 1044982312524966,
    "sort_value": "1044982312524966"
  }
}
```

### 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/2026-07/collects.json" \
  -H "X-Shopify-Access-Token: {access_token}" \
  -H "Content-Type: application/json"
  ```

  #### response

  ```json
  HTTP/1.1 201 Created{"collect":{"id":1071559582,"collection_id":841564295,"product_id":921728736,"created_at":"2026-07-01T12:18:43-04:00","updated_at":"2026-07-01T12:18:43-04:00","position":1044982312524966,"sort_value":"1044982312524966"}}
  ```

* #### 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/2026-07/collects.json" \
  -H "X-Shopify-Access-Token: {access_token}" \
  -H "Content-Type: application/json"
  ```

  #### response

  ```json
  HTTP/1.1 422 Unprocessable Entity{"errors":{"product":["can't be blank"],"collection":["can't be blank"],"product_id":["is invalid"],"collection_id":["is invalid"]}}
  ```

***

## getRetrieves a list of collects

[collection](https://shopify.dev/docs/api/admin-graphql/latest/queries/collection)

[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/2026-07/collects.​json

```bash
curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/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": 1044616696680960,
      "sort_value": "1044616696680960"
    },
    {
      "id": 773559378,
      "collection_id": 395646240,
      "product_id": 632910392,
      "created_at": null,
      "updated_at": null,
      "position": 1044616696680960,
      "sort_value": "1044616696680960"
    }
  ]
}
```

### examples

* #### Retrieve all collects for the shop

  #####

  ```curl
  curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/collects.json" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

  #### response

  ```json
  HTTP/1.1 200 OK{"collects":[{"id":455204334,"collection_id":841564295,"product_id":632910392,"created_at":null,"updated_at":null,"position":1044616696680960,"sort_value":"1044616696680960"},{"id":773559378,"collection_id":395646240,"product_id":632910392,"created_at":null,"updated_at":null,"position":1044616696680960,"sort_value":"1044616696680960"}]}
  ```

* #### Retrieve only collects for a certain collection

  #####

  ```curl
  curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/collects.json?collection_id=841564295" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

* #### Retrieve only collects for a certain product

  #####

  ```curl
  curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/collects.json?product_id=632910392" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

***

## getRetrieves a specific collect by its ID**deprecated**

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/2026-07/collects/455204334.​json

```bash
curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/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": 1044616696680960,
    "sort_value": "1044616696680960"
  }
}
```

### examples

* #### Retrieve a collect with a certain ID

  #####

  ```curl
  curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/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":1044616696680960,"sort_value":"1044616696680960"}}
  ```

***

## getRetrieves a count of collects

[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/2026-07/collects/count.​json

```bash
curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/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/2026-07/collects/count.json" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

  #### 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/2026-07/collects/count.json?collection_id=841564295" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

* #### Count only collects for a certain product

  #####

  ```curl
  curl -X GET "https://your-development-store.myshopify.com/admin/api/2026-07/collects/count.json?product_id=632910392" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

***

## delRemoves 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/2026-07/collects/455204334.​json

```bash
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2026-07/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/2026-07/collects/455204334.json" \
  -H "X-Shopify-Access-Token: {access_token}"
  ```

  #### response

  ```json
  HTTP/1.1 200 OK{}
  ```
