Coupons & Discounts
Create coupon
Section titled “Create coupon”POST /api/v1/couponsAuthorization: Bearer <admin_token>{ "code": "SUMMER20", "type": "percentage", "value": 20, "minimum_order_amount": 50.00, "maximum_discount_amount": 100.00, "usage_limit": 100, "expires_at": "2024-12-31T23:59:59Z", "is_active": true}Coupon types
Section titled “Coupon types”| Type | Description | Example |
|---|---|---|
percentage | Percentage off | 20% off |
fixed_amount | Fixed amount off | $10 off |
free_shipping | Free shipping | Free shipping |
Apply coupon to cart
Section titled “Apply coupon to cart”POST /api/v1/carts/:id/coupons{ "code": "SUMMER20" }List coupons
Section titled “List coupons”GET /api/v1/couponsAuthorization: Bearer <admin_token>Update coupon
Section titled “Update coupon”PATCH /api/v1/coupons/:idAuthorization: Bearer <admin_token>Delete coupon
Section titled “Delete coupon”DELETE /api/v1/coupons/:idAuthorization: Bearer <admin_token>Validation rules
Section titled “Validation rules”- Code must be unique
- Usage limit checked against
usage_count - Expiry date checked
- Minimum order amount checked
- One coupon per cart