Skip to main content
Skip to main content

createPriceLists - Pricing Module Reference

Beta

This documentation provides a reference to the createPriceLists method. This belongs to the Pricing Module.

This method is used to create price lists.

Example

import {
initialize as initializePricingModule,
} from "@medusajs/pricing"

async function createPriceList (items: {
title: string
description: string
starts_at?: string
ends_at?: string
}[]) {
const pricingService = await initializePricingModule()

const priceList = await pricingService.createPriceLists(items)

// do something with the price lists or return them
}

Parameters

dataCreatePriceListDTO[]Required
The details of each price list to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PriceListDTO[]>Required
The created price lists.
Was this section helpful?