Skip to content

chore: OAS for product options - #14344

Merged
shahednasser merged 1 commit into
chore/add-many-to-many-between-product-and-optionfrom
chore/po-oas
Dec 18, 2025
Merged

chore: OAS for product options#14344
shahednasser merged 1 commit into
chore/add-many-to-many-between-product-and-optionfrom
chore/po-oas

Conversation

@shahednasser

@shahednasser shahednasser commented Dec 17, 2025

Copy link
Copy Markdown
Member

Note

Introduces admin/store Product Options endpoints and schemas, new product-option linking, option/option-value filters on product lists/exports, a price-list prices listing, and updates docs generator and examples.

  • APIs:
    • Admin:
      • Add GET /admin/product-options, GET /admin/product-options/{id}, POST /admin/product-options, POST /admin/product-options/{id}, DELETE /admin/product-options/{id}.
      • Change POST /admin/products/{id}/options to link/add/remove options using AdminLinkProductOptions (workflow createAndLinkProductOptionsToProductWorkflow).
    • Store:
      • Add GET /store/product-options and GET /store/product-options/{id}.
    • Pricing:
      • Add GET /admin/price-lists/{id}/prices and AdminPriceListPriceListResponse.
  • Products filtering:
    • Add option_id and option_value_id filters to GET /admin/products, POST /admin/products/export, and GET /store/products.
    • Add is_exclusive filter to GET /admin/products/{id}/options.
  • Schemas:
    • Extend AdminProductOption, BaseProductOption, and StoreProductOption with is_exclusive, products; add value rank fields.
    • Add AdminLinkProductOptions; enhance AdminCreateProductOption/AdminUpdateProductOption with ranks, is_exclusive, metadata.
    • Update AdminCreateProduct options structure and AdminBatchUpdateProduct with option_ids.
    • Add StoreProductOptionResponse and update related responses.
  • Docs/Generator:
    • Update docs generator to recognize StoreRequestWithContext and StoreVariantListRequest for query parsing.
    • Tag descriptions formatting/translation examples tweaked.
  • Examples:
    • Refresh route examples to include new Product Options endpoints and updated product export/order examples.

Written by Cursor Bugbot for commit 5c0a741. This will update automatically on new commits. Configure here.

@shahednasser
shahednasser requested a review from a team as a code owner December 17, 2025 16:50
@vercel

vercel Bot commented Dec 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

8 Skipped Deployments
Project Deployment Review Updated (UTC)
api-reference Ignored Ignored Dec 17, 2025 4:51pm
api-reference-v2 Ignored Ignored Dec 17, 2025 4:51pm
cloud-docs Ignored Ignored Dec 17, 2025 4:51pm
docs-ui Ignored Ignored Dec 17, 2025 4:51pm
docs-v2 Ignored Ignored Dec 17, 2025 4:51pm
medusa-docs Ignored Ignored Dec 17, 2025 4:51pm
resources-docs Ignored Ignored Dec 17, 2025 4:51pm
user-guide Ignored Ignored Dec 17, 2025 4:51pm

@changeset-bot

changeset-bot Bot commented Dec 17, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5c0a741

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@shahednasser
shahednasser merged commit b73b2c7 into chore/add-many-to-many-between-product-and-option Dec 18, 2025
46 of 47 checks passed
@shahednasser
shahednasser deleted the chore/po-oas branch December 18, 2025 06:53
NicolasGorga added a commit that referenced this pull request Jun 24, 2026
* chore(product,types): change relationship between product and option to many to many

* tests

* define model for pivot table

* test commit will revert

* Revert "test commit will revert"

This reverts commit cb3dda5.

* model for pivot table

* more

* new product options endpoint

* product options endpoints

* tests

* remove debug

* small changes in endpoints

* add ranks to product option values

* allow linking to existing option on product creation

* updates to link endpoint

* Create forty-tables-fetch.md

* integration tests

* integration tests

* product integration tests

* update validator

* fix import

* fix import

* maintain ordering

* self review

* pr comments

* pr comments

* pr comments

* is string

* pr comments

* query graph

* comment about moving error

* create options in parallel

* comments

* small change in doc

* migration name

* fix test

* feat(dashboard,admin-shared,js-sdk): product option redesign (client-side) (#13887)

* feat(dashboard,js-sdk): product option redesign (client-side)

* support create

* edit option and values rank

* change bade

* select from options at product creation

* create product with link to option

* edit option from product page

* link and unlink option to product

* missed the js sdk in last commit

* small fix when removing a value

* Create shaggy-parents-guess.md

* pr comments

* pr comments

* pr comments

* is string

* pr comments

* query graph

* fix pipeline

* woops

* todo

* better table

* review

* changeset

* feat(): allow linking a subset of an option's values to the product (#14054)

* wip

* model changes

* map products

* remove log

* link subset of values

* fix tests

* link subset at product creation

* chips in combobox

* chips in product creation too

* Create spotty-dragons-shave.md

* migration + sort values by rank in product details

* cursor review

* small fixes

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>

* fix: prod normalization mege

* fix: delete cascade between 2 pivot tables

* fix: make link test deterministic

* fix: options filters

* feat: navigate to the option instead of edit

* feat: disable changin product option exclusivity setting

* fix: make migrated ids follow our format

* fix: disable only global option making

* fix: migration

* fix: temp enable pgcrpyto

* fix: update tests, fix condition, revert id change

* feat: validate product <> option assignments and updates (#14207)

* feat: validate product <> option (un)assignemnts

* fix: rm Knex import

* fix: update test file

* chore(): cleanup proposal (#14294)

* chore(): cleanup proposal

* chore(): cleanup proposal

* chore(): cleanup proposal

* reorder arguments

* reorder arguments

---------

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>

* fix: test suite, address feedback

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* feat: validate product option (value) deletion (#14248)

* wip: prevent option deletion if an associated product exists

* wip: refactor, check if value is removed

* fix: typos

* feat: push validation into module, finish update and delete test cases

* chore: refactor

* fix: try referencing rollup from global modules

* fix: undo last change

* fix: split methods

* fix: options map

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: improve TSDocs of product options (#14323)

* chore: improve TSDocs of product options

* fixes

* feat: product option UI + storefront API changes (#14265)

* wip: product option UI changes

* feat: allow managing non global options

* chore: finalise create form

* feat: product options storefront endpoints

* feat: rest of changes

* fix: finalise changes and tests

* feat: filter products by option values (#14308)

* feat: filtering products by option values

* wip: grouping and filtering

* feat: implement prefetching query

* fix: rm var opts check

* feat: subquery

* fix: vars

* chore: cleanup

* fix: join

* fix: excape

* fix: rename

* chore: test names

* chore: another test

* fix: duplicate import

* fix: translation

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: tsdocs updates for latest product option changes (#14326)

* fix(types,medusa): use HTTP types in request type parameters of product options routes (#14324)

* fix(types,medusa): use HTTP types in request type parameters of product options routes

* fix type for store product options

* fix type parameters for store request

* feat: product update schema file

* chore: OAS for product options (#14344)

* fix: product pivots id format migration (#14446)

* wip: set pivot tables ids in batches

* fix: update processing logic

* fix: use max batches guard

* fix: product options catch-all improvements (#14343)

* wip: manage form improvements, delete product exclusive options with product

* fix: build

* fix: revert client change

* fix: order of args, with deleted test

* fix: iitem removal condition

* feat: emit event on options manage

* fix: transform

* fix: return object

* feat: cascade soft delete options to the pivot tables, update can delete check

* chore: cleanup, add variants to tested products

* fix: default ranking

* refactor: create option form

* fix: prepanding exclusive options in combobox on options manage form

* fix: handle product without variants

* fix: make ranking logic consistent

* feat: better pagination query, remove client side options merge

* fix: set param

* refacto: options state to be in a single place

* feat: handle new option add, submit validation

* chore: refactor

* fix: do not cuncurrently manage product options in the link step

* feat: invalidate options lists on product create/delete

* fix: rm autogenerated soft delete methods

* chore: rework PPO management API (#14473)

* chore: rework PPO management api

* fix: address removall compensation issue

* fix: address update compensation

* fix: restore only PPO links that exist

* feat: validate that exclusive option cannot be added to multiple products

* fix: is string

* refactor: use query

* fix: validation edge case, do a single query check, add tests

* chore: refactor add PPO flow, simplify method, add validtion checks, update the step

* fix: address feedback

* fix: disallow creation of global option values from the create product flow

* fix: reorg options details page

* feat: exclusive options creation with batch PPO flow

* fix: consistently indexation on ranks edits

* fix: optimise list product options fetching (#14548)

* fix: optimise list products options loading and filtering

* fix: type import

* test: add back prod relation for options fetching on update

* fix: revert options products fetch

* feat: filtering with inner join

* fix: preserve search params on create modal open

* feat: handle creation and duplication of new options and values

* fix: handling is exclusive default filter

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* feat: add rbac policies for new product option endpoints

* zod fixes

* remove unused

* fix performance issues + variant values not reinforced

* fix tests

* address comments

* change since tags

* fix test

* Add missing unsuported filter guards for index engine queries

* Fix pagination and reduce network requests

* Allow getOptions typing to return more than label and value

* Fix type

* Fix pagination issue and reduce network requests

* Guard product options batch endpoint

* Fix option_ids validator type in update product endpoint

* Add test documenting exclusivity changes current constraints

* Fix js doc

* Avoid mutating in place

* Use translations

* fix: highlight product option filter chip for manual URLs

* fix: remove product option when its last value is unselected

* feat(admin-shared,dashboard,core-flows,product,js-sdk,types,medusa): rework product option values views and add dedicated endpoints (#15810)

* Rework product option values views and introduce dedicated endpoints

* Changeset

* Add .js ext

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: fPolic <mainacc.polic@gmail.com>
Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
Co-authored-by: Nicolas Gorga <nicogorga11@gmail.com>
Co-authored-by: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com>
NicolasGorga added a commit that referenced this pull request Jul 9, 2026
…n imports (#15614)

* chore(product,types): change relationship between product and option to many to many

* tests

* define model for pivot table

* test commit will revert

* Revert "test commit will revert"

This reverts commit cb3dda5.

* model for pivot table

* more

* new product options endpoint

* product options endpoints

* tests

* remove debug

* small changes in endpoints

* add ranks to product option values

* allow linking to existing option on product creation

* updates to link endpoint

* Create forty-tables-fetch.md

* integration tests

* integration tests

* product integration tests

* update validator

* fix import

* fix import

* maintain ordering

* self review

* pr comments

* pr comments

* pr comments

* is string

* pr comments

* query graph

* comment about moving error

* create options in parallel

* comments

* small change in doc

* migration name

* fix test

* feat(dashboard,admin-shared,js-sdk): product option redesign (client-side) (#13887)

* feat(dashboard,js-sdk): product option redesign (client-side)

* support create

* edit option and values rank

* change bade

* select from options at product creation

* create product with link to option

* edit option from product page

* link and unlink option to product

* missed the js sdk in last commit

* small fix when removing a value

* Create shaggy-parents-guess.md

* pr comments

* pr comments

* pr comments

* is string

* pr comments

* query graph

* fix pipeline

* woops

* todo

* better table

* review

* changeset

* feat(): allow linking a subset of an option's values to the product (#14054)

* wip

* model changes

* map products

* remove log

* link subset of values

* fix tests

* link subset at product creation

* chips in combobox

* chips in product creation too

* Create spotty-dragons-shave.md

* migration + sort values by rank in product details

* cursor review

* small fixes

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>

* fix: prod normalization mege

* fix: delete cascade between 2 pivot tables

* fix: make link test deterministic

* fix: options filters

* feat: navigate to the option instead of edit

* feat: disable changin product option exclusivity setting

* fix: make migrated ids follow our format

* fix: disable only global option making

* fix: migration

* fix: temp enable pgcrpyto

* fix: update tests, fix condition, revert id change

* feat: validate product <> option assignments and updates (#14207)

* feat: validate product <> option (un)assignemnts

* fix: rm Knex import

* fix: update test file

* chore(): cleanup proposal (#14294)

* chore(): cleanup proposal

* chore(): cleanup proposal

* chore(): cleanup proposal

* reorder arguments

* reorder arguments

---------

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>

* fix: test suite, address feedback

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* feat: validate product option (value) deletion (#14248)

* wip: prevent option deletion if an associated product exists

* wip: refactor, check if value is removed

* fix: typos

* feat: push validation into module, finish update and delete test cases

* chore: refactor

* fix: try referencing rollup from global modules

* fix: undo last change

* fix: split methods

* fix: options map

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: improve TSDocs of product options (#14323)

* chore: improve TSDocs of product options

* fixes

* feat: product option UI + storefront API changes (#14265)

* wip: product option UI changes

* feat: allow managing non global options

* chore: finalise create form

* feat: product options storefront endpoints

* feat: rest of changes

* fix: finalise changes and tests

* feat: filter products by option values (#14308)

* feat: filtering products by option values

* wip: grouping and filtering

* feat: implement prefetching query

* fix: rm var opts check

* feat: subquery

* fix: vars

* chore: cleanup

* fix: join

* fix: excape

* fix: rename

* chore: test names

* chore: another test

* fix: duplicate import

* fix: translation

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: tsdocs updates for latest product option changes (#14326)

* fix(types,medusa): use HTTP types in request type parameters of product options routes (#14324)

* fix(types,medusa): use HTTP types in request type parameters of product options routes

* fix type for store product options

* fix type parameters for store request

* feat: product update schema file

* chore: OAS for product options (#14344)

* fix: product pivots id format migration (#14446)

* wip: set pivot tables ids in batches

* fix: update processing logic

* fix: use max batches guard

* fix: product options catch-all improvements (#14343)

* wip: manage form improvements, delete product exclusive options with product

* fix: build

* fix: revert client change

* fix: order of args, with deleted test

* fix: iitem removal condition

* feat: emit event on options manage

* fix: transform

* fix: return object

* feat: cascade soft delete options to the pivot tables, update can delete check

* chore: cleanup, add variants to tested products

* fix: default ranking

* refactor: create option form

* fix: prepanding exclusive options in combobox on options manage form

* fix: handle product without variants

* fix: make ranking logic consistent

* feat: better pagination query, remove client side options merge

* fix: set param

* refacto: options state to be in a single place

* feat: handle new option add, submit validation

* chore: refactor

* fix: do not cuncurrently manage product options in the link step

* feat: invalidate options lists on product create/delete

* fix: rm autogenerated soft delete methods

* chore: rework PPO management API (#14473)

* chore: rework PPO management api

* fix: address removall compensation issue

* fix: address update compensation

* fix: restore only PPO links that exist

* feat: validate that exclusive option cannot be added to multiple products

* fix: is string

* refactor: use query

* fix: validation edge case, do a single query check, add tests

* chore: refactor add PPO flow, simplify method, add validtion checks, update the step

* fix: address feedback

* fix: disallow creation of global option values from the create product flow

* fix: reorg options details page

* feat: exclusive options creation with batch PPO flow

* fix: consistently indexation on ranks edits

* fix: optimise list product options fetching (#14548)

* fix: optimise list products options loading and filtering

* fix: type import

* test: add back prod relation for options fetching on update

* fix: revert options products fetch

* feat: filtering with inner join

* fix: preserve search params on create modal open

* feat: handle creation and duplication of new options and values

* fix: handling is exclusive default filter

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* feat: add rbac policies for new product option endpoints

* zod fixes

* remove unused

* fix performance issues + variant values not reinforced

* fix tests

* address comments

* change since tags

* fix test

* Add missing unsuported filter guards for index engine queries

* Fix pagination and reduce network requests

* Allow getOptions typing to return more than label and value

* Fix type

* Fix pagination issue and reduce network requests

* Guard product options batch endpoint

* Fix option_ids validator type in update product endpoint

* Add test documenting exclusivity changes current constraints

* Fix js doc

* Avoid mutating in place

* Use translations

* fix: highlight product option filter chip for manual URLs

* fix: remove product option when its last value is unselected

* [Global Product Options] fix(core-flows, utils): support global and exclusive imports

* Remove orphaned exclusive options

* Fix product options addition/removal compensation

* Fix tests

* Update convert to boolean util

* Guarantee columns in csv fixture

* feat(admin-shared,dashboard,core-flows,product,js-sdk,types,medusa): rework product option values views and add dedicated endpoints (#15810)

* Rework product option values views and introduce dedicated endpoints

* Changeset

* Add .js ext

* Add unique constraint on product option non exlcusive title + new tests

* Update test

* Changeset

* Fix query

* undo changes

---------

Co-authored-by: willbouch <william.bouchard3@mail.mcgill.ca>
Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: fPolic <mainacc.polic@gmail.com>
Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Nicolas Gorga <nicogorga11@gmail.com>
Co-authored-by: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant