Discount codes with rates, conditions and collections.
Discount codes belong where prices and rules live. Here you can try both a whole-catalog code and a collection-scoped code.
Follow the flow
- Add a demo product to your cart and open ReAI checkout.
- Enter REAI-DEMO10: 10% off “Test payments & support”. Gift cards are excluded.
- Or try REAI-MAGI20 on Office magic: 20% when eligible product lines total at least 100 kr before discount.
- See the new ReAI total. A code does not automatically discount products outside the selected collection.
Three rules to try
REAI-DEMO10 applies to “Test payments & support”. Gift cards receive no percentage discount. REAI-MAGI20 applies only to Office magic with at least 100 kr in eligible products. REAI-FRAKT demonstrates a free-shipping code without a percentage discount; it saves no shipping on these digital products. Codes apply only to this demo market.
Schedule, scope and disable
The management API supports start/end times, enablement, percentage, minimum spend, collection scope and free shipping. Minimum spend counts eligible product lines before discount and shipping. A qualifying code can waive shipping even when only part of the cart qualifies for the product discount.
Compare-at price is a separate field
Monday courage has an illustrative reference price from the ReAI price list. compareAtPrice is display data, not a discount code or proof of a previous selling price. The product’s price is the amount before any checkout discount. Both amounts here are fictional demonstrations.
Why is the code not in the session request?
The Site API creates checkout from variant IDs, quantities and a return URL. The shopper adds or removes a code in hosted checkout. The store does not calculate discounts locally, and ReAI rejects an invalid code.
# Operator example: scoped code for this Site and market
POST /api/sites/{siteId}/commerce/markets/{marketId}/discounts
{ "code": "REAI-MAGI20", "percentage": 20,
"collectionId": "<office-magic collection UUID>",
"minimumProductGross": 100, "startsAt": "<ISO instant>" }