retrievePriceSetMoneyAmountRules - Pricing Module Reference
BetaThis documentation provides a reference to the retrievePriceSetMoneyAmountRules
method. This belongs to the Pricing Module.
This method is used to a price set money amount rule by its ID based on the provided configuration.
Example
A simple example that retrieves a price set money amount rule by its ID:
import {
initialize as initializePricingModule,
} from "@medusajs/pricing"
async function retrievePriceSetMoneyAmountRule (id: string) {
const pricingService = await initializePricingModule()
const priceSetMoneyAmountRule = await pricingService.retrievePriceSetMoneyAmountRules(id)
// do something with the price set money amount rule or return it
}
To specify relations that should be retrieved:
import {
initialize as initializePricingModule,
} from "@medusajs/pricing"
async function retrievePriceSetMoneyAmountRule (id: string) {
const pricingService = await initializePricingModule()
const priceSetMoneyAmountRule = await pricingService.retrievePriceSetMoneyAmountRules(id, {
relations: ["price_set_money_amount"]
})
// do something with the price set money amount rule or return it
}
Parameters
id
stringRequiredThe ID of the price set money amount rule to retrieve.
The configurations determining how the price set money amount rule is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a price set money amount rule.
select
or relations
, accept the
attributes or relations associated with a price set money amount rule.Returns
The retrieved price set money amount rule.
Was this section helpful?