Skip to main content

shop.checkout.validatePromo(params)

Validates a promo code and returns the calculated discount amount. Call this when the customer applies a promo code — before placing the order.

Parameters

ParamTypeRequiredDescription
codestringThe promo code string entered by customer
subtotalnumberCart subtotal — required for minimum order checks
cart_itemsCartItem[]Required for product-specific promo codes

Response

Example — Promo code input UI

Passing promo to createOrder

Always pass both promo_code_id and discount_amount to createOrder. Passing only one will result in incorrect order totals.