Skip to main content
This module contains all pricing-related models used for managing product prices, discounts, charges, and promotional offers.

Core Pricing Models

PriceDTO

Base price model used throughout the system.
FieldTypeRequiredDescription
amountnumberYesPrice amount as float (e.g., 12.99)
currencystringYesCurrency code: “CHF”, “EUR”, or “USD”
Consider using Decimal for monetary amounts to avoid float precision issues in production systems.

PriceOverrideDTO

Model for conditional pricing that overrides base prices.
FieldTypeRequiredDescription
idstringYesPrice override identifier
pricePriceDTOYesOverride price
variantRefsstring[]NoApplicable variant references
daysOfWeekDaysOfWeekDTONoDays when override is active
startTimeTimeDTONoDaily start time for override
endTimeTimeDTONoDaily end time for override
startDatedatetimeNoOverride start date
endDatedatetimeNoOverride end date

Price Override Examples

  • Happy Hour: Reduced prices during specific hours
  • Weekend Specials: Different pricing on weekends
  • Seasonal Pricing: Time-limited price changes
  • Variant Pricing: Different prices for different product variants

Restriction Models

RestrictionDTO

Model for defining availability and usage restrictions.
FieldTypeRequiredDescription
idstringYesRestriction identifier
enabledbooleanNoWhether restriction is active
variantRefsstring[]NoApplicable variant references
daysOfWeekDaysOfWeekDTONoDays when restriction applies
startTimeTimeDTONoDaily start time for restriction
endTimeTimeDTONoDaily end time for restriction
startDatedatetimeNoRestriction start date
endDatedatetimeNoRestriction end date
minOrderAmountPriceDTONoMinimum order amount required
maxPerOrdernumberNoMaximum quantity per order
maxPerCustomernumberNoMaximum quantity per customer

Restriction Types

  • Time-Based: Available only during certain hours or days
  • Order Value: Requires minimum order amount
  • Quantity Limits: Maximum quantities per order or customer
  • Seasonal: Available only during specific date ranges

Discount Models

AppliedDiscountBaseDTO

Base model for all applied discount types.
FieldTypeRequiredDescription
idstringYesApplied discount identifier
namestringYesDiscount display name
discountIdstringYesOriginal discount ID
priceOffPriceDTOYesAmount discounted

AppliedPercentageDiscountDTO

Model for percentage-based discounts.
FieldTypeRequiredDescription
type”percentage”YesDiscount type identifier
percentagenumberYesPercentage discount applied
appliedToTotalPriceDTOYesTotal amount discount applied to
Extends: AppliedDiscountBaseDTO

AppliedFixedDiscountDTO

Model for fixed amount discounts.
FieldTypeRequiredDescription
type”fixed”YesDiscount type identifier
Extends: AppliedDiscountBaseDTO

FreeItemDTO

Model for free items in promotional discounts.
FieldTypeRequiredDescription
skuInternalIdstringYesFree item SKU identifier
quantitynumberYesQuantity of free items
originalPricePriceDTOYesOriginal price of free items

AppliedBOGODiscountDTO

Model for buy-one-get-one discounts.
FieldTypeRequiredDescription
type”bogo”YesDiscount type identifier
freeItemsFreeItemDTO[]YesItems received for free
Extends: AppliedDiscountBaseDTO

AppliedFreeProductDiscountDTO

Model for free product promotions.
FieldTypeRequiredDescription
type”free_product”YesDiscount type identifier
freeItemFreeItemDTOYesFree product details
Extends: AppliedDiscountBaseDTO

AppliedFreeShippingDiscountDTO

Model for free shipping promotions.
FieldTypeRequiredDescription
type”free_shipping”YesDiscount type identifier
originalDeliveryFeePriceDTOYesOriginal delivery fee amount
Extends: AppliedDiscountBaseDTO

AppliedDiscountDTO

Union type for all applied discount variants.
type AppliedDiscountDTO = 
  | AppliedPercentageDiscountDTO
  | AppliedFixedDiscountDTO  
  | AppliedBOGODiscountDTO
  | AppliedFreeProductDiscountDTO
  | AppliedFreeShippingDiscountDTO

Discount Configuration Models

PricingEffectDTO

Enum defining how discounts affect pricing.
ValueDescription
price_offReduces price by fixed amount
percentage_offReduces price by percentage

DiscountDTO

Model for configuring discount promotions.
FieldTypeRequiredDescription
idstringYesDiscount identifier
namestringYesDiscount display name
pricingEffectPricingEffectDTOYesHow discount affects pricing
refstringNoDiscount reference code
descriptionstringNoDiscount description
restrictionRestrictionDTONoUsage restrictions
couponCodesstring[]NoRequired coupon codes
pricingValuenumber | PriceDTONoDiscount amount or percentage
imageIdsstring[]NoPromotional image identifiers
tagsstring[]NoDiscount tags

Discount Types

Percentage Discounts

  • Apply percentage reduction to order total
  • Can be limited by maximum discount amount
  • Common for general promotions

Fixed Amount Discounts

  • Apply fixed amount reduction
  • Simple to understand for customers
  • Good for specific value promotions

BOGO (Buy One Get One)

  • Free items when purchasing qualifying products
  • Flexible quantity ratios (buy 2 get 1, etc.)
  • Popular for food promotions

Free Product

  • Specific free items added to order
  • No purchase requirement
  • Used for sampling and gifts

Free Shipping

  • Waives delivery fees
  • Can have minimum order requirements
  • Encourages larger orders

Charge Models

ChargeType

Enum defining types of additional charges.
ValueDescription
deliveryDelivery service charge
payment_feePayment processing fee
tipGratuity/tip charge
taxTax charge
otherOther miscellaneous charges

ChargeDTO

Model for additional charges applied to orders.
FieldTypeRequiredDescription
idstringYesCharge identifier
namestringYesCharge display name
typeChargeTypeYesType of charge
refstringNoCharge reference code
pricePriceDTONoCharge amount

Charge Examples

  • Delivery Fee: Standard delivery charges
  • Service Fee: Platform service charges
  • Payment Fee: Credit card processing fees
  • Tips: Gratuity for delivery drivers
  • Taxes: Government taxes and duties

Pricing Logic

Price Calculation Order

  1. Base Price: Start with product/SKU base price
  2. Price Overrides: Apply any active price overrides
  3. Options: Add selected option prices
  4. Quantity: Multiply by item quantity
  5. Discounts: Apply applicable discounts
  6. Charges: Add additional charges
  7. Final Total: Calculate order total

Discount Priority

When multiple discounts could apply:
  1. Customer-Specific: Loyalty discounts first
  2. Coupon Codes: Explicit customer codes
  3. Automatic: Best available automatic discount
  4. Stacking Rules: Some discounts can stack, others are exclusive

Time-Based Pricing

All pricing models support time-based conditions:
  • Daily Hours: Different prices during business hours
  • Days of Week: Weekend vs weekday pricing
  • Date Ranges: Seasonal or promotional periods
  • Variants: Location or menu variant specific pricing
The pricing system is designed to be flexible and support complex promotional strategies while maintaining transparency for customers.
  • TimeDTO - Used for time-based restrictions
  • DaysOfWeekDTO - Used for day-based restrictions
  • OrderDTO - Uses pricing models for order totals