chore(docs): Generated References (#6896)
Generated the following references: - `inventory` - `js_client` - `medusa` - `medusa_config` - `medusa_react` - `modules` - `payment` - `pricing` - `product` - `services` - `stock_location` - `tax_calculation` - `types` - `workflows` Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9fdced2c27
commit
68aa0971a2
@@ -40,7 +40,7 @@ async function addPriceListPrices (items: {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[AddPriceListPricesDTO](../../interfaces/pricing.AddPriceListPricesDTO.mdx)[]","description":"The prices to add for each price list.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceListId","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[PriceListPriceDTO](../../interfaces/pricing.PriceListPriceDTO.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)","description":"The currency of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPriceListPrices"/>
|
||||
<TypeList types={[{"name":"data","type":"[AddPriceListPricesDTO](../../interfaces/pricing.AddPriceListPricesDTO.mdx)[]","description":"The prices to add for each price list.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_list_id","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePriceListPriceDTO](../../interfaces/pricing.CreatePriceListPriceDTO.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPriceListPrices"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -90,11 +90,11 @@ async function addPricesToPriceSet (priceSetId: string) {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../interfaces/pricing.AddPricesDTO.mdx)","description":"The data defining the price set to add the prices to, along with the prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)","description":"The currency of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
|
||||
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../interfaces/pricing.AddPricesDTO.mdx)","description":"The data defining the price set to add the prices to, along with the prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The price set that the prices were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"money_amounts","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)","description":"The money amount's currency.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"[PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The details of the relation between the money amount and its associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addPrices"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The price set that the prices were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addPrices"/>
|
||||
|
||||
## addPrices(data, sharedContext?): Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)[]>
|
||||
|
||||
@@ -173,7 +173,7 @@ async function addPricesToPriceSet (priceSetId: string) {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../interfaces/pricing.AddPricesDTO.mdx)[]","description":"The data defining the prices to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)","description":"The currency of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
|
||||
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../interfaces/pricing.AddPricesDTO.mdx)[]","description":"The data defining the prices to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ async function addRulesToPriceSet (priceSetId: string) {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[AddRulesDTO](../../interfaces/pricing.AddRulesDTO.mdx)","description":"The data defining the price set to add the rules to, along with the rules to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add the rules to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to add to a price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[AddRulesDTO](../../interfaces/pricing.AddRulesDTO.mdx)","description":"The data defining the price set to add the rules to, along with the rules to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add the rules to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to add to a price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addRules"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The price set that the rules were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"money_amounts","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)","description":"The money amount's currency.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"[PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The details of the relation between the money amount and its associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addRules"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The price set that the rules were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addRules"/>
|
||||
|
||||
## addRules(data, sharedContext?): Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)[]>
|
||||
|
||||
@@ -73,7 +73,7 @@ async function addRulesToPriceSet (priceSetId: string) {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[AddRulesDTO](../../interfaces/pricing.AddRulesDTO.mdx)[]","description":"The data defining the rules to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add the rules to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to add to a price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[AddRulesDTO](../../interfaces/pricing.AddRulesDTO.mdx)[]","description":"The data defining the rules to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add the rules to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to add to a price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addRules"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ async function calculatePrice (priceSetId: string, currencyCode: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"filters","type":"[PricingFilters](../../interfaces/pricing.PricingFilters.mdx)","description":"The filters to apply on prices.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`[]","description":"IDs to filter prices.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"[PricingContext](../../interfaces/pricing.PricingContext.mdx)","description":"The context used to select the prices. For example, you can specify the region ID in this context, and only prices having the same value\nwill be retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"context","type":"`Record<string, string \\| number>`","description":"an object whose keys are the name of the context attribute. Its value can be a string or a number. For example, you can pass the `currency_code` property with its value being the currency code to calculate the price in.\nAnother example is passing the `quantity` property to calculate the price for that specified quantity, which finds a price set whose `min_quantity` and `max_quantity` conditions match the specified quantity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="calculatePrices"/>
|
||||
<TypeList types={[{"name":"filters","type":"[PricingFilters](../../interfaces/pricing.PricingFilters.mdx)","description":"The filters to apply on prices.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`[]","description":"IDs to filter prices.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"[PricingContext](../../interfaces/pricing.PricingContext.mdx)","description":"The context used to select the prices. For example, you can specify the region ID in this context, and only prices having the same value\nwill be retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"context","type":"`Record<string, string \\| number>`","description":"an object whose keys are the name of the context attribute. Its value can be a string or a number. For example, you can pass the `currency_code` property with its value being the currency code to calculate the price in.\nAnother example is passing the `quantity` property to calculate the price for that specified quantity, which finds a price set whose `min_quantity` and `max_quantity` conditions match the specified quantity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="calculatePrices"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -101,11 +101,11 @@ async function createPriceSet () {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../interfaces/pricing.CreatePriceSetDTO.mdx)","description":"The attributes of the price set to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)","description":"The currency of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../interfaces/pricing.CreatePriceSetDTO.mdx)","description":"The attributes of the price set to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"money_amounts","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)","description":"The money amount's currency.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"[PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The details of the relation between the money amount and its associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="create"/>
|
||||
|
||||
## create(data, sharedContext?): Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)[]>
|
||||
|
||||
@@ -188,7 +188,7 @@ async function createPriceSets () {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../interfaces/pricing.CreatePriceSetDTO.mdx)[]","description":"The price sets to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)","description":"The currency of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../interfaces/pricing.CreatePriceSetDTO.mdx)[]","description":"The price sets to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/createCurrencies
|
||||
sidebar_label: createCurrencies
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# createCurrencies - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `createCurrencies` method. This belongs to the Pricing Module.
|
||||
|
||||
This method is used to create new currencies.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
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
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)[]","description":"The currencies to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol","type":"`string`","description":"The symbol of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol_native","type":"`string`","description":"The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createCurrencies"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of created currencies.","expandable":false,"children":[{"name":"CurrencyDTO[]","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CurrencyDTO","type":"`object`","description":"A currency's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCurrencies"/>
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/createMoneyAmounts
|
||||
sidebar_label: createMoneyAmounts
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# createMoneyAmounts - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `createMoneyAmounts` method. This belongs to the Pricing Module.
|
||||
|
||||
This method creates money amounts.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
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
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateMoneyAmountDTO](../../interfaces/pricing.CreateMoneyAmountDTO.mdx)[]","description":"The money amounts to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CreateCurrencyDTO](../../interfaces/pricing.CreateCurrencyDTO.mdx)","description":"The currency of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol","type":"`string`","description":"The symbol of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol_native","type":"`string`","description":"The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createMoneyAmounts"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of created money amounts.","expandable":false,"children":[{"name":"MoneyAmountDTO[]","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"MoneyAmountDTO","type":"`object`","description":"A money amount's data. A money amount represents a price.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createMoneyAmounts"/>
|
||||
@@ -36,7 +36,7 @@ async function createPriceListRules (items: {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceListRuleDTO](../../interfaces/pricing.CreatePriceListRuleDTO.mdx)[]","description":"The price list rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rule_type_id","type":"`string`","description":"The ID of a rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string` \\| [RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","description":"The ID of a rule type or the details of an existing rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`string` \\| [PriceListDTO](../../interfaces/pricing.PriceListDTO.mdx)","description":"The ID of a price list or the details of an existing price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceListRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceListRuleDTO](../../interfaces/pricing.CreatePriceListRuleDTO.mdx)[]","description":"The price list rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rule_type_id","type":"`string`","description":"The ID of a rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string` \\| [RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","description":"The ID of a rule type or the details of an existing rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`string` \\| [PriceListDTO](../../interfaces/pricing.PriceListDTO.mdx)","description":"The ID of a price list or the details of an existing price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceListRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@ async function createPriceRules (
|
||||
priceSetId: string,
|
||||
ruleTypeId: string,
|
||||
value: string,
|
||||
priceSetMoneyAmountId: string,
|
||||
priceId: string,
|
||||
priceListId: string
|
||||
) {
|
||||
const pricingService = await initializePricingModule()
|
||||
@@ -38,7 +38,7 @@ async function createPriceRules (
|
||||
price_set_id: priceSetId,
|
||||
rule_type_id: ruleTypeId,
|
||||
value,
|
||||
price_set_money_amount_id: priceSetMoneyAmountId,
|
||||
price_id: priceId,
|
||||
price_list_id: priceListId
|
||||
}
|
||||
])
|
||||
@@ -49,7 +49,7 @@ async function createPriceRules (
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceRuleDTO](../../interfaces/pricing.CreatePriceRuleDTO.mdx)[]","description":"The price rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"`string` \\| [PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","description":"The ID or object of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"The ID of the associated rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string` \\| [RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","description":"The ID of the associated rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount_id","type":"`string`","description":"The ID of the associated price set money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"`string` \\| [PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The ID or object of the associated price set money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceRuleDTO](../../interfaces/pricing.CreatePriceRuleDTO.mdx)[]","description":"The price rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"The ID of the associated rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/createPriceSetMoneyAmountRules
|
||||
sidebar_label: createPriceSetMoneyAmountRules
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# createPriceSetMoneyAmountRules - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `createPriceSetMoneyAmountRules` method. This belongs to the Pricing Module.
|
||||
|
||||
This method is used to create new price set money amount rules. A price set money amount rule creates an association between a price set money amount and
|
||||
a rule type.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function createPriceSetMoneyAmountRules (priceSetMoneyAmountId: string, ruleTypeId: string, value: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const priceSetMoneyAmountRules = await pricingService.createPriceSetMoneyAmountRules([
|
||||
{
|
||||
price_set_money_amount: priceSetMoneyAmountId,
|
||||
rule_type: ruleTypeId,
|
||||
value
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the price set money amount rules or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreatePriceSetMoneyAmountRulesDTO](../../interfaces/pricing.CreatePriceSetMoneyAmountRulesDTO.mdx)[]","description":"The price set money amount rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_set_money_amount","type":"`string`","description":"The ID of a price set money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string`","description":"The ID of a rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price set money amount rule.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceSetMoneyAmountRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of created price set money amount rules.","expandable":false,"children":[{"name":"PriceSetMoneyAmountRulesDTO[]","type":"[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetMoneyAmountRulesDTO","type":"`object`","description":"A price set money amount rule's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createPriceSetMoneyAmountRules"/>
|
||||
@@ -38,7 +38,7 @@ async function createRuleTypes () {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateRuleTypeDTO](../../interfaces/pricing.CreateRuleTypeDTO.mdx)[]","description":"The rule types to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` \nmethod to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. \nThe higher the value, the higher the priority of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createRuleTypes"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateRuleTypeDTO](../../interfaces/pricing.CreateRuleTypeDTO.mdx)[]","description":"The rule types to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of the `calculatePrices`\nmethod to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context.\nThe higher the value, the higher the priority of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createRuleTypes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ async function removePriceSetRule (priceSetIds: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the price sets to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the price sets to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/deleteCurrencies
|
||||
sidebar_label: deleteCurrencies
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# deleteCurrencies - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteCurrencies` method. This belongs to the Pricing Module.
|
||||
|
||||
This method is used to delete currencies based on their currency code.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function deleteCurrencies () {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
await pricingService.deleteCurrencies(["USD"])
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"currencyCodes","type":"`string`[]","description":"Currency codes of the currencies to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCurrencies"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Resolves once the currencies are deleted.","expandable":false,"children":[]}]} sectionTitle="deleteCurrencies"/>
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/deleteMoneyAmounts
|
||||
sidebar_label: deleteMoneyAmounts
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# deleteMoneyAmounts - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteMoneyAmounts` method. This belongs to the Pricing Module.
|
||||
|
||||
This method deletes money amounts by their IDs.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function deleteMoneyAmounts (moneyAmountIds: string[]) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
await pricingService.deleteMoneyAmounts(
|
||||
moneyAmountIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the money amounts to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteMoneyAmounts"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Resolves when the money amounts are successfully deleted.","expandable":false,"children":[]}]} sectionTitle="deleteMoneyAmounts"/>
|
||||
@@ -31,7 +31,7 @@ async function deletePriceListRules (priceListRuleIds: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceListRuleIds","type":"`string`[]","description":"The IDs of the price list rules to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceListRules"/>
|
||||
<TypeList types={[{"name":"priceListRuleIds","type":"`string`[]","description":"The IDs of the price list rules to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceListRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ async function deletePriceLists (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceListIds","type":"`string`[]","description":"The IDs of the price lists to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceLists"/>
|
||||
<TypeList types={[{"name":"priceListIds","type":"`string`[]","description":"The IDs of the price lists to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceLists"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ async function deletePriceRules (
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceRuleIds","type":"`string`[]","description":"The IDs of the price rules to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceRules"/>
|
||||
<TypeList types={[{"name":"priceRuleIds","type":"`string`[]","description":"The IDs of the price rules to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/deletePriceSetMoneyAmountRules
|
||||
sidebar_label: deletePriceSetMoneyAmountRules
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# deletePriceSetMoneyAmountRules - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `deletePriceSetMoneyAmountRules` method. This belongs to the Pricing Module.
|
||||
|
||||
This method is used to delete price set money amount rules based on the specified IDs.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function deletePriceSetMoneyAmountRule (id: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
await pricingService.deletePriceSetMoneyAmountRules([id])
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the price set money amount rules to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceSetMoneyAmountRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Resolves once the price set money amount rules are deleted.","expandable":false,"children":[]}]} sectionTitle="deletePriceSetMoneyAmountRules"/>
|
||||
@@ -31,7 +31,7 @@ async function deleteRuleTypes (ruleTypeId: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ruleTypeIds","type":"`string`[]","description":"The IDs of the rule types to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteRuleTypes"/>
|
||||
<TypeList types={[{"name":"ruleTypeIds","type":"`string`[]","description":"The IDs of the rule types to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteRuleTypes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/removePrices
|
||||
sidebar_label: removePrices
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# removePrices - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `removePrices` method. This belongs to the Pricing Module.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="removePrices"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="removePrices"/>
|
||||
@@ -36,7 +36,7 @@ async function removePriceSetRule (priceSetId: string, ruleAttributes: []) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[RemovePriceSetRulesDTO](../../interfaces/pricing.RemovePriceSetRulesDTO.mdx)[]","description":"The rules to remove per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`string`[]","description":"The rules to remove. Each string is the `rule_attribute` of a rule to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="removeRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[RemovePriceSetRulesDTO](../../interfaces/pricing.RemovePriceSetRulesDTO.mdx)[]","description":"The rules to remove per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`string`[]","description":"The rules to remove. Each string is the `rule_attribute` of a rule to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="removeRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/restoreMoneyAmounts
|
||||
sidebar_label: restoreMoneyAmounts
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# restoreMoneyAmounts - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `restoreMoneyAmounts` method. This belongs to the Pricing Module.
|
||||
|
||||
This method restores soft deleted money amounts by their IDs.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function softDeleteMoneyAmounts (moneyAmountIds: string[]) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
await pricingService.softDeleteMoneyAmounts(
|
||||
moneyAmountIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the money amounts to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/pricing.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the money amounts. You can pass to its `returnLinkableKeys`\nproperty any of the money amount's relation attribute names, such as `price_set_money_amount`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreMoneyAmounts"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored, such as the ID of associated price set money amounts.\nThe object's keys are the ID attribute names of the money amount entity's relations, such as `price_set_money_amount_id`,\nand its value is an array of strings, each being the ID of the record associated with the money amount through this relation,\nsuch as the IDs of associated price set money amounts.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreMoneyAmounts"/>
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/restorePriceLists
|
||||
sidebar_label: restorePriceLists
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# restorePriceLists - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `restorePriceLists` method. This belongs to the Pricing Module.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceListIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/pricing.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restorePriceLists"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restorePriceLists"/>
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/restorePrices
|
||||
sidebar_label: restorePrices
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# restorePrices - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `restorePrices` method. This belongs to the Pricing Module.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/pricing.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restorePrices"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restorePrices"/>
|
||||
@@ -48,7 +48,7 @@ async function retrievePriceSet (priceSetId: string) {
|
||||
const priceSet = await pricingService.retrieve(
|
||||
priceSetId,
|
||||
{
|
||||
relations: ["money_amounts"]
|
||||
relations: ["prices"]
|
||||
}
|
||||
)
|
||||
|
||||
@@ -58,8 +58,8 @@ async function retrievePriceSet (priceSetId: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price set to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","description":"The configurations determining how the price set is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price set to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","description":"The configurations determining how the price set is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"money_amounts","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)","description":"The money amount's currency.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"[PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The details of the relation between the money amount and its associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="retrieve"/>
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/retrieveCurrency
|
||||
sidebar_label: retrieveCurrency
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# retrieveCurrency - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveCurrency` method. This belongs to the Pricing Module.
|
||||
|
||||
This method retrieves a currency by its code and and optionally based on the provided configurations.
|
||||
|
||||
## Example
|
||||
|
||||
A simple example that retrieves a currency by its code:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function retrieveCurrency (code: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const currency = await pricingService.retrieveCurrency(
|
||||
code
|
||||
)
|
||||
|
||||
// do something with the currency or return it
|
||||
}
|
||||
```
|
||||
|
||||
To specify attributes that should be retrieved:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function retrieveCurrency (code: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const currency = await pricingService.retrieveCurrency(
|
||||
code,
|
||||
{
|
||||
select: ["symbol_native"]
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the currency or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"code","type":"`string`","description":"The code of the currency to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)>","description":"The configurations determining how the currency is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a currency.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveCurrency"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved currency.","expandable":false,"children":[{"name":"CurrencyDTO","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)","optional":false,"defaultValue":"","description":"A currency's data.","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol","type":"`string`","description":"The symbol of the currency.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol_native","type":"`string`","description":"The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the currency.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieveCurrency"/>
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/retrieveMoneyAmount
|
||||
sidebar_label: retrieveMoneyAmount
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# retrieveMoneyAmount - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveMoneyAmount` method. This belongs to the Pricing Module.
|
||||
|
||||
This method retrieves a money amount by its ID.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a money amount by its ID:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function retrieveMoneyAmount (moneyAmountId: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const moneyAmount = await pricingService.retrieveMoneyAmount(
|
||||
moneyAmountId,
|
||||
)
|
||||
|
||||
// do something with the money amount or return it
|
||||
}
|
||||
```
|
||||
|
||||
To retrieve relations along with the money amount:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function retrieveMoneyAmount (moneyAmountId: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const moneyAmount = await pricingService.retrieveMoneyAmount(
|
||||
moneyAmountId,
|
||||
{
|
||||
relations: ["currency"]
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the money amount or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the money amount to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)>","description":"The configurations determining how a money amount is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a money amount.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveMoneyAmount"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved money amount.","expandable":false,"children":[{"name":"MoneyAmountDTO","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)","optional":false,"defaultValue":"","description":"A money amount's data. A money amount represents a price.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)","description":"The money amount's currency.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"code","type":"`string`","description":"The code of the currency.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol","type":"`string`","description":"The symbol of the currency.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol_native","type":"`string`","description":"The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the currency.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"[PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The details of the relation between the money amount and its associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of a price set money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the price\\_set\\_money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the price\\_set\\_money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the price\\_set\\_money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the price set money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","description":"The price set associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"price_list","type":"[PriceListDTO](../../interfaces/pricing.PriceListDTO.mdx)","description":"The price list associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_rules","type":"[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)[]","description":"The price rules associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"money_amount","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)","description":"The money amount associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} sectionTitle="retrieveMoneyAmount"/>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -53,8 +53,8 @@ async function retrievePriceRule (id: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price rule to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)>","description":"The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price rule.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePriceRule"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price rule to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)>","description":"The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price rule.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePriceRule"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved price rule.","expandable":false,"children":[{"name":"PriceRuleDTO","type":"[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)","optional":false,"defaultValue":"","description":"A price rule's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","description":"The associated price set.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"money_amounts","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_type_id","type":"`string`","description":"The ID of the associated rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","description":"The associated rule type.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount_id","type":"`string`","description":"The ID of the associated price set money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the price\\_rule was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the price\\_rule was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the price\\_rule was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrievePriceRule"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved price rule.","expandable":false,"children":[{"name":"PriceRuleDTO","type":"[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)","optional":false,"defaultValue":"","description":"A price rule's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","description":"The associated price set.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_type_id","type":"`string`","description":"The ID of the associated rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","description":"The associated rule type.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the price\\_rule was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the price\\_rule was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the price\\_rule was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrievePriceRule"/>
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/retrievePriceSetMoneyAmountRules
|
||||
sidebar_label: retrievePriceSetMoneyAmountRules
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# retrievePriceSetMoneyAmountRules - Pricing Module Reference
|
||||
|
||||
This 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:
|
||||
|
||||
```ts
|
||||
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:
|
||||
|
||||
```ts
|
||||
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
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price set money amount rule to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)>","description":"The configurations determining how the price set money amount rule is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price set money amount rule.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePriceSetMoneyAmountRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved price set money amount rule.","expandable":false,"children":[{"name":"PriceSetMoneyAmountRulesDTO","type":"[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)","optional":false,"defaultValue":"","description":"A price set money amount rule's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"[PriceSetMoneyAmountDTO](../../interfaces/pricing.PriceSetMoneyAmountDTO.mdx)","description":"The associated price set money amount.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of a price set money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the price\\_set\\_money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the price\\_set\\_money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the price\\_set\\_money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the price set money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","description":"The price set associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"price_list","type":"[PriceListDTO](../../interfaces/pricing.PriceListDTO.mdx)","description":"The price list associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_rules","type":"[PriceRuleDTO](../../interfaces/pricing.PriceRuleDTO.mdx)[]","description":"The price rules associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"money_amount","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)","description":"The money amount associated with the price set money amount.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"rule_type","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","description":"The associated rule type.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"value","type":"`string`","description":"The value of the price set money amount rule.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrievePriceSetMoneyAmountRules"/>
|
||||
@@ -53,8 +53,8 @@ async function retrieveRuleType (ruleTypeId: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the rule type to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)>","description":"The configurations determining how the rule type is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a rule type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveRuleType"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the rule type to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/pricing.FindConfig.mdx)<[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)>","description":"The configurations determining how the rule type is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a rule type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveRuleType"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved rule type.","expandable":false,"children":[{"name":"RuleTypeDTO","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","optional":false,"defaultValue":"","description":"A rule type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of \nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy \nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieveRuleType"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved rule type.","expandable":false,"children":[{"name":"RuleTypeDTO","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)","optional":false,"defaultValue":"","description":"A rule type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieveRuleType"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,40 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/softDeleteMoneyAmounts
|
||||
sidebar_label: softDeleteMoneyAmounts
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeleteMoneyAmounts - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `softDeleteMoneyAmounts` method. This belongs to the Pricing Module.
|
||||
|
||||
This method soft deletes money amounts by their IDs.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function softDeleteMoneyAmounts (moneyAmountIds: string[]) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
await pricingService.softDeleteMoneyAmounts(
|
||||
moneyAmountIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the money amounts to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/pricing.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteMoneyAmounts"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"Resolves when the money amounts are successfully deleted.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteMoneyAmounts"/>
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/softDeletePriceLists
|
||||
sidebar_label: softDeletePriceLists
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeletePriceLists - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `softDeletePriceLists` method. This belongs to the Pricing Module.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceListIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/pricing.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeletePriceLists"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeletePriceLists"/>
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/softDeletePrices
|
||||
sidebar_label: softDeletePrices
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeletePrices - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `softDeletePrices` method. This belongs to the Pricing Module.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"priceIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/pricing.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeletePrices"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeletePrices"/>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,45 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/updateCurrencies
|
||||
sidebar_label: updateCurrencies
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# updateCurrencies - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `updateCurrencies` method. This belongs to the Pricing Module.
|
||||
|
||||
This method is used to update existing currencies with the provided data. In each currency object, the currency code must be provided to identify which currency to update.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function updateCurrencies () {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const currencies = await pricingService.updateCurrencies([
|
||||
{
|
||||
code: "USD",
|
||||
symbol: "$",
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the currencies or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateCurrencyDTO](../../interfaces/pricing.UpdateCurrencyDTO.mdx)[]","description":"The currencies to update, each having the attributes that should be updated in a currency.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the currency to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol","type":"`string`","description":"The symbol of the currency.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"symbol_native","type":"`string`","description":"The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the currency.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCurrencies"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of updated currencies.","expandable":false,"children":[{"name":"CurrencyDTO[]","type":"[CurrencyDTO](../../interfaces/pricing.CurrencyDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CurrencyDTO","type":"`object`","description":"A currency's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateCurrencies"/>
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/updateMoneyAmounts
|
||||
sidebar_label: updateMoneyAmounts
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# updateMoneyAmounts - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `updateMoneyAmounts` method. This belongs to the Pricing Module.
|
||||
|
||||
This method updates existing money amounts.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function updateMoneyAmounts (moneyAmountId: string, amount: number) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const moneyAmounts = await pricingService.updateMoneyAmounts([
|
||||
{
|
||||
id: moneyAmountId,
|
||||
amount
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the money amounts or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateMoneyAmountDTO](../../interfaces/pricing.UpdateMoneyAmountDTO.mdx)[]","description":"The money amounts to update, each having the attributes that should be updated in a money amount.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The code of the currency to associate with the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateMoneyAmounts"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of updated money amounts.","expandable":false,"children":[{"name":"MoneyAmountDTO[]","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"MoneyAmountDTO","type":"`object`","description":"A money amount's data. A money amount represents a price.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateMoneyAmounts"/>
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/updatePriceListPrices
|
||||
sidebar_label: updatePriceListPrices
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# updatePriceListPrices - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `updatePriceListPrices` method. This belongs to the Pricing Module.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceListPricesDTO](../../interfaces/pricing.UpdatePriceListPricesDTO.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_list_id","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[UpdatePriceListPriceDTO](../../interfaces/pricing.UpdatePriceListPriceDTO.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The code of the currency to associate with the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceListPrices"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceListDTO](../../interfaces/pricing.PriceListDTO.mdx)[]>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceListDTO[]","type":"[PriceListDTO](../../interfaces/pricing.PriceListDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceListDTO","type":"`object`","description":"A price list's details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updatePriceListPrices"/>
|
||||
@@ -37,7 +37,7 @@ async function updatePriceListRules (items: {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceListRuleDTO](../../interfaces/pricing.UpdatePriceListRuleDTO.mdx)[]","description":"The attributes to update for each price list rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list rule to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"The ID of a rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string`","description":"The ID of a rule type or the details of an existing rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceListRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceListRuleDTO](../../interfaces/pricing.UpdatePriceListRuleDTO.mdx)[]","description":"The attributes to update for each price list rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list rule to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"The ID of a rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string`","description":"The ID of a rule type or the details of an existing rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceListRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ async function updatePriceLists (items: {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceListDTO](../../interfaces/pricing.UpdatePriceListDTO.mdx)[]","description":"The attributes to update in each price list.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The price list's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The price list's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `string` \\| `Date`","description":"The price list is enabled starting from this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `string` \\| `Date`","description":"The price list expires after this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[PriceListStatus](../../enums/pricing.PriceListStatus.mdx)","description":"The price list's status.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ACTIVE","type":"`\"active\"`","description":"The price list is enabled and its prices can be used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"DRAFT","type":"`\"draft\"`","description":"The price list is disabled, meaning its prices can't be used yet.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules_count","type":"`number`","description":"The number of rules associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceListRules](../../interfaces/pricing.CreatePriceListRules.mdx)","description":"The rules to be created and associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceLists"/>
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceListDTO](../../interfaces/pricing.UpdatePriceListDTO.mdx)[]","description":"The attributes to update in each price list.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The price list's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The price list's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `string`","description":"The price list is enabled starting from this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `string`","description":"The price list expires after this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[PriceListStatus](../../enums/pricing.PriceListStatus.mdx)","description":"The price list's status.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ACTIVE","type":"`\"active\"`","description":"The price list is enabled and its prices can be used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"DRAFT","type":"`\"draft\"`","description":"The price list is disabled, meaning its prices can't be used yet.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules_count","type":"`number`","description":"The number of rules associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceListRules](../../interfaces/pricing.CreatePriceListRules.mdx)","description":"The rules to be created and associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceLists"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async function updatePriceRules (
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceRuleDTO](../../interfaces/pricing.UpdatePriceRuleDTO.mdx)[]","description":"The price rules to update, each having attributes that should be updated in a price rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount_id","type":"`string`","description":"The ID of the associated price set money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceRules"/>
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceRuleDTO](../../interfaces/pricing.UpdatePriceRuleDTO.mdx)[]","description":"The price rules to update, each having attributes that should be updated in a price rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/updatePriceSetMoneyAmountRules
|
||||
sidebar_label: updatePriceSetMoneyAmountRules
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# updatePriceSetMoneyAmountRules - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `updatePriceSetMoneyAmountRules` method. This belongs to the Pricing Module.
|
||||
|
||||
This method is used to update price set money amount rules, each with their provided data.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function updatePriceSetMoneyAmountRules (id: string, value: string) {
|
||||
const pricingService = await initializePricingModule()
|
||||
|
||||
const priceSetMoneyAmountRules = await pricingService.updatePriceSetMoneyAmountRules([
|
||||
{
|
||||
id,
|
||||
value
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the price set money amount rules or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdatePriceSetMoneyAmountRulesDTO](../../interfaces/pricing.UpdatePriceSetMoneyAmountRulesDTO.mdx)[]","description":"The price set money amounts to update, each having the attributes to update in a price set money amount.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set money amount rule to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_money_amount","type":"`string`","description":"The ID of a price set money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string`","description":"The ID of a rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price set money amount rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceSetMoneyAmountRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of updated price set money amount rules.","expandable":false,"children":[{"name":"PriceSetMoneyAmountRulesDTO[]","type":"[PriceSetMoneyAmountRulesDTO](../../interfaces/pricing.PriceSetMoneyAmountRulesDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetMoneyAmountRulesDTO","type":"`object`","description":"A price set money amount rule's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updatePriceSetMoneyAmountRules"/>
|
||||
@@ -38,7 +38,7 @@ async function updateRuleTypes (ruleTypeId: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateRuleTypeDTO](../../interfaces/pricing.UpdateRuleTypeDTO.mdx)[]","description":"The rule types to update, each having the attributes that should be updated in a rule type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateRuleTypes"/>
|
||||
<TypeList types={[{"name":"data","type":"[UpdateRuleTypeDTO](../../interfaces/pricing.UpdateRuleTypeDTO.mdx)[]","description":"The rule types to update, each having the attributes that should be updated in a rule type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateRuleTypes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
displayed_sidebar: pricingReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/pricing/upsert
|
||||
sidebar_label: upsert
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# upsert - Pricing Module Reference
|
||||
|
||||
This documentation provides a reference to the `upsert` method. This belongs to the Pricing Module.
|
||||
|
||||
## upsert(data, sharedContext?): Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)[]>
|
||||
|
||||
This method updates existing price sets, or creates new ones if they don't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function upsertPriceSet (title: string) {
|
||||
const pricingModule = await initializePricingModule()
|
||||
|
||||
const createdPriceSets = await pricingModule.upsert([
|
||||
{
|
||||
prices: [{amount: 100, currency_code: "USD"}]
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the price sets or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpsertPriceSetDTO](../../interfaces/pricing.UpsertPriceSetDTO.mdx)[]","description":"The attributes to update or create for each price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"A string indicating the ID of the price set to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsert"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The updated and created price sets.","expandable":false,"children":[{"name":"PriceSetDTO[]","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetDTO","type":"`object`","description":"A price set's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsert"/>
|
||||
|
||||
## upsert(data, sharedContext?): Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>
|
||||
|
||||
This method updates the price set if it exists, or creates a new ones if it doesn't.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializePricingModule,
|
||||
} from "@medusajs/pricing"
|
||||
|
||||
async function upsertPriceSet (title: string) {
|
||||
const pricingModule = await initializePricingModule()
|
||||
|
||||
const createdPriceSet = await pricingModule.upsert(
|
||||
{
|
||||
prices: [{amount: 100, currency_code: "USD"}]
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the price set or return it
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpsertPriceSetDTO](../../interfaces/pricing.UpsertPriceSetDTO.mdx)","description":"The attributes to update or create for the new price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"A string indicating the ID of the price set to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../interfaces/pricing.CreatePricesDTO.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../interfaces/pricing.CreatePriceSetPriceRules.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../interfaces/pricing.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/pricing.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsert"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)>","optional":false,"defaultValue":"","description":"The updated or created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../interfaces/pricing.PriceSetDTO.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../interfaces/pricing.MoneyAmountDTO.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`number`","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`number`","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../interfaces/pricing.RuleTypeDTO.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="upsert"/>
|
||||
Reference in New Issue
Block a user