- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- User Guide
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- User Guide
createPriceSets - Pricing Module Reference
This documentation provides a reference to the createPriceSets
method. This belongs to the Pricing Module.
Note: You should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.
createPriceSets(data, sharedContext?): Promise<PriceSetDTO>#
This method is used to create a new price set.
Example#
To create a default price set, don't pass any rules. For example:
To create a price set and associate it with rule types:
1const priceSet = await pricingModuleService.createPriceSets({2 prices: [3 {4 amount: 300,5 currency_code: "EUR",6 rules: {7 region_id: "PL",8 city: "krakow",9 },10 },11 {12 amount: 400,13 currency_code: "EUR",14 rules: {15 region_id: "PL",16 },17 },18 {19 amount: 450,20 currency_code: "EUR",21 rules: {22 city: "krakow",23 },24 },25 ],26})
Parameters#
The attributes of the price set to create.
Returns#
Promise
Promise<PriceSetDTO>The created price set.
Promise
Promise<PriceSetDTO>createPriceSets(data, sharedContext?): Promise<PriceSetDTO[]>#
This method is used to create multiple price sets.
Example#
1const priceSets = await pricingModuleService.createPriceSets([2 // default price set3 {4 rules: [],5 prices: [6 {7 amount: 500,8 currency_code: "USD",9 min_quantity: 0,10 max_quantity: 4,11 rules: {},12 },13 {14 amount: 400,15 currency_code: "USD",16 min_quantity: 5,17 max_quantity: 10,18 rules: {},19 },20 ],21 },22 // price set with rules23 {24 prices: [25 {26 amount: 300,27 currency_code: "EUR",28 rules: {29 region_id: "PL",30 city: "krakow",31 },32 },33 {34 amount: 400,35 currency_code: "EUR",36 rules: {37 region_id: "PL",38 },39 },40 {41 amount: 450,42 currency_code: "EUR",43 rules: {44 city: "krakow",45 },46 },47 ],48 },49])
Parameters#
data
CreatePriceSetDTO[]The price sets to create.
data
CreatePriceSetDTO[]Returns#
Promise
Promise<PriceSetDTO[]>The list of created price sets.
Promise
Promise<PriceSetDTO[]>Was this page helpful?