Skip to content

Coupons & Discounts

POST /api/v1/coupons
Authorization: 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
}
TypeDescriptionExample
percentagePercentage off20% off
fixed_amountFixed amount off$10 off
free_shippingFree shippingFree shipping
POST /api/v1/carts/:id/coupons
{ "code": "SUMMER20" }
GET /api/v1/coupons
Authorization: Bearer <admin_token>
PATCH /api/v1/coupons/:id
Authorization: Bearer <admin_token>
DELETE /api/v1/coupons/:id
Authorization: Bearer <admin_token>
  • Code must be unique
  • Usage limit checked against usage_count
  • Expiry date checked
  • Minimum order amount checked
  • One coupon per cart