Product Relations
Cross-sells and upsells for Medusa 2: hand-picked, ordered product lists per product, admin widget and store API.
Quality score
3/4Security, Passed5/5
- No install scripts, Passed
- No known vulnerabilities, Passed
- No malware reports, Passed
- No secrets in the package, Passed
- No obfuscation, Passed
Compatibility, Not checked1/5 · 4 not checked
- Medusa version ranges, Passed
- Clean installNot checked
- BuildNot checked
- MigrationsNot checked
- StartupNot checked
- We haven't installed this plugin into a test Medusa project yet.
Maintenance, Passed5/5
- Public repository, Passed
- Recent release, Passed
- Up to date with Medusa, Passed
- Tests in CI, Passed
- Open-source license, Passed
Documentation, Passed3/3
- Setup instructions, Passed
- English, Passed
- Environment variables, Passed
Version 1.0.0 was checked on Medusa 2.23.1 on Nov 29, 2026. How Gorgo verifies plugins →
Maturity
NewFirst stable release on Nov 29, 2026, 1 version, releases in 1 of the last 12 months. How Gorgo measures maturity →
@topo-js/medusa-plugin-product-relations
Cross-sells and upsells for Medusa 2.23+: hand-picked, ordered product lists per product, edited on the admin product page and served by store routes that return products priced and shaped like core's .
- Cross sell: products that go with this one ("Complete your purchase").
- Upsell: step-up versions or better alternatives ("Upgrade your choice").
Install
npx medusa db:migrateData model
Module . Tables are prefixed with so they never clash with your own.
(): one per product and type, unique on .
| Field | Type | Notes |
|---|---|---|
| text | the product whose page shows the list | |
| | | ||
| text, nullable, translatable | null lets the storefront show its own default | |
| text, nullable, translatable | ||
| JSON, nullable | ||
(): a product of a list.
| Field | Type | Notes |
|---|---|---|
| text | through a read-only link | |
| text, nullable | set: only that variant is offered | |
| number | order in the list, from 0 | |
| JSON, nullable |
A deleted product loses its lists and leaves every other product's lists (subscriber on ).
Store API
Both routes take the same query params as core's (, , , ) and run the same middlewares, so products come with , tax amounts and exactly as there, and accept the same (for example ). A signed-in customer gets their customer group prices.
A product is suggested only if it is published, sold in the publishable key's sales channel, has a price (when prices are requested), has stock or allows backorders, is not the product itself or already in the cart, and was not suggested earlier in the same response.
| Route | Query | Response |
|---|---|---|
| (one or both, default both), (products in total), | ||
| (default ), |
is for the product page: cross sell then upsell, each with its and (in the request locale). A list with nothing to sell is left out, so an empty array means "render nothing". With , prices use the cart and its products are never suggested.
is for the cart page and the panel after an add to cart: the cross sells of the cart's products, in cart order, without the products already in it. An unknown or completed cart is a 404.
Admin API
| Route | Description |
|---|---|
| : the product's lists, each with its in order and their | |
| Saves one list: |
replaces the list's products (the array order is the rank); , and left out keep their value, or an empty text clears them. (cross sell only) also adds this product to the end of each related product's cross sells, unless it is already there. It fails with a 400, writing nothing, on a product related to itself, a product listed twice, an unknown product or a variant of another product.
Admin
On the product page (), one section per list, Cross sell then Upsell, with the list's title (or "Storefront default"), description and products in order (draft products and variant-only relations are flagged). Each section's menu has:
- Edit title and description: a drawer with from , validated with Zod. The title and description are translatable in Settings > Translations.
- Edit products: a focus modal with the dashboard's product table (search, pagination, checkboxes) and the selected products beside it, reordered by dragging (mouse or keyboard). On cross sells, a switch also adds this product to the selected products' cross sells ().
UI texts in English and Spanish (), keys under .
Workflows
Exported from . Each step compensates on failure.
| Workflow | Hook | Hook input |
|---|---|---|
Extend
Add your own data the way Medusa extends products: validate on and save it in the workflow hook.
Development
The integration tests boot a bare Medusa app () that loads the plugin from its build, so run first. They create their own database with , , and (default on ).
To try it in a Medusa app while developing, use here and in the app, then here to rebuild on change.
Release
The workflow publishes with npm Trusted Publishing, no token: the package's settings on npmjs.com trust this repository and .
License
MIT

