---
title: "Get product collection relationships"
description: "Get a list of relationships between products and collections."
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/product/collection-relationship/get-product-collection-relationships'
  md: 'https://developer.shopline.com/docs/admin-rest-api/product/collection-relationship/get-product-collection-relationships.md'
---
# Get product collection relationships

Get a list of relationships between products and collections.

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `read_products`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
GET /products/collects.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `read_products`

## Request

### Query Parameters

* `limit`

  string (optional)

  The quantity limit of relationships to be queried.  <br/>
  Value range: 1-250  <br/>
  Default Value: 50  

* `page_info`

  string (optional)

  The unique identifier for pagination queries, used to locate a specific page. 
  
  This parameter value is obtained from the `link` value in the response header of this API after you have queried the pagination information. 
  
  For example, if the `link` value you obtained is `<https://{handle}.myshopline.com/admin/openapi/{version}/products/collects.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next"` , the value of `page_info` is `eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9` . 
  
  For more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).

* `product_id`

  string (optional)

  The unique identifier for the product. <br/>
  Maximum length：64 

* `since_id`

  string (optional)

  The ID of a specific product collection relationship. Start querying product collection relationships from this specified ID.

* `collection_id`

  string (optional)

  The unique identifier for the collection.
  <br/>Maximum length: 64

* `fields`

  string (optional)

  Specify the fields to be returned, with multiple fields separated by commas. For available fields, refer to the top-level child parameters under the `collects` object in the response. 

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `link`

  The URL link that provides the pagination data. You can obtain `page_info` from this parameter for subsequent pagination requests. 
  
  This parameter is returned when the requested page has a previous or next page. 
  
  For more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `collects`

  array<object>

  A list of relationships.

  * `product_id`

    string

    The unique identifier for the product. 

  * `product_priority`

    long

    The priority of a product within a collection. A smaller value indicates a higher priority. The priority values are non-continuous and are not arranged in sequential integers.

  * `sort_value`

    string

    Product sorting value within a collection. Constructed by left-padding the `product_priority` value with zeros to reach a total length of 20 characters.

  * `updated_at`

    string

    The date and time when the product collection relationship was last updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `collection_id`

    string

    The unique identifier for the collection.

  * `created_at`

    string

    The date and time when the product collection relationship was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `id`

    long

    The unique identifier for the product collection relationship.


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Get product collection relationships"
  ],
  "description": "Get a list of relationships between products and collections.",
  "externalDocs": {
    "description": "Permission point used by the interface is `read_products` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "jW6haIjt",
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "description": "The quantity limit of relationships to be queried.  <br/>\nValue range: 1-250  <br/>\nDefault Value: 50  ",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "limit",
        "description": "The quantity limit of relationships to be queried.  <br/>\nValue range: 1-250  <br/>\nDefault Value: 50  ",
        "type": "string"
      },
      "examples": {
        "Get product collection relationships by specifying the product ID": {
          "value": "10"
        }
      }
    },
    {
      "name": "page_info",
      "in": "query",
      "description": "The unique identifier for pagination queries, used to locate a specific page. \n\nThis parameter value is obtained from the `link` value in the response header of this API after you have queried the pagination information. \n\nFor example, if the `link` value you obtained is `<https://{handle}.myshopline.com/admin/openapi/{version}/products/collects.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel=\"next\"` , the value of `page_info` is `eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9` . \n\nFor more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "page_info",
        "description": "The unique identifier for pagination queries, used to locate a specific page. This parameter value is obtained from the `link` value in the response header of this API after you have queried the pagination information. For example, if the `link` value you obtained is `<https://\\{handle\\}.myshopline.com/admin/openapi/\\{version\\}/products/products.json? limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel=\"next\"`, the value of `page_info` is `eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9`.\n\nFor more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).",
        "type": "string"
      },
      "examples": {
        "Get product collection relationships by specifying the product ID": {
          "value": ""
        }
      }
    },
    {
      "name": "product_id",
      "in": "query",
      "description": "The unique identifier for the product. <br/>\nMaximum length：64 ",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "product_id",
        "description": "The unique identifier for the product. <br/>\nMaximum length：64 ",
        "type": "string",
        "example": "16057039432335097907370282"
      },
      "example": "16057039432335097907370282",
      "examples": {
        "Get product collection relationships by specifying the product ID": {
          "value": "16057039432335097907370282"
        }
      }
    },
    {
      "name": "since_id",
      "in": "query",
      "description": "The ID of a specific product collection relationship. Start querying product collection relationships from this specified ID.",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "since_id",
        "description": "The ID of a specific product collection relationship. Start querying product collection relationships from this specified ID.",
        "type": "string",
        "example": "6063851731392959569,6239973670640427881"
      },
      "example": "6063851731392959569,6239973670640427881",
      "examples": {
        "Get product collection relationships by specifying the product ID": {
          "value": ""
        }
      }
    },
    {
      "name": "collection_id",
      "in": "query",
      "description": "The unique identifier for the collection.\n<br/>Maximum length: 64",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "collection_id",
        "description": "The unique identifier for the collection.\n<br/>Maximum length: 64",
        "type": "string",
        "example": "12249026592161154694000282"
      },
      "example": "12249026592161154694000282",
      "examples": {
        "Get product collection relationships by specifying the product ID": {
          "value": ""
        }
      }
    },
    {
      "name": "fields",
      "in": "query",
      "description": "Specify the fields to be returned, with multiple fields separated by commas. For available fields, refer to the top-level child parameters under the `collects` object in the response. ",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "fields",
        "description": "Specify the fields to be returned, with multiple fields separated by commas. For available fields, refer to the top-level child parameters under the `collects` object in the response. ",
        "type": "string",
        "example": "created_at,id"
      },
      "example": "created_at,id",
      "examples": {
        "Get product collection relationships by specifying the product ID": {
          "value": ""
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "link": {
          "description": "The URL link that provides the pagination data. You can obtain `page_info` from this parameter for subsequent pagination requests. \n\nThis parameter is returned when the requested page has a previous or next page. \n\nFor more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).",
          "example": "\\<https://{handle}.myshopline.com/admin/openapi/{version}/products/collects.json?limit=20&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel='previous',<https://{handle}.myshopline.com/admin/openapi/{version}/products/collects.json?limit=20&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJwcmUiLCJsaW1pdCI6MX0=\\>; rel='next'"
        },
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "collects": {
                "name": "collects",
                "description": "A list of relationships.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "product_id": {
                      "name": "product_id",
                      "description": "The unique identifier for the product. ",
                      "type": "string",
                      "example": "16057039432335097907370282"
                    },
                    "product_priority": {
                      "name": "product_priority",
                      "description": "The priority of a product within a collection. A smaller value indicates a higher priority. The priority values are non-continuous and are not arranged in sequential integers.",
                      "type": "long",
                      "example": 10000000000000
                    },
                    "sort_value": {
                      "name": "sort_value",
                      "description": "Product sorting value within a collection. Constructed by left-padding the `product_priority` value with zeros to reach a total length of 20 characters.",
                      "type": "string",
                      "example": "00000010000000000000"
                    },
                    "updated_at": {
                      "name": "updated_at",
                      "description": "The date and time when the product collection relationship was last updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string",
                      "example": "2025-03-06T02:20:26+08:00"
                    },
                    "collection_id": {
                      "name": "collection_id",
                      "description": "The unique identifier for the collection.",
                      "type": "string",
                      "example": "12249026592161154694000282"
                    },
                    "created_at": {
                      "name": "created_at",
                      "description": "The date and time when the product collection relationship was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string",
                      "example": "2025-03-06T02:20:26+08:00"
                    },
                    "id": {
                      "name": "id",
                      "description": "The unique identifier for the product collection relationship.",
                      "type": "long",
                      "example": 5392284410644534000
                    }
                  },
                  "example": {
                    "sort_value": "00000010000000000000",
                    "updated_at": "2025-03-06T02:20:26+08:00",
                    "collection_id": "12249026592161154694000282",
                    "created_at": "2025-03-06T02:20:26+08:00",
                    "id": 5392284410644534000,
                    "product_id": "16057039432335097907370282",
                    "product_priority": 10000000000000
                  }
                },
                "example": [
                  {
                    "sort_value": "00000010000000000000",
                    "updated_at": "2025-03-06T02:20:26+08:00",
                    "collection_id": "12249026592161154694000282",
                    "created_at": "2025-03-06T02:20:26+08:00",
                    "id": 5392284410644534000,
                    "product_id": "16057039432335097907370282",
                    "product_priority": 10000000000000
                  }
                ]
              }
            },
            "example": {
              "collects": [
                {
                  "updated_at": "2025-03-06T02:20:26+08:00",
                  "collection_id": "12249026592161154694000282",
                  "created_at": "2025-03-06T02:20:26+08:00",
                  "id": 5392284410644534000,
                  "product_id": "16057039432335097907370282",
                  "product_priority": 10000000000000,
                  "sort_value": "00000010000000000000"
                }
              ]
            }
          },
          "examples": {
            "Get product collection relationships by specifying the product ID": {
              "description": "Get product collection relationships by specifying the product ID.",
              "value": {
                "collects": [
                  {
                    "updated_at": "2022-12-06T23:45:02+08:00",
                    "collection_id": "12249026592161154694000282",
                    "created_at": "2022-12-06T23:41:49+08:00",
                    "id": 5704474910564819000,
                    "product_id": "16057039432335097907370282",
                    "product_priority": 10000000000000,
                    "sort_value": "00000010000000000000"
                  },
                  {
                    "updated_at": "2022-12-06T23:45:08+08:00",
                    "collection_id": "12249521251322718219170282",
                    "created_at": "2022-12-06T23:45:08+08:00",
                    "id": 5704478249750898000,
                    "product_id": "16057039432335097907370282",
                    "product_priority": 10000000000000,
                    "sort_value": "00000010000000000000"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "get",
  "path": "/products/collects.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Get product collection relationships",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_products"
  ]
}
```