Skip to main content
Skip to main content

createCurrencies - Pricing Module Reference

Beta

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

This method is used to create new currencies.

Example

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

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

const currencies = await pricingService.createCurrencies([
{
code: "USD",
symbol: "$",
symbol_native: "$",
name: "US Dollar",
}
])

// do something with the currencies or return them
}

Parameters

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

Returns

PromisePromise<CurrencyDTO[]>Required
The list of created currencies.
Was this section helpful?