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 admin users to manage product options.
GET /admin/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: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
titlestring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptionalorderstringOptional-.qstringOptionalis_exclusivebooleanOptionallimitnumberOptionaloffsetnumberOptionalwith_deletedbooleanOptionalfieldsstringOptional+ 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$orobject[]Optionalidstring | string[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberestimate_countnumberOptionalproduct_optionsobject[]The list of product options.
product_optionsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/product-options#
Create Product Option
Create a product option.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request body (application/json)
titlestringvaluesstring[]ranksobjectOptionalis_exclusivebooleanOptionalRequest examples
Responses
200 OK
product_optionobjectThe product option's details.
product_optionobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-option.created: Emitted when product options are created.
GET /admin/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: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ 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_optionobjectThe product option's details.
product_optionobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/product-options/{id}#
Update a Product Option
Update a product option's details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
titlestringOptionalvaluesstring[]OptionalidstringOptionalranksobjectOptionalis_exclusivebooleanOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
product_optionobjectThe product option's details.
product_optionobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-option.updated: Emitted when product options are updated.
DELETE /admin/product-options/{id}#
Delete a Product Option
Delete a product option.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "product_option"
deletedbooleanparentobjectOptionalThe product's details.
parentobjectOptional400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-option.deleted: Emitted when product options are deleted.
GET /admin/product-options/{id}/values#
List Product Option Values
Retrieve a list of values in a product option. The values can be filtered by fields like id. The values can also be paginated.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
qstringOptionalidstring | string[]Optionalvaluestring | string[]Optionaloption_idstring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptionallimitnumberOptionaloffsetnumberOptionalorderstringOptional-.with_deletedbooleanOptionalfieldsstringOptional+ 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$orobject[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberestimate_countnumberOptionalproduct_option_valuesobject[]The list of product option values.
product_option_valuesobject[]400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/product-options/{id}/values/{value_id}#
Get Product Option Value
Get a product option value by its ID.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringvalue_idstringQuery parameters
fieldsstringOptional+ 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_option_valueobjectThe product option value's details.
product_option_valueobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/product-options/{id}/values/{value_id}#
Update Product Option Value
Update a product option value's details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringvalue_idstringRequest body (application/json)
valuestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
product_option_valueobjectThe product option value's details.
product_option_valueobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-option-value.updated: Emitted when product option values are updated.
DELETE /admin/product-options/{id}/values/{value_id}#
Remove Value from Product Option
Remove a Value from a product option.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringvalue_idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "product_option_value"
deletedbooleanparentobjectOptionalThe product option's details.
parentobjectOptional400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-option-value.deleted: Emitted when product option values are deleted.