New featureSDK v0.3.2
Discounts — new feature
Storefronts can now apply automatic discounts and promo codes to a cart before checkout. Automatic discounts apply to every qualifying booking without customer action; code discounts require the customer to enter a promo code.What’s in the release:POST /storefront/cart/discount-code— apply a promo code to the cartDELETE /storefront/cart/discount-code— remove the applied code- Every cart-returning endpoint now includes an
appliedDiscounts[]field and per-line-itemdiscounts[], so you can render a “you saved $X” summary - Order line items carry
OrderLineItemDiscountrecords for accurate receipts and refunds
- Two methods: automatic (applies silently) and code (customer enters a promo code).
- Two value formats: percentage or fixed amount.
- Two scopes: line-item (distributed across qualifying lines) and order (applied to the cart total).
- Targeting by product, staff member, location, and an include add-ons toggle. Discounts re-evaluate on every cart mutation.
- Scheduling: always-active, weekly-recurring windows, or fixed date ranges — evaluated in the store’s timezone.
- Requirements: minimum purchase amount and/or appointment duration range.
- Stacking: combinable discounts stack; exclusive discounts apply the single best deal for the customer.
- Usage caps: total redemption cap and per-customer cap. Usage is tracked per store on multi-store and Shopify setups.
@opencals/storefront-sdk
v0.3.2 and higher: