Product Options API Routes

A product option is a way to define different options for a product, such as "Size" or "Color". Product options can be created globally and used by multiple products, or they can be exclusive to a specific product. These API routes allow customers to view product options.

GET /store/product-options#

List Product Options

Retrieve a list of product options. The product options can be filtered by fields such as id. The product options can also be sorted or paginated.

Authentication: none.

Header parameters

x-publishable-api-keystring
Publishable API Key created in the Medusa Admin.
x-medusa-localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Query parameters

localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US
qstringOptional
A search term to filter the product option's searchable fields.
titlestring | string[]Optional
Filter by the product option's title.
is_exclusivebooleanOptional
Filter by whether the product option is exclusive to a product or global.
created_atobjectOptional
Filter by a product option's creation date. Accepts the filter operators.
updated_atobjectOptional
Filter by a product option's update date. Accepts the filter operators.
deleted_atobjectOptional
Filter by a product option's deletion date. Accepts the filter operators.
limitnumberOptional
Limit the number of items returned in the list.
offsetnumberOptional
The number of items to skip when retrieving a list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
with_deletedbooleanOptional
The product option's with deleted.
fieldsstringOptional
Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
idstring | string[]Optional
Filter by a product option's ID.

Request examples

Responses

200 OK

limitnumber
The maximum number of items returned.
offsetnumber
The number of items skipped before the returned items.
countnumber
The total number of items.
estimate_countnumberOptional
The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.
product_optionsobject[]
The list of product options.

400, 401, 404, 409, 422, 500: an error response is returned.


GET /store/product-options/{id}#

Get a Product Option

Retrieve a product option by its ID. You can expand the product option's relations or select the fields that should be returned.

Authentication: none.

Path parameters

idstring
The product option's ID.

Header parameters

x-publishable-api-keystring
Publishable API Key created in the Medusa Admin.
x-medusa-localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Query parameters

localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US
fieldsstringOptional
Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.

Request examples

Responses

200 OK

product_optionobject
The product option's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Found a problem with this page?Report Issue
Edited Nov 14·Edit this page