github medusajs/medusa v2.11.2
v2.11.2: Product variant images and Index management API

one day ago

Highlights

Product variant images

This release introduces images on product variants. It is now possible to assign images to individual product variants, enabling fully scoped variant-specific photos. In addition to this, a variant can have a thumbnail among its associated images.

The behavior of images is as follows:

  • Images are added to products
  • Variant images are chosen among the product images
  • Upon retrieving variants, the variant images will contain:
    • Product images that are not associated with any variants
    • Images that are associated with the variant

For example, let's imagine you have three product images:

  1. White t-shirt
  2. Black t-shirt
  3. T-shirt on a model

You want to share the third image across variants, and have the white image on the white variants and black image on the black variants. To achieve this, you associate the white t-shirt image with the white variants, and the black t-shirt image with the black variants. The third image should have no associated variants.

This in turn would result in the following response on variants:

{
  "id": "prod_1234",
  "variants": [
    {
      "id": "var_1234",
      "title": "White t-shirt"
      "images": [
        { "id": "img_1234", "url": "http://images.com/white-t-shirt.png" },
        { "id": "img_1234", "url": "http://images.com/t-shirt-on-model.png" }
      ]
    },
    {
      "id": "var_4321",
      "title": "Black t-shirt"
      "images": [
        { "id": "img_1234", "url": "http://images.com/black-t-shirt.png" },
        { "id": "img_1234", "url": "http://images.com/t-shirt-on-model.png" }
      ]
    },
  ]
}

Managing variant images

Two endpoints have been added:

  • POST /admin/products/:id/variants/:variant_id/images/batch — Batch manage image associations for a specific variant.
  • POST /admin/products/:id/images/:image_id/variants/batch — Batch manage variant associations for a specific image.

Admin UI

You can manage product variant images from the product page in the admin dashboard. There are two ways to manage these.

From the root-level product page, you can associate a single image with many variants:

From the variant-specific page, you can associate many images with a single variant:

Data model changes

The following are changes to the data models in the Product Module required to enable this feature:

  • ProductVariant now includes a many-to-many relationship with ProductImage.
  • A new ProductVariantProductImage pivot entity manages these associations.

Therefore, please make sure to run migrations after upgrading to the new version:

npx medusa db:migrate

Index management API

This release adds a new API for managing the index, enabling you to trigger synchronization and retrieve detailed information about the last sync. The update improves visibility and control over the indexing process.

API

  • GET /admin/index/details — Retrieve index metadata, including entity type, status, last synced key, and last update timestamp.
  • POST /admin/index/sync — Trigger synchronization from last synced data
    • Supports optional options:
      • { strategy: "full" } — Perform a full sync
      • { strategy: "reset" } — Truncate tables and perform a fresh sync.

Faster price updates

This release brings performance improvements to the Pricing Module, significantly speeding up price list and price set updates. The changes focus on optimizing database queries, reducing redundant computations, and streamlining price normalization and upsert operations.

Features

  • feat(core-flows,product,types): scoped variant images by @fPolic in #13623
  • feat(medusa,types): product variant store endpoints by @fPolic in #13730
  • feat(product): build variant images when retrieving product by @fPolic in #13731
  • feat(index): Add http/module api to interact with the index engine by @adrien2p in #13869
  • feat: Implement medusa payments provider by @sradevski in #13772
  • feat(dashboard): variant images list thumbnail + refactor form state management by @fPolic in #13905

Bugs

Documentation

Chores

  • chore(docs): Update version in documentation (automated) by @github-actions[bot] in #13854
  • chore(docs): Generated DML JSON files (automated) by @github-actions[bot] in #13855
  • chore(docs): Updated UI Reference (automated) by @github-actions[bot] in #13856
  • chore(docs): Generated References (automated) by @github-actions[bot] in #13857
  • chore: fixes to http and request types for products by @shahednasser in #13833
  • chore: fixes to HTTP and request types for API Keys by @shahednasser in #13819
  • chore: fixes to HTTP and request types for promotions by @shahednasser in #13820
  • chore: fixes to HTTP and request types for carts by @shahednasser in #13821
  • chore: fixes to http and request types for orders (2) by @shahednasser in #13823
  • chore: fixes to http and request types for orders (3) by @shahednasser in #13824
  • chore: fixes to http and request types for customers by @shahednasser in #13825
  • chore: fixes to http and request types for fulfillment by @shahednasser in #13826
  • chore: fixes to http and request types for inventory by @shahednasser in #13827
  • chore: fixes to http and request types for users by @shahednasser in #13828
  • chore: fixes to http and request types for payments by @shahednasser in #13830
  • chore: fixes to http and request types for payment and regions by @shahednasser in #13831
  • chore: fixes to http and request types for sales channes, taxes, and store by @shahednasser in #13832
  • chore: fixes to http and request types for orders (1) by @shahednasser in #13822
  • chore: Inject sandbox handle in cloud config by @olivermrbl in #13879
  • chore(types,notification): Make template nullable on emails by @olivermrbl in #13889

Other Changes

New Contributors

Full Changelog: v2.11.1...v2.11.2

Don't miss a new medusa release

NewReleases is sending notifications on new releases.