--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # Discount A discount can be applied to a cart for promotional purposes. ## Constructors ### constructor `**new Discount**()` A discount can be applied to a cart for promotional purposes. ## Properties `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "parent_discount", "type": "[Discount](Discount.mdx)", "description": "The details of the parent discount that this discount was created from.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "parent_discount_id", "type": "`string`", "description": "The Discount that the discount was created from. This will always be a dynamic discount", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "regions", "type": "[Region](Region.mdx)[]", "description": "The details of the regions in which the Discount can be used.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rule", "type": "[DiscountRule](DiscountRule.mdx)", "description": "The details of the discount rule that defines how the discount will be applied to a cart..", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rule_id", "type": "`string`", "description": "The ID of the discount rule that defines how the discount will be applied to a cart.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "starts_at", "type": "`Date`", "description": "The time at which the discount can be used.", "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": "usage_count", "type": "`number`", "description": "The number of times a discount has been used.", "optional": false, "defaultValue": "0", "expandable": false, "children": [] }, { "name": "usage_limit", "type": "``null`` \\| `number`", "description": "The maximum number of times that a discount can be used.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "valid_duration", "type": "``null`` \\| `string`", "description": "Duration the discount runs between", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> ## Methods ### upperCaseCodeAndTrim `Private **upperCaseCodeAndTrim**(): void` #### Returns `void`