www/apps/api-reference/README.md
The Medusa API Reference website is built with Next.js 13. You can learn more about contributing here.
The OpenAPI Specs under the directory specs are automatically generated by our OAS CLI tool. So, contributions should be made in the files under packages/medusa/src/api instead of directly making changes to the generated spec files.
The reference uses real page paths (not hash anchors):
/api/{area} (e.g. /api/store)/api/{area}/{section} (e.g. /api/store/authentication)/api/{area}/{tag} (e.g. /api/store/carts)/api/{area}/{tag}/{operation} (e.g. /api/store/carts/get-a-cart)/api/{area}/{tag}/schemaPaths are computed by shared helpers in packages/docs-utils (getApiRefTagSlug,
getApiRefOperationSlug, getApiRefPath) and materialized into
generated/api-ref-paths.mjs by scripts/prepare.mjs (yarn prep). That file
also holds apiRefRedirects, an old-hash → new-path map used by the client-side
HashRedirector (mounted on the area index) to redirect legacy #-anchor links.
The operation slug is derived from the operation's x-sidebar-summary (falling
back to summary, then operationId). Because it's summary-derived, editing a
summary can change the operation's URL. The redirect map is regenerated on every
build to absorb such changes; set x-sidebar-summary on an operation to pin a
stable slug. Slugs are de-duplicated within a tag (-2, -3, ...).