Skip to main content
Skip to main content

createMoneyAmounts - Pricing Module Reference

Beta

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

This method creates money amounts.

Example

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

async function retrieveMoneyAmounts () {
const pricingService = await initializePricingModule()

const moneyAmounts = await pricingService.createMoneyAmounts([
{
amount: 500,
currency_code: "USD",
},
{
amount: 400,
currency_code: "USD",
min_quantity: 0,
max_quantity: 4
}
])

// do something with the money amounts or return them
}

Parameters

dataCreateMoneyAmountDTO[]Required
The money amounts to create.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<MoneyAmountDTO[]>Required
The list of created money amounts.
Was this section helpful?