docs: document how prices are stored in Medusa (#13362)
This commit is contained in:
@@ -166,27 +166,27 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
prices: [
|
||||
// default price
|
||||
{
|
||||
amount: 500,
|
||||
amount: 5,
|
||||
currency_code: "EUR",
|
||||
rules: {},
|
||||
},
|
||||
// prices with rules
|
||||
{
|
||||
amount: 400,
|
||||
amount: 4,
|
||||
currency_code: "EUR",
|
||||
rules: {
|
||||
region_id: "reg_123",
|
||||
},
|
||||
},
|
||||
{
|
||||
amount: 450,
|
||||
amount: 4.5,
|
||||
currency_code: "EUR",
|
||||
rules: {
|
||||
city: "krakow",
|
||||
},
|
||||
},
|
||||
{
|
||||
amount: 500,
|
||||
amount: 5,
|
||||
currency_code: "EUR",
|
||||
rules: {
|
||||
city: "warsaw",
|
||||
@@ -194,7 +194,7 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
},
|
||||
},
|
||||
{
|
||||
amount: 200,
|
||||
amount: 2,
|
||||
currency_code: "EUR",
|
||||
min_quantity: 100,
|
||||
},
|
||||
@@ -232,10 +232,10 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
const price = {
|
||||
id: "<PRICE_SET_ID>",
|
||||
is_calculated_price_price_list: false,
|
||||
calculated_amount: 500,
|
||||
calculated_amount: 5,
|
||||
|
||||
is_original_price_price_list: false,
|
||||
original_amount: 500,
|
||||
original_amount: 5,
|
||||
|
||||
currency_code: "EUR",
|
||||
|
||||
@@ -299,10 +299,10 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
const price = {
|
||||
id: "<PRICE_SET_ID>",
|
||||
is_calculated_price_price_list: false,
|
||||
calculated_amount: 500,
|
||||
calculated_amount: 5,
|
||||
|
||||
is_original_price_price_list: false,
|
||||
original_amount: 500,
|
||||
original_amount: 5,
|
||||
|
||||
currency_code: "EUR",
|
||||
|
||||
@@ -353,7 +353,7 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
items: [
|
||||
{
|
||||
id: "item_1",
|
||||
quantity: 200,
|
||||
quantity: 2,
|
||||
// assuming the price set belongs to this variant
|
||||
variant_id: "variant_1",
|
||||
// ...
|
||||
@@ -375,10 +375,10 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
const price = {
|
||||
id: "<PRICE_SET_ID>",
|
||||
is_calculated_price_price_list: false,
|
||||
calculated_amount: 200,
|
||||
calculated_amount: 2,
|
||||
|
||||
is_original_price_price_list: false,
|
||||
original_amount: 200,
|
||||
original_amount: 2,
|
||||
|
||||
currency_code: "EUR",
|
||||
|
||||
@@ -433,12 +433,12 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
type: "sale",
|
||||
prices: [
|
||||
{
|
||||
amount: 400,
|
||||
amount: 4,
|
||||
currency_code: "EUR",
|
||||
price_set_id: priceSet.id,
|
||||
},
|
||||
{
|
||||
amount: 450,
|
||||
amount: 4.5,
|
||||
currency_code: "EUR",
|
||||
price_set_id: priceSet.id,
|
||||
},
|
||||
@@ -466,10 +466,10 @@ const priceSet = await pricingModuleService.createPriceSets({
|
||||
const price = {
|
||||
id: "<PRICE_SET_ID>",
|
||||
is_calculated_price_price_list: true,
|
||||
calculated_amount: 400,
|
||||
calculated_amount: 4,
|
||||
|
||||
is_original_price_price_list: false,
|
||||
original_amount: 500,
|
||||
original_amount: 5,
|
||||
|
||||
currency_code: "EUR",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user