---
displayed_sidebar: entitiesSidebar
slug: /references/entities/classes/ProductOption
---

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

# ProductOption

A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options.

## Properties

<ParameterTypes parameters={[
  {
    "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": "id",
    "type": "`string`",
    "description": "The product option'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": "product",
    "type": "[Product](entities.Product.mdx)",
    "description": "The details of the product that this product option belongs to.",
    "optional": false,
    "defaultValue": "",
    "expandable": true,
    "children": [
      {
        "name": "categories",
        "type": "[ProductCategory](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.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.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.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.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.ShippingProfile.mdx)[]",
        "description": "Available if the relation `profiles` is expanded.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sales_channels",
        "type": "[SalesChannel](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](../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.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.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.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": "product_id",
    "type": "`string`",
    "description": "The ID of the product that this product option belongs to.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "title",
    "type": "`string`",
    "description": "The title that the Product Option is defined by (e.g. `Size`).",
    "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": "values",
    "type": "[ProductOptionValue](entities.ProductOptionValue.mdx)[]",
    "description": "The details of the values of the product option.",
    "optional": false,
    "defaultValue": "",
    "expandable": true,
    "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": "id",
        "type": "`string`",
        "description": "The product option value'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": "option",
        "type": "[ProductOption](entities.ProductOption.mdx)",
        "description": "The details of the product option that the Product Option Value belongs to.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "option_id",
        "type": "`string`",
        "description": "The ID of the Product Option that the Product Option Value 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": "value",
        "type": "`string`",
        "description": "The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`).",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "variant",
        "type": "[ProductVariant](entities.ProductVariant.mdx)",
        "description": "The details of the product variant that uses this product option value.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "variant_id",
        "type": "`string`",
        "description": "The ID of the product variant that uses this product option value.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>
