Creating Promotions
Promotions let you create targeted offers to drive customer engagement.
Basic Promotion
Section titled “Basic Promotion”-
Define the promotion
Terminal window curl -X POST https://api.storelayer.io/v1/promotions \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"name": "10% Off First Purchase","type": "discount","discountType": "percentage","discountValue": 10,"conditions": {"newCustomersOnly": true}}' -
Add a coupon code (optional)
Terminal window curl -X POST https://api.storelayer.io/v1/promotions/{id}/coupons \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"code": "WELCOME10","maxUsesPerCustomer": 1}' -
Validate at checkout
Terminal window curl -X POST https://api.storelayer.io/v1/coupons/validate \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"code": "WELCOME10","customerId": "cust_abc123"}'
Promotion with Complex Conditions
Section titled “Promotion with Complex Conditions”{ "name": "VIP Summer Sale", "type": "discount", "discountType": "fixed", "discountValue": 2000, "conditions": { "startDate": "2025-06-01", "endDate": "2025-08-31", "minSpend": 5000, "customerMetadata": { "tier": "gold" } }, "maxRedemptions": 500}Points Multiplier
Section titled “Points Multiplier”Double or triple points for specific actions:
{ "name": "Weekend 3x Points", "type": "points_multiplier", "multiplier": 3, "conditions": { "dayOfWeek": ["saturday", "sunday"], "minSpend": 1000 }}