Building blocks for digital commerce
This plugin is compatible with versions >= 1.8.0 of @medusajs/medusa. Getting Started
The Medusa Product Options Metadata Plugin extends the product options API to include the ability to add metadata to options and option values. This plugin enables you to list all options of a product, manage individual options, and update their metadata.
These endpoints allow you to manage product options and their metadata within your Medusa project.
Endpoint:
GET /admin/products/{productId}/options
Description: Retrieves all options for a specified product.
Parameters: productId: The ID of the product.
Endpoint:
GET /admin/products/{productId}/options/{optionId}
Description: Retrieves a specific option for a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option.
Endpoint:
GET /admin/products/{productId}/options/{optionId}/values
Description: Retrieves a specific option for a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option.
Endpoint:
GET /admin/products/{productId}/options/{optionId}/values/{valueId}
Description: Retrieves a specific option for a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option. valueId: The id of the value option
Endpoint:
POST /admin/products/{productId}/options/{optionId}
Description: Updates the metadata for a specific option of a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option.
Request Body:
json
{
"metadata": {
"key": "value",
"anotherKey": "anotherValue"
}
}
Endpoint:
POST /admin/products/{productId}/options/{optionId}/values/{valueId}
Description: Updates the metadata for a specific option of a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option. valueId: The id of the value option
Request Body:
json
{
"metadata": {
"key": "value",
"anotherKey": "anotherValue"
}
}
These endpoints allow you to view product options, values and their metadata within your Medusa project.
Endpoint:
GET /store/products/{productId}/options
Description: Retrieves all options for a specified product.
Parameters: productId: The ID of the product.
Endpoint:
GET /store/products/{productId}/options/{optionId}
Description: Retrieves a specific option for a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option.
Endpoint:
GET /store/products/{productId}/options/{optionId}/values
Description: Retrieves a specific option for a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option.
Endpoint:
GET /store/products/{productId}/options/{optionId}/values/{valueId}
Description: Retrieves a specific option for a specified product.
Parameters: productId: The ID of the product. optionId: The ID of the product option. valueId: The id of the value option
To update the metadata for a specific product option, send a POST request to the /admin/products/{productId}/options/{optionId} endpoint with the new metadata in the request body.
bash
curl -X POST http://your-medusa-url/admin/products/123/options/456 \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"color": "red",
"size": "M"
}
}'
To view the metadata for a specific product option, send a GET request to the /store/products/{productId}/options/{optionId} endpoint with the new metadata in the request body.
bash
curl -X GET http://your-medusa-url/store/products/123/options/456 \
-H "Content-Type: application/json" \
Visit the Docs to learn more about our system requirements.
Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any product that needs foundational commerce primitives. All modules are open-source and freely available on npm.
Learn more about Medusa’s architecture and commerce modules in the Docs. Roadmap, Upgrades & Plugins
You can view the planned, started and completed features in the Roadmap discussion.
Check out all available Medusa plugins.
This setup allows for managing product options and their metadata effectively within your Medusa project.
The community and core team are available in GitHub Discussions, where you can ask for support, discuss roadmap, and share ideas.
Join our Discord server to meet other community members. Other channels
GitHub Issues
Twitter
LinkedIn
Medusa Blog