Skip to main content

Interface: PriceModifier

Defines a price modification applied to a cart.

This interface represents a specific adjustment to the cart's total price, such as a discount, surcharge, or other price modification. Price modifiers provide transparency about how the final price was calculated and what factors affected the pricing.

Price modifiers can come from various sources including pricing rules, promotions, customer-specific arrangements, quantity breaks, or special program eligibility.

Properties​

description​

description: string

Detailed explanation of what this price modification represents.

This provides additional context about the modifier beyond its name, potentially including eligibility criteria, calculation details, or other relevant information.


name​

name: string

Short display name for this price modification.

This is the primary label shown to users when displaying price modifications, and should clearly identify the type of adjustment being applied (e.g., "Volume Discount", "Loyalty Program", "Rush Fee").


priceModifier​

priceModifier: object

Technical details about how the price modification is calculated.

calculatedValue​

calculatedValue: number

The actual amount of the adjustment after calculation.

This is the final value that is applied to the order total, calculated based on the mode, type, and modifier value.

mode​

mode: "FIXED" | "PERCENTAGE"

The calculation method used for this modifier.

Specifies whether the adjustment is a percentage of the base price or a fixed amount. This affects how the modifier value is interpreted and applied.

modifierValue​

modifierValue: number

The base value used for calculating the adjustment.

Depending on the mode, this represents either a percentage rate (e.g., 10% discount) or a fixed amount (e.g., $25 surcharge).

type​

type: "DISCOUNT" | "ADDITION"

Whether this is a positive or negative adjustment.

Indicates if this modifier adds to the price (ADDITION) or reduces it (DISCOUNT). This determines whether the calculated value increases or decreases the total price.