retrievePriceList - Pricing Module Reference
BetaThis documentation provides a reference to the retrievePriceList
method. This belongs to the Pricing Module.
This method is used to retrieve a price list by its ID.
Example
A simple example that retrieves a price list by its ID:
import {
initialize as initializePricingModule,
} from "@medusajs/pricing"
async function retrievePriceList (priceListId: string) {
const pricingService = await initializePricingModule()
const priceList = await pricingService.retrievePriceList(
priceListId
)
// do something with the price list or return it
}
To specify relations that should be retrieved:
import {
initialize as initializePricingModule,
} from "@medusajs/pricing"
async function retrievePriceList (priceListId: string) {
const pricingService = await initializePricingModule()
const priceList = await pricingService.retrievePriceList(
priceListId,
{
relations: ["price_set_money_amounts"]
}
)
// do something with the price list or return it
}
Parameters
id
stringRequiredThe ID of the price list to retrieve.
config
FindConfig<PriceListDTO>The configurations determining how the price list is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a price list.
config
FindConfig<PriceListDTO>select
or relations
, accept the
attributes or relations associated with a price list.Returns
The retrieved price list.
Was this section helpful?