Skip to content
Back to skills

Mercur Knowledge Patch

ASecurity

Mercur

  • 25 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 5, 2026
developmentgobashnodeapidatabasesecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill mercur-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mercur Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mercur Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-mercur-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-mercur-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mercur-knowledge-patch
description: Mercur
version: null
license: MIT
metadata:
  author: Nevaberry
---


# Mercur knowledge patch

Use this skill when upgrading or extending Mercur marketplace projects,
integrating storefronts, or working on seller operations and dashboard plugins.
The references contain topic-specific details and source attributions.

## Reference index

| Reference | Topics |
| --- | --- |
| [Architecture and setup](references/architecture-and-setup.md) | Core plugin, setup, runtime upgrades, migrations, storefront, caching, telemetry |
| [Blocks and CLI](references/blocks-and-cli.md) | Registry features, CLI commands, templates, project-local guides |
| [Catalog, inventory, and engagement](references/catalog-inventory-and-engagement.md) | Product changes, offers, lead times, conditions, stock, search, indexing, promotions, reviews |
| [Dashboards and typed clients](references/dashboards-and-client.md) | Authentication, client types, routes, layouts, forms, widgets, navigation |
| [Sellers and marketplace operations](references/sellers-and-operations.md) | Seller access, API validation, checkout, orders, shipping, returns, commissions, payouts, integrations |

## Breaking changes and upgrade checks

### Runtime, validators, and migrations

Mercur v2.4.0 requires Node 22.22+ and moves to Medusa 2.22.0. The release
recommends Node 24.22.1+ or 22.23.4+ for the October security updates. Run its
database migrations for payout tables, seller region links, order-group metadata,
and nullable seller lead times.

Mercur v2.4.1 uses Medusa 2.22.3: `BigNumber` and `MathBN` throw on invalid
input, and malformed `bodyParser.sizeLimit` throws when the route is hit.
For v2.4.1, run `medusa db:migrate` to create and backfill writable
`offer_seller` and `offer_product` links and hash existing member invites.
Then use `POST /admin/index/sync` to ingest existing sellers and offers.

The Zod 4 upgrade requires both schemas in record validators: replace
`z.record(value)` with a key/value form such as `z.record(z.string(), z.number())`.

### Payout package, workflow, and provider changes

Replace `@mercurjs/payout-stripe-connect` with `@mercurjs/stripe-connector-plugin`.
Configure the payout module with
`@mercurjs/stripe-connector-plugin/providers/payout-stripe-connect`.
If also using the plugin's payment provider, add `pp_stripe-connector_<id>`
to your regions.

Use `createOrderPayoutsWorkflow` in place of `createPayoutWorkflow`.
Custom `IPayoutProvider` implementations must rename `createPayoutAccount`
to `createAccount` and implement the now-required `retrieveAccount` and
`reversePayout`. Core uses one provider per marketplace, one payout per seller
order, and one reversal per subsequent refund. A connector or project integration
schedules payout runs, which reevaluate `on_hold` orders.
The migration changes `PayoutStatus.CANCELED` rows to `PayoutStatus.ABORTED`.

### Panel authentication and removed UI exports

Admin and Vendor use bearer tokens and keep independent logins on a shared API
host. Users must sign in again after upgrading. Custom page clients must remove
cookie-session `credentials: 'include'` and use `getAuthHeaders()` from
`@mercurjs/admin` or `@mercurjs/vendor` as request headers.

Replace the removed `Notifications` export from those packages with a widget in
`topbar.after` if a notifications bell is needed. Both panels expose
`topbar.before` and `topbar.after`; the built-in Cmd/Ctrl+N shortcut is removed.

### Storefront and vendor request contracts

In v2.3.5, `POST /store/carts/:id/line-items` rejects `unit_price` or
`compare_at_unit_price` with `400`. Remove both: prices come from the offer.
`GET /store/order-groups` accepts default fields but returns `400` for explicit
`orders.items.variant.product`; use `orders.items.product_handle` and
`orders.items.product_title`.

Vendor order edits ignore client-supplied prices. Vendor uploads accept images
only, and vendor stock-location validators drop `address_id`.
Member invite tokens appear only in create and resend responses; stored invites
use single-purpose hashes in `member_invite.token_hash`.

### Shipping profiles, seller access, and regions

Starting in v2.3.4, shipping profiles belong to the operator; vendors can read
and select them. Vendor `POST` and `DELETE` on `/vendor/shipping-profiles`,
the `seller_id` filter on `GET /admin/shipping-profiles`, and
`shipping-profile-seller-link` are removed.

Use lifecycle endpoints for `status` and `status_reason`, removed from
`POST /admin/sellers/:id`. Editing `is_premium` requires `sellers.premium:edit`.
Suspended or terminated sellers can access only `GET /vendor/sellers/me`
in the Vendor API.

Set new sellers' default region under Settings → Store; assign existing sellers
from the seller page or `POST /admin/sellers/:id/regions` with
`{ "add": ["reg_…"] }`. `GET /vendor/regions` lists assigned regions only.
`GET /vendor/regions/:id` returns `404` for unassigned regions; setting vendor
offer or shipping prices there returns `400`.

### Earlier integration changes

When upgrading through 1.0.0, check integrations that parse the changed order
representation, replace dependencies on the removed bundled HTTP client, and
verify the changed supported-country list covers your marketplace countries.
Templates provide `.ai/skills/migration-guide` for 1.x to 2.0 migration procedures.

## Checkout, commissions, and payout behavior

Cart payment captures starting in v2.3.6 give each seller order its own payment collection
and captured payment for its share of the same charge. Use standard Medusa
refund and cancellation routes or workflows; refunds are capped at that share.
Cancellation before capture preserves authorization for the cart's other orders.

Cart completion retries return the existing order group. In v2.4.1, retries also
reuse a group left behind by a crash before checkout finished. Failed completion
cancels or refunds payment, including payments captured by webhook.
`POST /store/carts/:id/complete` returns seller orders, and Mercur copies
`cart.metadata` into `order_group.metadata`.

Use `setOrderStatus` on `completeCartWithSplitOrdersWorkflow` for initial seller
order status. Both panels lock fulfillment, editing, returns, exchanges, claims,
captures, and refunds for `requires_action` orders and provide a status filter.
Implement `ICommissionProvider` for custom calculations; `setCommissionContext`
passes extra context. The default `system` provider uses the existing calculation.

In v2.3.7, `createPayouts` writes a `pending` row before the provider call and
defaults `idempotency_key` to the payout ID. `payout.created` fires while pending:
consumers should check `status` before treating it as sent. Run the migration
adding `processing` to allowed database values for `payout.status`.
Fully credit-covered orders have payouts held. In v2.4.1, payouts are capped
at the captured net amount and credit lines other than store credit are added back.

## Catalog, offers, and product changes

Offer prices must exceed zero; price fields accept a decimal comma. The Vendor
Create offers form skips variants without a price. `createOffersWorkflow` rejects
products restricted to other sellers or rejected by the operator; products
without a seller link remain open to all sellers.

`GET /store/offers` reports `effective_leadtime_to_ship`: offer value, seller
store value, then Settings → Marketplace default. New sellers start with
`default_leadtime_to_ship: null` and inherit that default; existing sellers can
clear their value to inherit it. Restore explicit values of `2` cleared by the
v2.3.9 canary migration. Offer `leadtime_to_ship` is business days to carrier handoff.

Run the v2.3.7 migrations for `offer_condition`, `offer.condition_id`, and the
default `new` condition. Operators manage `/admin/offer-conditions`; sellers
assign active conditions. Deletion is refused while offers use a condition.
Deactivation preserves assignments and blocks new ones.

`GET /store/offers` reports availability after subtracting reserved stock. Add-to-cart checks combined demand
per inventory item; v2.4.1 rejects a second offer for a variant already in the cart.
With `product_request` enabled, Products → Inbox lists new proposals and pending
edits or deletions through `GET /admin/product-changes`. Draft and proposed
product edits apply immediately. `DELETE /admin/products/:id` uses the product
change pipeline, errors while a change is pending, and soft-deletes seller offers.

## Dashboard and workflow extension points

`@mercurjs/dashboard-sdk` maps `src/pages/users/[id]/page.tsx` to `/users/:id`
and loads Medusa plugin UI extensions. Admin product detail and Vendor offer
detail use `LayoutComposer`. Plugins, the Medusa project, then the host app
contribute routes, widgets, `layouts/`, `_layouts.ts`, and `_navigation.ts`;
later layers take precedence. Custom-fields `list` and `forms` configure columns
and fields in embedded tables, spreadsheet grids, and built-in forms.

Use `RichTextEditor` and `RichText` from `@mercurjs/dashboard-shared` for product
description editing and rendering. Descriptions support formatting and images,
are sanitized on write and on the storefront, and support existing plain-text descriptions as stored.
`actionLocks` in `defineCustomFieldsConfig` can disable Edit order, Return,
Exchange, and Claim; the returned string becomes the tooltip.

Seller onboarding steps use the `onboarding` form zone. The required store
handle is checked by `GET /vendor/sellers/handle-availability`.
Starting in v2.3.4, explicitly enable seller roles and permissions when used:

```ts
withMercur({ featureFlags: { rbac: true } })
```

## Blocks and typed clients

Registry blocks copy source into the project. Optional IDs include `reviews`,
`product-import-export`, `team-management`, `wishlist`, `vendor-notifications`,
`algolia`, `requests`, and `vendor-chat`.

```bash
mercurjs init
mercurjs search -q "payment"
mercurjs view reviews
mercurjs add reviews wishlist vendor-chat
mercurjs diff reviews
mercurjs codegen
```

Generated route types supply inputs and outputs for `@mercurjs/client`, which
exposes `createClient` and `InferClientOutput`. Dynamic `$param` segments take
parameters in the argument object. Use `.mutate()` for typed mutation input.
`ClientError` exposes API error `code` for handling refusals.

## Storefront, caching, and telemetry

The Next 16 storefront uses Cache Components and anonymous catalog price fetches,
so customer-group prices appear only in the cart. Set `NEXT_PUBLIC_BASE_URL`
for canonical and structured-data URLs.

In v2.4.1, `withMercur` enables the Medusa Caching Module. Product-list TTLs are
300 seconds for Store and 60 for Admin and Vendor. Storage defaults to memory
per instance; `projectConfig.redisUrl` enables shared Redis caching.

```ts
withMercur({ featureFlags: { caching: false } })
```

The configuration above disables caching. Telemetry is disabled in CI, with
`NODE_ENV=test`, and in worker processes. `MERCUR_TELEMETRY_DEBUG=true` prints
payloads instead of sending them. Opt out with `MERCUR_DISABLE_TELEMETRY`,
`DO_NOT_TRACK`, or the following configuration:

```ts
withMercur({ projectConfig: { mercur: { telemetry: false } } })
```

Files in this skill

  • SKILL.md6.5 KB
  • coverage.json635 B
  • references/architecture-and-setup.md1.6 KB
  • references/blocks-and-cli.md1.1 KB
  • references/catalog-inventory-and-engagement.md2 KB
  • references/dashboards-and-client.md1.7 KB
  • references/sellers-and-operations.md3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.