Highlights
This release introduces migrations, so remember to run migrations after installing the version:
npx medusa db:migrate
In addition to migrations with schema changes, this release also runs a data migration script added in this PR. The script populates a new version column on order line item adjustments, setting it to the latest version of the associated order.
Custom order display ID
This release introduces a custom_display_id field on orders, along with a hook for automatically generating the value at order creation.
The key changes are:
- New
custom_display_idcolumn on orders - Order Module now accepts a
generateCustomDisplayIdfunction in its module options
The generation can be used like so:
// medusa-config.ts
defineConfig({
// ...
modules: [{
resolve: "@medusajs/medusa/order",
options: {
generateCustomDisplayId: async function (order: OrderTypes.CreateOrderDTO, sharedContext: Context) {
// Return your custom display id
}
}
}]
})We intentionally kept the existing display_id column unchanged. Migrating it from an auto-incrementing integer to text would be a significant breaking change.
To show the new custom_display_id in the Admin dashboard, you can use the View Configurations feature to customize columns on the order table:
// medusa-config.ts
defineConfig({
// ...
featureFlags: {
view_configurations: true
}
})Promotion limit
This release expands promotion configuration capabilities by introducing a limit enforced on promotions. Previously, limits could only be enforced at the campaign level. You can now configure limits at three levels:
- Campaign-level: limit the number of times a certain promotion in a campaign can be used
- Campaign-level per customer/email: limit the number of times a certain promotion in a campaign can be used by a specific customer or email
- Promotion-level: limit the number of times a certain promotion can be used
Promotions on exchanges
This release adds the option to carry over promotions to exchanges on orders. When creating an exchange, you often want the original promotions applied to the outbound items to avoid recharging the customer. You can now opt into this by enabling "Carry over promotions" during the exchange flow.
Admin user deletion
This release adds the ability for admin users to delete other users. This is a temporary solution ahead of a proper permissions system, which we plan to work on in the near future.
Limiting event emission
This release improves event management, reducing unnecessary memory and processing overhead by only emitting events and adding to event queues whenever there are subscribers to the events.
Shipping Option Type relation
Breaking change
The relationship between Shipping Options and Shipping Option Types has changed from one-to-one to many-to-one. This change should be deemed more a fix, than an actual change of the feature, as this was always the intention. However, it is a breaking change, since the property name has changed.
Features
- feat(dashboard): Improve error messages during file upload by @juanzgc in #13991
- feat(medusa): allow users deletion by @NicolasGorga in #13960
- feat(dashboard): include product material in product general section by @NicolasGorga in #14021
- feat(promotion): Add metadata column to promotion by @juanzgc in #13999
- feat(dashboard): show promo tooltip on the edit flows by @fPolic in #14121
- feat: carry over promotions toggle on exchanges by @fPolic in #14128
- feat: promotion usage limit by @fPolic in #13760
Bugs
- fix(dashboard): fix import for ptPT locale by @willbouch in #13986
- fix(dashboard): Limit file uploads to 1MB by @juanzgc in #13981
- fix(core-flows,types): change doc for upload file functions by @willbouch in #13809
- fix(): Lock process payment to prevent ingesting payment processing t… by @adrien2p in #13977
- fix(dashboard): update orders page filters to match interface expected by old DataTable component by @NicolasGorga in #13994
- fix(product, types): add missing types for variant images and thumbnails by @shahednasser in #14026
- fix(dashboard): use order version 1 for the initial node of activity timeline by @NicolasGorga in #13997
- fix(medusa): preprocess
versionas number in AdminGetOrdersOrderParams validator by @NicolasGorga in #13996 - fix(): Proper schema usage when running migrations by @adrien2p in #14036
- fix(draft-order): Update copy phone number by @juanzgc in #14044
- fix(): Identify step that should require a save on checkpoint by @adrien2p in #14037
- fix(dashboard): reference global vite bin from scripts by @fPolic in #14049
- fix(core-flows): avoid overriding customer and region from setPricingContext hook result by @NicolasGorga in #14022
- fix(payment): Double idempotent capture called with auto capture beha… by @adrien2p in #14073
- chore(): Update glob package by @adrien2p in #14083
- fix(medusa): avoid throwing on error on set step failure endpoint by @NicolasGorga in #14066
- fix(core-flows): prevent completing cart from webhook when order already exists by @NicolasGorga in #14108
- fix(core-flows): Add discountable properties in queried fields to avoid overriding discountable properties when set by @NicolasGorga in #14105
- fix(): Workflow engine redis worker instance in worker mode by @adrien2p in #14099
- fix(product): add missing decorators to updateProductOptionValues method by @shahednasser in #14060
- fix: Compute "virtual" adjustments for order previews by @olivermrbl in #13306
- fix(core-flows): lock mark as delivered fulfillment/order flows by @NicolasGorga in #14111
- fix(orchestration): fetch fields from link entities by @carlos-r-l-rodrigues in #14097
- fix(js-sdk,types,medusa): add HTTP types for update order change API route by @shahednasser in #14169
- fix(core-flows): create reservations on draft order conversion to regular order by @NicolasGorga in #14010
- fix(fulfillment): make relationship between SO and SO type M:1 by @fPolic in #14061
- fix(product): Update performance issue by @adrien2p in #14150
Documentation
- chore(docs): Updated UI Reference (automated) by @github-actions[bot] in #13968
- docs: fix command bar position outside modal in category images guide by @shahednasser in #13987
- docs: fix broken links in OAS by @shahednasser in #14000
- docs-utils: fix type error in react-docs-generator by @shahednasser in #14002
- docs: add missing middlewares in category images tutorial by @shahednasser in #14001
- docs: added kapa logo + link to mcp server by @shahednasser in #14005
- docs: add JSON-LD schemas to docs by @shahednasser in #14007
- docs: generate OAS for 2.11.3 by @shahednasser in #13973
- docs: mobile app guide with react native and expo by @shahednasser in #13982
- fix some typos by @dhanushreddy291 in #14017
- docs: add a copy button to AI assistant answers by @shahednasser in #14052
- docs: fix required properties marked as optional in OAS with allOf schemas by @shahednasser in #14062
- docs: add redis prerequisite for Caching Module by @shahednasser in #14051
- docs: emails in cloud by @shahednasser in #14040
- docs: fix filters in meilisearch and algolia guides by @shahednasser in #14098
- docs: updates to billing details by @shahednasser in #14096
- docs: fix callback validation for third-party authentication by @shahednasser in #14109
- docs: customer tiers tutorial by @shahednasser in #14122
- docs: add keywords to cloud, fixes to installation and Index Module docs by @shahednasser in #14129
- docs: document locks for nested workflows by @shahednasser in #14130
- docs: fix events payloads by @shahednasser in #14131
- docs: add guide on clearing cache by @shahednasser in #14133
- docs: handle product status change in MeiliSearch and Algolia guides by @shahednasser in #14141
- docs: fixed keywords usage in some pages by @shahednasser in #14140
- docs: mention managed inventory toggle in multi-part product user guide by @shahednasser in #14142
- chore(): Update posthog by @adrien2p in #14144
- docs: update recipes and tutorials to support locks and idempotency by @shahednasser in #14151
- docs: clarify how links with cascade deletion are deleted by @shahednasser in #14155
- Only two options to interact with Medusa application by @2azo in #14162
- docs: fix highlights in digital products recipe by @shahednasser in #14171
Chores
- chore(docs): Update version in documentation (automated) by @github-actions[bot] in #13966
- chore(docs): Generated DML JSON files (automated) by @github-actions[bot] in #13967
- chore(docs): Generated References (automated) by @github-actions[bot] in #13969
- chore(medusa): fix query http type parameter for get claim route by @shahednasser in #13974
- chore: cleanup/improve bootstrap by @adrien2p in #14023
- chore: Configure auth on JS-SDK in dashboard by @olivermrbl in #14013
- chore(): Remove lodash.set entirely by @adrien2p in #14041
- chore(): Upgrade vit to non vulnerable one by @adrien2p in #14042
- chore(order): custom display id by @adrien2p in #14024
- chore(event-bus-*): Do not emit if no subscribers: by @adrien2p in #14084
- chore(): Improve product list when there is a single sales channel by @adrien2p in #14082
- chore: fix payloads of events in TSDocs + description of emitEventStep by @shahednasser in #14132
- chore(): Promotion auto managed joiner config by @adrien2p in #14115
- chore: Update medusa exec worker mode by @adrien2p in #14145
- chore: improve and add TSDocs for next release by @shahednasser in #14170
- chore: improve completeCartWorkflow TSDocs by @shahednasser in #14153
- chore: change 2.11.4 to 2.12.0 in TSDocs by @shahednasser in #14174
Other Changes
- feat(admin-vite-plugin,dashboard): support for react-router's splat and optional segments by @leobenzol in #13547
- feat(dashboard): add pt-PT translation and register locale by @ZeB4la in #13935
- feat(admin-*,dashboard): i18n labels for menu item extensions by @leobenzol in #13843
- fix(core-flows): update SendNotificationsStepInput by @leobenzol in #13979
- fix(core-flows): payment error handling by @SGFGOV in #13876
- feat(admin): add custom admin route ranking feature by @bqst in #13946
- Fix Node.js version text in installation page by @khai-pi in #14015
- feat(payment-stripe): OXXO payment provider support with configurable expiration by @angelbanderasudg in #13805
- fix(fulfillment) Variants changed from managed inventory to unmanaged are now fulfillable by @vethan in #14056
- add from to notification model by @peterlgh7 in #14102
- Add provider data to notifications by @peterlgh7 in #14104
- chore(): Add new regression tests to the remote joiner by @adrien2p in #14119
- Fix not in promotion rule empty value validation by @pepijn-vanvlaanderen in #14172
- fix(dashboard): enable sorting by default based on apiColumn state - FIXES 14166 by @adevinwild in #14167
- Add missing order metadata for create fulfillment by @pepijn-vanvlaanderen in #14028
New Contributors
- @ZeB4la made their first contribution in #13935
- @khai-pi made their first contribution in #14015
- @dhanushreddy291 made their first contribution in #14017
- @angelbanderasudg made their first contribution in #13805
- @2azo made their first contribution in #14162
Full Changelog: v2.11.3...v2.12.0