Skip to main content
The Admin Coupons API lets you build and manage the full lifecycle of discount coupons — from creating a new promotion with a fixed-amount or percentage discount, to updating limits and validity windows, to soft-deleting a coupon when a promotion ends and inspecting every redemption it generated. Coupons are validated at checkout against the customer’s cart total, usage limits, and validity window before the discount is applied.
All endpoints under /admin/coupons require an authenticated session with the ADMIN or SUPER_ADMIN role. For every POST, PATCH, and DELETE request, first call GET /auth/csrf-token and pass the returned token in the x-csrf-token header.

List Coupons

Retrieve a paginated list of all coupons. Filter by computed status, search by code or description, and sort by usage, value, or dates.

Query Parameters

integer
default:"1"
Page number (1-based).
integer
default:"20"
Results per page. Range: 1–100.
Free-text search across coupon codes.
string
Filter by computed coupon status. Accepted values: ACTIVE, INACTIVE, EXPIRED, USAGE_LIMIT_REACHED.
string
default:"false"
Pass "true" to include soft-deleted coupons in results.
string
default:"-created_at"
Sort field. Prefix with - for descending. Accepted values: code, -code, discount_value, -discount_value, usage_count, -usage_count, starts_at, -starts_at, expires_at, -expires_at, created_at, -created_at.

Response

boolean
Always true on a 200 response.
array
Array of coupon objects. See the coupon object fields below.
object
Pagination metadata.
Example — list all active coupons sorted by usage

Create Coupon

Create a new discount coupon. Specify the discount type, value, total and per-user usage limits, and optionally a validity window, minimum order amount, and maximum discount cap.
Coupon codes are automatically uppercased by the server when customers enter them at checkout — your customers can type save10, SAVE10, or Save10 and the system treats all three identically. You do not need to sanitise case on the client side.
Set usage_limit: 1 and usage_limit_per_user: 1 to create a single-use coupon. This is ideal for personalised discount links or one-time compensation credits — the coupon becomes unavailable the moment a single customer redeems it.

Request Body

string
required
Unique coupon code. Accepts letters, numbers, dashes, and underscores. Length: 3–50 characters. Automatically uppercased. Example: "SUMMER20".
string
required
The discount calculation method. Accepted values: FIXED_AMOUNT (deducts a flat currency amount), PERCENTAGE (deducts a percentage of the order total).
number
required
The discount magnitude. For PERCENTAGE, must be between 0 (exclusive) and 100 (inclusive). For FIXED_AMOUNT, must be greater than 0. Example: 20 for 20% off or 10.00 for a $10 discount.
integer
required
Total number of times this coupon can be redeemed across all customers (≥ 1).
integer
required
Maximum number of times a single customer can redeem this coupon (≥ 1).
number
Minimum cart total (before discount) required to apply this coupon. Omit for no minimum.
number
Cap on the discount value in currency units. Useful for percentage coupons where you want to limit the maximum saving. For example, a 30%-off coupon with maximum_discount_amount: 50 saves at most $50. Must be greater than 0.
string
ISO 8601 UTC datetime from which the coupon becomes valid. Omit to make it valid immediately.
string
ISO 8601 UTC datetime after which the coupon is no longer valid. Must be after starts_at when both are provided. Omit for a coupon with no expiry.
boolean
default:"true"
Set to false to create the coupon in an inactive state — useful for staging promotions before making them live.
201 Response

Get Coupon

Retrieve a single coupon by its public ID. The response includes current usage count and computed status alongside all configuration fields.

Path Parameters

string
required
The coupon’s public ID. Must start with cpn_.

Coupon Object

string
Unique coupon identifier, prefixed cpn_.
string
Uppercase coupon code as stored.
string
FIXED_AMOUNT or PERCENTAGE.
number
The numeric discount magnitude.
integer
Total redemption cap.
integer
Per-user redemption cap.
integer
Number of times this coupon has been successfully redeemed.
string
Computed status: ACTIVE, INACTIVE, EXPIRED, or USAGE_LIMIT_REACHED.
boolean
Whether the coupon is administratively enabled.
number | null
Minimum cart value to apply the coupon, or null.
number | null
Discount cap in currency units, or null.
string | null
ISO 8601 UTC start datetime, or null.
string | null
ISO 8601 UTC expiry datetime, or null.
string
ISO 8601 UTC creation timestamp.
Example — get coupon detail

Update Coupon

Update one or more fields of an existing coupon. Only the fields you include in the request body are changed. Pass null for optional monetary or date fields to clear them.

Path Parameters

string
required
The coupon’s public ID. Must start with cpn_.

Request Body

Provide at least one field. All fields follow the same validation rules as on creation.
string
New coupon code. Length 3–50, alphanumeric/dash/underscore only. Uppercased automatically.
string
FIXED_AMOUNT or PERCENTAGE.
number
New discount value. For PERCENTAGE, must be 0 (exclusive) to 100 (inclusive).
integer
New total usage cap (≥ 1).
integer
New per-user cap (≥ 1).
number | null
New minimum order amount, or null to remove the requirement.
number | null
New discount cap, or null to remove the cap.
string | null
New start datetime (ISO 8601), or null to make it immediately valid.
string | null
New expiry datetime (ISO 8601). Must be after starts_at when both are set. Pass null to remove the expiry.
boolean
Set to false to deactivate the coupon without deleting it, or true to re-enable it.
Example — extend expiry and increase usage limit
200 Response

Delete Coupon

Soft-delete a coupon, removing it from the checkout flow while preserving its full redemption history for reporting. The coupon is no longer redeemable by customers but remains visible in the admin list when include_deleted=true.

Path Parameters

string
required
The coupon’s public ID. Must start with cpn_.
Example — delete a coupon
A successful deletion returns 204 No Content with an empty body.

List Coupon Usages

Retrieve a paginated redemption history for a specific coupon. Each entry identifies the customer who redeemed it, the order it was applied to, and the exact discount amount that was deducted.

Path Parameters

string
required
The coupon’s public ID. Must start with cpn_.

Query Parameters

integer
default:"1"
Page number (1-based).
integer
default:"20"
Results per page. Range: 1–100.

Response

boolean
Always true on a 200 response.
array
Array of usage records.
object
Pagination metadata.
Example — list redemptions for a coupon
200 Response