---
displayed_sidebar: jsClientSidebar
slug: /references/js-client/AdminCollectionsResource
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# AdminCollectionsResource

This class is used to send requests to [Admin Product Collection API Routes](https://docs.medusajs.com/api/admin#product-collections). All its method
are available in the JS Client under the `medusa.admin.collections` property.

All methods in this class require [user authentication](js_client.AdminAuthResource.mdx#createsession).

A product collection is used to organize products for different purposes such as marketing or discount purposes. For example, you can create a Summer Collection.

## Methods

### addProducts

Add products to collection.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.addProducts(collectionId, {
  product_ids: [
    productId1,
    productId2
  ]
})
.then(({ collection }) => {
  console.log(collection.products)
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "The ID of the product collection.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "payload",
    "type": "[AdminPostProductsToCollectionReq](../../medusa/classes/medusa.AdminPostProductsToCollectionReq.mdx)",
    "description": "The products to add.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "product_ids",
        "type": "`string`[]",
        "description": "An array of Product IDs to add to the Product Collection.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;AdminCollectionsRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the product collection's details.",
    "expandable": false,
    "children": [
      {
        "name": "collection",
        "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
        "description": "Product Collection details.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "created_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was created.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "deleted_at",
            "type": "`null` \\| `Date`",
            "description": "The date with timezone at which the resource was deleted.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "handle",
            "type": "`string`",
            "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "id",
            "type": "`string`",
            "description": "The product collection's ID",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "metadata",
            "type": "`Record<string, unknown>`",
            "description": "An optional key-value map with additional details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "products",
            "type": "[Product](../../entities/classes/entities.Product.mdx)[]",
            "description": "The details of the products that belong to this product collection.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": [
              {
                "name": "categories",
                "type": "[ProductCategory](../../entities/classes/entities.ProductCategory.mdx)[]",
                "description": "The details of the product categories that this product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "featureFlag": "product_categories",
                "children": []
              },
              {
                "name": "collection",
                "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
                "description": "The details of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "collection_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "description",
                "type": "`null` \\| `string`",
                "description": "A short description of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "discountable",
                "type": "`boolean`",
                "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.",
                "optional": false,
                "defaultValue": "true",
                "expandable": false,
                "children": []
              },
              {
                "name": "external_id",
                "type": "`null` \\| `string`",
                "description": "The external ID of the product",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "handle",
                "type": "`null` \\| `string`",
                "description": "A unique identifier for the Product (e.g. for slug structure).",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "height",
                "type": "`null` \\| `number`",
                "description": "The height of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "hs_code",
                "type": "`null` \\| `string`",
                "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The product's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "images",
                "type": "[Image](../../entities/classes/entities.Image.mdx)[]",
                "description": "The details of the product's images.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "is_giftcard",
                "type": "`boolean`",
                "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.",
                "optional": false,
                "defaultValue": "false",
                "expandable": false,
                "children": []
              },
              {
                "name": "length",
                "type": "`null` \\| `number`",
                "description": "The length of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "material",
                "type": "`null` \\| `string`",
                "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`null` \\| `Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "mid_code",
                "type": "`null` \\| `string`",
                "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "options",
                "type": "[ProductOption](../../entities/classes/entities.ProductOption.mdx)[]",
                "description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "origin_country",
                "type": "`null` \\| `string`",
                "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profile",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)",
                "description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "profile_id",
                "type": "`string`",
                "description": "The ID of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profiles",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)[]",
                "description": "Available if the relation `profiles` is expanded.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "sales_channels",
                "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)[]",
                "description": "The details of the sales channels this product is available in.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "status",
                "type": "[ProductStatus](../../entities/enums/entities.ProductStatus.mdx)",
                "description": "The status of the product",
                "optional": false,
                "defaultValue": "draft",
                "expandable": false,
                "children": []
              },
              {
                "name": "subtitle",
                "type": "`null` \\| `string`",
                "description": "An optional subtitle that can be used to further specify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "tags",
                "type": "[ProductTag](../../entities/classes/entities.ProductTag.mdx)[]",
                "description": "The details of the product tags used in this product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "thumbnail",
                "type": "`null` \\| `string`",
                "description": "A URL to an image file that can be used to identify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "title",
                "type": "`string`",
                "description": "A title that can be displayed for easy identification of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "type",
                "type": "[ProductType](../../entities/classes/entities.ProductType.mdx)",
                "description": "The details of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "type_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "variants",
                "type": "[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]",
                "description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "weight",
                "type": "`null` \\| `number`",
                "description": "The weight of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "width",
                "type": "`null` \\| `number`",
                "description": "The width of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          },
          {
            "name": "title",
            "type": "`string`",
            "description": "The title that the Product Collection is identified by.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "updated_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was updated.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />

___

### create

Create a product collection.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.create({
  title: "New Collection"
})
.then(({ collection }) => {
  console.log(collection.id);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "payload",
    "type": "[AdminPostCollectionsReq](../../medusa/classes/medusa.AdminPostCollectionsReq.mdx)",
    "description": "The data of the product collection to create.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "handle",
        "type": "`string`",
        "description": "An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional set of key-value pairs to hold additional information.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "title",
        "type": "`string`",
        "description": "The title of the collection.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;AdminCollectionsRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the created product collection's details.",
    "expandable": false,
    "children": [
      {
        "name": "collection",
        "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
        "description": "Product Collection details.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "created_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was created.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "deleted_at",
            "type": "`null` \\| `Date`",
            "description": "The date with timezone at which the resource was deleted.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "handle",
            "type": "`string`",
            "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "id",
            "type": "`string`",
            "description": "The product collection's ID",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "metadata",
            "type": "`Record<string, unknown>`",
            "description": "An optional key-value map with additional details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "products",
            "type": "[Product](../../entities/classes/entities.Product.mdx)[]",
            "description": "The details of the products that belong to this product collection.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": [
              {
                "name": "categories",
                "type": "[ProductCategory](../../entities/classes/entities.ProductCategory.mdx)[]",
                "description": "The details of the product categories that this product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "featureFlag": "product_categories",
                "children": []
              },
              {
                "name": "collection",
                "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
                "description": "The details of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "collection_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "description",
                "type": "`null` \\| `string`",
                "description": "A short description of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "discountable",
                "type": "`boolean`",
                "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.",
                "optional": false,
                "defaultValue": "true",
                "expandable": false,
                "children": []
              },
              {
                "name": "external_id",
                "type": "`null` \\| `string`",
                "description": "The external ID of the product",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "handle",
                "type": "`null` \\| `string`",
                "description": "A unique identifier for the Product (e.g. for slug structure).",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "height",
                "type": "`null` \\| `number`",
                "description": "The height of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "hs_code",
                "type": "`null` \\| `string`",
                "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The product's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "images",
                "type": "[Image](../../entities/classes/entities.Image.mdx)[]",
                "description": "The details of the product's images.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "is_giftcard",
                "type": "`boolean`",
                "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.",
                "optional": false,
                "defaultValue": "false",
                "expandable": false,
                "children": []
              },
              {
                "name": "length",
                "type": "`null` \\| `number`",
                "description": "The length of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "material",
                "type": "`null` \\| `string`",
                "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`null` \\| `Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "mid_code",
                "type": "`null` \\| `string`",
                "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "options",
                "type": "[ProductOption](../../entities/classes/entities.ProductOption.mdx)[]",
                "description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "origin_country",
                "type": "`null` \\| `string`",
                "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profile",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)",
                "description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "profile_id",
                "type": "`string`",
                "description": "The ID of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profiles",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)[]",
                "description": "Available if the relation `profiles` is expanded.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "sales_channels",
                "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)[]",
                "description": "The details of the sales channels this product is available in.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "status",
                "type": "[ProductStatus](../../entities/enums/entities.ProductStatus.mdx)",
                "description": "The status of the product",
                "optional": false,
                "defaultValue": "draft",
                "expandable": false,
                "children": []
              },
              {
                "name": "subtitle",
                "type": "`null` \\| `string`",
                "description": "An optional subtitle that can be used to further specify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "tags",
                "type": "[ProductTag](../../entities/classes/entities.ProductTag.mdx)[]",
                "description": "The details of the product tags used in this product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "thumbnail",
                "type": "`null` \\| `string`",
                "description": "A URL to an image file that can be used to identify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "title",
                "type": "`string`",
                "description": "A title that can be displayed for easy identification of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "type",
                "type": "[ProductType](../../entities/classes/entities.ProductType.mdx)",
                "description": "The details of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "type_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "variants",
                "type": "[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]",
                "description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "weight",
                "type": "`null` \\| `number`",
                "description": "The weight of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "width",
                "type": "`null` \\| `number`",
                "description": "The width of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          },
          {
            "name": "title",
            "type": "`string`",
            "description": "The title that the Product Collection is identified by.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "updated_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was updated.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />

___

### delete

Delete a product collection. This does not delete associated products.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.delete(collectionId)
.then(({ id, object, deleted }) => {
  console.log(id);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "The ID of the product collection.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;DeleteResponse&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the deletion operation details.",
    "expandable": false,
    "children": [
      {
        "name": "deleted",
        "type": "`boolean`",
        "description": "Whether the item was deleted successfully.",
        "optional": false,
        "defaultValue": "true",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The ID of the deleted item.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "object",
        "type": "`string`",
        "description": "The type of the deleted item.",
        "optional": false,
        "defaultValue": "product-collection",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

___

### list

Retrieve a list of product collections. The product collections can be filtered by fields such as `handle` or `title`. The collections can also be sorted or paginated.

#### Example

To list product collections:

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.list()
.then(({ collections, limit, offset, count }) => {
  console.log(collections.length);
})
```

By default, only the first `10` records are retrieved. You can control pagination by specifying the `limit` and `offset` properties:

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.list({
  limit,
  offset
})
.then(({ collections, limit, offset, count }) => {
  console.log(collections.length);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "query",
    "type": "[AdminGetCollectionsParams](../../medusa/classes/medusa.AdminGetCollectionsParams.mdx)",
    "description": "Filters and pagination configurations to apply on the retrieved product collections.",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "created_at",
        "type": "[DateComparisonOperator](../../medusa/classes/medusa.DateComparisonOperator.mdx)",
        "description": "Date filters to apply on the product collections' `created_at` date.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "gt",
            "type": "`Date`",
            "description": "The filtered date must be greater than this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "gte",
            "type": "`Date`",
            "description": "The filtered date must be greater than or equal to this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "lt",
            "type": "`Date`",
            "description": "The filtered date must be less than this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "lte",
            "type": "`Date`",
            "description": "The filtered date must be less than or equal to this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      },
      {
        "name": "deleted_at",
        "type": "[DateComparisonOperator](../../medusa/classes/medusa.DateComparisonOperator.mdx)",
        "description": "Date filters to apply on the product collections' `deleted_at` date.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "gt",
            "type": "`Date`",
            "description": "The filtered date must be greater than this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "gte",
            "type": "`Date`",
            "description": "The filtered date must be greater than or equal to this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "lt",
            "type": "`Date`",
            "description": "The filtered date must be less than this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "lte",
            "type": "`Date`",
            "description": "The filtered date must be less than or equal to this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      },
      {
        "name": "discount_condition_id",
        "type": "`string`",
        "description": "Filter product collections by their associated discount condition's ID.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "handle",
        "type": "`string`",
        "description": "Handle to filter product collections by.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "limit",
        "type": "`number`",
        "description": "Limit the number of items returned in the list.",
        "optional": false,
        "defaultValue": "10",
        "expandable": false,
        "children": []
      },
      {
        "name": "offset",
        "type": "`number`",
        "description": "The number of items to skip when retrieving a list.",
        "optional": false,
        "defaultValue": "0",
        "expandable": false,
        "children": []
      },
      {
        "name": "q",
        "type": "`string`",
        "description": "Term to search product collections by their title and handle.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "title",
        "type": "`string`",
        "description": "Title to filter product collections by.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "[DateComparisonOperator](../../medusa/classes/medusa.DateComparisonOperator.mdx)",
        "description": "Date filters to apply on the product collections' `updated_at` date.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "gt",
            "type": "`Date`",
            "description": "The filtered date must be greater than this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "gte",
            "type": "`Date`",
            "description": "The filtered date must be greater than or equal to this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "lt",
            "type": "`Date`",
            "description": "The filtered date must be less than this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "lte",
            "type": "`Date`",
            "description": "The filtered date must be less than or equal to this value.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;AdminCollectionsListRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the list of product collections with pagination fields.",
    "expandable": false,
    "children": [
      {
        "name": "AdminCollectionsListRes",
        "type": "[PaginatedResponse](../../medusa/interfaces/medusa.PaginatedResponse.mdx) & `object`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "count",
            "type": "`number`",
            "description": "The total number of items available.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "limit",
            "type": "`number`",
            "description": "The maximum number of items that can be returned in the list.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "offset",
            "type": "`number`",
            "description": "The number of items skipped before the returned items in the list.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "collections",
            "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)[]",
            "description": "an array of collection details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": [
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "handle",
                "type": "`string`",
                "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The product collection's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "products",
                "type": "[Product](../../entities/classes/entities.Product.mdx)[]",
                "description": "The details of the products that belong to this product collection.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "title",
                "type": "`string`",
                "description": "The title that the Product Collection is identified by.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          }
        ]
      }
    ]
  }
]} />

___

### removeProducts

Remove a list of products from a collection. This would not delete the product, only the association between the product and the collection.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.removeProducts(collectionId, {
  product_ids: [
    productId1,
    productId2
  ]
})
.then(({ id, object, removed_products }) => {
  console.log(removed_products)
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "the ID of the product collection",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "payload",
    "type": "[AdminDeleteProductsFromCollectionReq](../../medusa/classes/medusa.AdminDeleteProductsFromCollectionReq.mdx)",
    "description": "The products to remove from the collection.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "product_ids",
        "type": "`string`[]",
        "description": "An array of Product IDs to remove from the Product Collection.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;AdminDeleteProductsFromCollectionRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the deletion operation details.",
    "expandable": false,
    "children": [
      {
        "name": "id",
        "type": "`string`",
        "description": "The ID of the collection",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "object",
        "type": "`string`",
        "description": "The type of object the removal was executed on",
        "optional": false,
        "defaultValue": "product-collection",
        "expandable": false,
        "children": []
      },
      {
        "name": "removed_products",
        "type": "`string`[]",
        "description": "The IDs of the products removed from the collection",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

___

### retrieve

Retrieve a product collection by its ID. The products associated with it are expanded and returned as well.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.retrieve(collectionId)
.then(({ collection }) => {
  console.log(collection.id);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "The ID of the product collection.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;AdminCollectionsRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the product collection's details.",
    "expandable": false,
    "children": [
      {
        "name": "collection",
        "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
        "description": "Product Collection details.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "created_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was created.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "deleted_at",
            "type": "`null` \\| `Date`",
            "description": "The date with timezone at which the resource was deleted.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "handle",
            "type": "`string`",
            "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "id",
            "type": "`string`",
            "description": "The product collection's ID",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "metadata",
            "type": "`Record<string, unknown>`",
            "description": "An optional key-value map with additional details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "products",
            "type": "[Product](../../entities/classes/entities.Product.mdx)[]",
            "description": "The details of the products that belong to this product collection.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": [
              {
                "name": "categories",
                "type": "[ProductCategory](../../entities/classes/entities.ProductCategory.mdx)[]",
                "description": "The details of the product categories that this product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "featureFlag": "product_categories",
                "children": []
              },
              {
                "name": "collection",
                "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
                "description": "The details of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "collection_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "description",
                "type": "`null` \\| `string`",
                "description": "A short description of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "discountable",
                "type": "`boolean`",
                "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.",
                "optional": false,
                "defaultValue": "true",
                "expandable": false,
                "children": []
              },
              {
                "name": "external_id",
                "type": "`null` \\| `string`",
                "description": "The external ID of the product",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "handle",
                "type": "`null` \\| `string`",
                "description": "A unique identifier for the Product (e.g. for slug structure).",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "height",
                "type": "`null` \\| `number`",
                "description": "The height of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "hs_code",
                "type": "`null` \\| `string`",
                "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The product's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "images",
                "type": "[Image](../../entities/classes/entities.Image.mdx)[]",
                "description": "The details of the product's images.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "is_giftcard",
                "type": "`boolean`",
                "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.",
                "optional": false,
                "defaultValue": "false",
                "expandable": false,
                "children": []
              },
              {
                "name": "length",
                "type": "`null` \\| `number`",
                "description": "The length of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "material",
                "type": "`null` \\| `string`",
                "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`null` \\| `Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "mid_code",
                "type": "`null` \\| `string`",
                "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "options",
                "type": "[ProductOption](../../entities/classes/entities.ProductOption.mdx)[]",
                "description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "origin_country",
                "type": "`null` \\| `string`",
                "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profile",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)",
                "description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "profile_id",
                "type": "`string`",
                "description": "The ID of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profiles",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)[]",
                "description": "Available if the relation `profiles` is expanded.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "sales_channels",
                "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)[]",
                "description": "The details of the sales channels this product is available in.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "status",
                "type": "[ProductStatus](../../entities/enums/entities.ProductStatus.mdx)",
                "description": "The status of the product",
                "optional": false,
                "defaultValue": "draft",
                "expandable": false,
                "children": []
              },
              {
                "name": "subtitle",
                "type": "`null` \\| `string`",
                "description": "An optional subtitle that can be used to further specify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "tags",
                "type": "[ProductTag](../../entities/classes/entities.ProductTag.mdx)[]",
                "description": "The details of the product tags used in this product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "thumbnail",
                "type": "`null` \\| `string`",
                "description": "A URL to an image file that can be used to identify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "title",
                "type": "`string`",
                "description": "A title that can be displayed for easy identification of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "type",
                "type": "[ProductType](../../entities/classes/entities.ProductType.mdx)",
                "description": "The details of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "type_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "variants",
                "type": "[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]",
                "description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "weight",
                "type": "`null` \\| `number`",
                "description": "The weight of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "width",
                "type": "`null` \\| `number`",
                "description": "The width of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          },
          {
            "name": "title",
            "type": "`string`",
            "description": "The title that the Product Collection is identified by.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "updated_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was updated.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />

___

### update

Update a product collection's details.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.collections.update(collectionId, {
  title: "New Collection"
})
.then(({ collection }) => {
  console.log(collection.id);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "The ID of the product collection.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "payload",
    "type": "[AdminPostCollectionsCollectionReq](../../medusa/classes/medusa.AdminPostCollectionsCollectionReq.mdx)",
    "description": "The data to update in the product collection.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "handle",
        "type": "`string`",
        "description": "An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional set of key-value pairs to hold additional information.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "title",
        "type": "`string`",
        "description": "The title of the collection.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;AdminCollectionsRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the product collection's details.",
    "expandable": false,
    "children": [
      {
        "name": "collection",
        "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
        "description": "Product Collection details.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "created_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was created.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "deleted_at",
            "type": "`null` \\| `Date`",
            "description": "The date with timezone at which the resource was deleted.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "handle",
            "type": "`string`",
            "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "id",
            "type": "`string`",
            "description": "The product collection's ID",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "metadata",
            "type": "`Record<string, unknown>`",
            "description": "An optional key-value map with additional details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "products",
            "type": "[Product](../../entities/classes/entities.Product.mdx)[]",
            "description": "The details of the products that belong to this product collection.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": [
              {
                "name": "categories",
                "type": "[ProductCategory](../../entities/classes/entities.ProductCategory.mdx)[]",
                "description": "The details of the product categories that this product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "featureFlag": "product_categories",
                "children": []
              },
              {
                "name": "collection",
                "type": "[ProductCollection](../../entities/classes/entities.ProductCollection.mdx)",
                "description": "The details of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "collection_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product collection that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "description",
                "type": "`null` \\| `string`",
                "description": "A short description of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "discountable",
                "type": "`boolean`",
                "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.",
                "optional": false,
                "defaultValue": "true",
                "expandable": false,
                "children": []
              },
              {
                "name": "external_id",
                "type": "`null` \\| `string`",
                "description": "The external ID of the product",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "handle",
                "type": "`null` \\| `string`",
                "description": "A unique identifier for the Product (e.g. for slug structure).",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "height",
                "type": "`null` \\| `number`",
                "description": "The height of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "hs_code",
                "type": "`null` \\| `string`",
                "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The product's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "images",
                "type": "[Image](../../entities/classes/entities.Image.mdx)[]",
                "description": "The details of the product's images.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "is_giftcard",
                "type": "`boolean`",
                "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.",
                "optional": false,
                "defaultValue": "false",
                "expandable": false,
                "children": []
              },
              {
                "name": "length",
                "type": "`null` \\| `number`",
                "description": "The length of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "material",
                "type": "`null` \\| `string`",
                "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`null` \\| `Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "mid_code",
                "type": "`null` \\| `string`",
                "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "options",
                "type": "[ProductOption](../../entities/classes/entities.ProductOption.mdx)[]",
                "description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "origin_country",
                "type": "`null` \\| `string`",
                "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profile",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)",
                "description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "profile_id",
                "type": "`string`",
                "description": "The ID of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "profiles",
                "type": "[ShippingProfile](../../entities/classes/entities.ShippingProfile.mdx)[]",
                "description": "Available if the relation `profiles` is expanded.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "sales_channels",
                "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)[]",
                "description": "The details of the sales channels this product is available in.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "status",
                "type": "[ProductStatus](../../entities/enums/entities.ProductStatus.mdx)",
                "description": "The status of the product",
                "optional": false,
                "defaultValue": "draft",
                "expandable": false,
                "children": []
              },
              {
                "name": "subtitle",
                "type": "`null` \\| `string`",
                "description": "An optional subtitle that can be used to further specify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "tags",
                "type": "[ProductTag](../../entities/classes/entities.ProductTag.mdx)[]",
                "description": "The details of the product tags used in this product.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "thumbnail",
                "type": "`null` \\| `string`",
                "description": "A URL to an image file that can be used to identify the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "title",
                "type": "`string`",
                "description": "A title that can be displayed for easy identification of the Product.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "type",
                "type": "[ProductType](../../entities/classes/entities.ProductType.mdx)",
                "description": "The details of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "type_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the product type that the product belongs to.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "variants",
                "type": "[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]",
                "description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "weight",
                "type": "`null` \\| `number`",
                "description": "The weight of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "width",
                "type": "`null` \\| `number`",
                "description": "The width of the Product Variant. May be used in shipping rate calculations.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          },
          {
            "name": "title",
            "type": "`string`",
            "description": "The title that the Product Collection is identified by.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "updated_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was updated.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />
