Coupons API

Create and manage discount codes.

Overview

Create and manage discount codes programmatically.

Endpoints

MethodPathDescription
GET/api/admin/promotionsList all promotions
POST/api/admin/promotionsCreate a new promotion
GET/api/admin/promotions/[id]Get promotion details with usage stats
PUT/api/admin/promotions/[id]Update a promotion
DELETE/api/admin/promotions/[id]Delete a promotion

Validating a code at checkout

The storefront uses POST /api/promotions/validate to check if a discount code is valid, active, and hasn't exceeded its usage limit before applying it to the cart.

Was this article helpful?

Coupons API β€” Discount Code Management | KATURA