Medusa v1.3.1: PriceList API, Promotions API, Migrations, And More!
Tags: opensource, news, javascript, webdev
Published: 2022-06-02 13:15:14

This week a new version of [Medusa](https://github.com/medusajs/medusa) has been released. If you’re not familiar with Medusa, it’s an open source headless commerce platform that recently passed 10K stars on GitHub in less than a year!

Earlier this month we released version 1.3.0 with many new features, then followed it up by version 1.3.1 this week for some fixes and enhancements.

We also published a new release for the [Medusa Admin](https://docs.medusajs.com/admin/quickstart) that add a few new UI elements and functionalities.

This article highlights some of the changes and additions that this update holds. If you’re interested in learning more details about the release check out [our longer release post](https://medusajs.com/blog/medusa-1-3-1-release/).

## PriceList API

The addition of the `PriceList` API adds another layer of customization and extendibility to Medusa by allowing merchants to have even more control over the pricing of products. They can apply specific prices based on advanced conditions and rules.

This change comes, of course, with a new interface in our Admin that allows creating and editing price lists with many handy configurations.

![PriceList API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55kr705vo4bu32s8zg6f.gif)

## Promotions API

The use case of Promotions API has expanded from standard promotions to advanced promotions conditions. For example, a merchant might want to apply discounts for their VIP customers.

This API will also open the doors for providing better integration with third-party discount services and tools for even more powerful features.

![Promotions API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmi724syawegshll0v7l.gif)

## Migrations

With these new features, we’ve introduced 2 Migration scripts that are necessary to run after Medusa’s upgrade.

To learn more about this check out the [upgrade guide for version 1.3.0](https://docs.medusajs.com/advanced/backend/upgrade-guides/1-3-0).

## Clean Up

As part of our update to the Medusa Admin, we’ve cleaned it up to remove all unused dependencies and components.

## New API References

We’re excited to announce two new features in our documentation: the Services Reference and the Events Reference.

Services can be used in any of your custom endpoints, services, and subscribers. The service reference gives developers a better understanding of what services are available to use and what are some of their methods.

![Services Reference](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o14d1fp8bg0f4ztnh51j.gif)

The event's reference shows developers what events they can listen to in subscribers, when they are triggered, and what data payload can be expected along with the event.

![Events Reference](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ma4va422oxm184ubtbe.png)

## How to Upgrade?

If you want to upgrade your Medusa server, run the following command to update the necessary dependencies:

```bash
npm install @medusajs/medusa@latest medusa-interfaces@latest
```

Also, read the upgrade guide for version [1.3.0](https://docs.medusajs.com/advanced/backend/upgrade-guides/1-3-1/).

## Coming Soon: Advanced Next.js Storefront

> P.S: We’re currently hosting a contest related to customizing the existing Next.js storefront, and the winner receives a Medusa t-shirt! [Read more about it here.](https://dev.to/medusajs/customize-the-homepage-of-our-nextjs-storefront-and-win-a-t-shirt-from-medusa-2fde)

We’re working on a new Next.js starter with a cleaner design and more advanced features. This new starter will allow developers to enable or disable features just by changing the store configurations.

Some of the features that will be added and are available to be switched on or off include search using the [MeiliSearch plugin](https://docs.medusajs.com/add-plugins/meilisearch); customer accounts with the ability to make changes to their profiles and accounts such as change addresses and see order history; customer self-service returns and exchange; multi-regional support, and more!

![Advanced Next.js Storefront](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8wp9una1cewtn6cej95a.png)