github medusajs/medusa v2.10.0
v2.10.0: Draft Orders, Free shipping promotion, and Shipping Option Types

latest releases: v2.10.1, @medusajs/workflows-sdk@2.10.1, @medusajs/workflow-engine-redis@2.10.1...
5 days ago

Highlights

This release contains breaking changes, so please read the release notes carefully. The breaking changes are all the result of fixing behavior that has not worked as intended until now.

Idempotency in our Workflow Engine

Warning

Breaking change

The idempotent configuration on workflows no longer retains executions in the database after completion, unless a retention time is specified. Up until now, if the idempotent flag was set, workflow executions were retained indefinitely, which was never the intention. The intention was to make a workflow idempotent for the duration of its execution, and only longer if the retention time was explicitly configured.

As part of this change, we are enabling the idempotent flag on all cart workflows to prevent concurrent mutations on cart operations.

Return type of methods in MedusaService

Warning

Breaking change

The return types of update and create in MedusaService have been corrected to properly handle the different shapes of inputs.

The behavior is now as follows:

createT({ ... }): T
createT([{ ... }]): T[]

updateT({ id: "br_1234", name: "Hermes"  }): T
updateT([{ id: "br_1234", name: "Hermes" }, { id: "br_4321", name: "Loewe"  }]): T[]
updateT({ selector: { country_of_origin: "France" }, data: { language: "French" }}): T[]

Compensating emitEventsStep

Warning

Breaking change

Previously, if the emitEventStep queued an event and the workflow later failed, the compensating flow would emit that queued event instead of removing it. This caused unexpected behavior during rollback.

With this change, when a workflow is compensated, all queued events emitted in the workflow are cleared. This was the intended behavior from the get-go, but the bug was only discovered recently.

If you want to keep the previous behavior, you can create your own version of the emitEventsStep without a compensation step.

Manage Shipping Option Types in Admin

Warning

Breaking change

The admin dashboard now supports managing shipping option types, making it easier to categorize options such as Standard and Express.

Key updates:

  • Settings: New "Shipping Option Types" page (accessible from "Locations & Shipping")
  • Create and update types with label, description, and code
  • Shipping option creation flow: Choose a type from a dropdown
  • Shipping option update flow: Change a type from a dropdown

This brings shipping option management to the dashboard, aligning it with existing backend support.

The introduction of Shipping Option Types comes with a migration, cleaning up old dummy types from the database. Up until now, we've created dummy types for Shipping Options as part of their creation flow. These types were placeholders, which is why we are now replacing them.

The migration will do the following:

  • Delete all Shipping Option Types with code type-code from the database
  • Disassociate these types from Shipping Options
  • Create a new Shipping Option Type named "Default" with code default
  • Associate the default type with Shipping Options

This migration will only affect Shipping Options that reference the type-code type. If you have been using your own types, they will remain as is. On the contrary, if you have been relying on type-code, this is a breaking change.

Draft Orders

The new Draft Order plugin adds flexible order management directly in Medusa Admin. Store admins can create, edit, and finalize orders through a dedicated UI, while developers gain a new primitive for building custom workflows.

Key features:

  • Create and manage draft orders from Medusa Admin
  • Support for custom pricing, line items, and shipping methods
  • Streamlined handling of B2B and complex sales

The Draft Order plugin is installed by default from version >=2.10.0. It is usable for version >=2.4.0 but requires explicit installation and registration.

Read more in our documentation.

Free shipping Promotions

This release introduces support for free shipping promotions available directly from the admin dashboard. You can apply free shipping to specific Shipping Option Types, e.g., "Standard", but not "Express".

Custom Logger Support

You can now replace the default logger with your own implementation by providing a class that follows the Logger interface.

Example:

// medusa-config.ts
import { MyCustomLogger } from "./custom-logger"

export default defineConfig({
  // ...
  logger: MyCustomLogger,
})

The logger should implement the Logger interface.

Shipping Option Tax Rates

You can now create tax rates specifically for shipping options within tax regions, similar to product-specific tax rates.

Metadata for Product Tags

The product tag domain now supports metadata, with a UI for creating and managing metadata values.

Features

Bugs

  • fix(utils): fix promotion case of each allocation not applying its total amount by @riqwan in #13199
  • fix(utils): auto generated update method return by @carlos-r-l-rodrigues in #13225
  • fix(dashboard): table inclusive date filter by @fPolic in #13053
  • fix(dashboard): create product selected inventory item display by @fPolic in #13111
  • fix(core-flows, dashboard, types): improve allocation flows on Admin by @fPolic in #12572
  • fix(dashboard): zero in float currency inputs by @fPolic in #13267
  • fix(dashboard): show fulfilment option on SO edit by @fPolic in #13269
  • fix(fulfillment): Geozone constraints builder by @olivermrbl in #13282
  • fix(): Cart operation should calculate item prices accounting for quantity by @adrien2p in #13251
  • fix(fulfillment): don't cascade shipping option delete to shipping option type by @fPolic in #13280
  • fix: Add created_at to workflow execution filtering typings by @sradevski in #13295
  • fix(dashboard): handle large resource count in tax rule override edit form by @fPolic in #13297
  • fix(medusa): fetching a product without a category with categories filed passed by @fPolic in #13020
  • fix(core-flows): pass backorder flag when recreating reservations after fulfilment cancelation by @fPolic in #13076
  • fix(core-flows): list order shipping options param type by @fPolic in #13316

Documentation

Chores

Other Changes

New Contributors

Full Changelog: v2.9.0...v2.10.0

Don't miss a new medusa release

NewReleases is sending notifications on new releases.