--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # DiscountRule A discount rule defines how a Discount is calculated when applied to a Cart. ## Constructors ### constructor `**new DiscountRule**()` A discount rule defines how a Discount is calculated when applied to a Cart. ## Properties `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "type", "type": "[DiscountRuleType](../enums/DiscountRuleType.mdx)", "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free\\_shipping` for shipping vouchers.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "value", "type": "`number`", "description": "The value that the discount represents; this will depend on the type of the discount", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> ## Methods ### beforeInsert `Private **beforeInsert**(): void` #### Returns `void`