Coupons

Create, retrieve, update, delete, and list discount coupons.

View as Markdown

A coupon is a discount code that customers can redeem at checkout to reduce the amount they are charged. Coupons support percentage-based and fixed-amount discounts, and can be configured with usage limits and duration rules.

Illustrative content. Hand-authored to demonstrate the Standard/Advanced pattern; the production page will be generated from the VINR OpenAPI spec (roadmap item #1). Field names are representative.

The coupon objectAsk

idstring

Unique identifier for the coupon, e.g. cpn_5Hx1pR.

namestring

Human-readable name or code that customers enter at checkout, e.g. SUMMER20.

percent_offnumber

Percentage discount applied when this coupon is redeemed. Mutually exclusive with amount_off.

amount_offinteger

Fixed discount amount in the smallest currency unit. Mutually exclusive with percent_off.

currencystring

Three-letter ISO currency code, required when amount_off is set, e.g. USD.

durationenum

One of once (applied to the first invoice only), repeating (applied to recurring invoices for a set number of months), or forever (applied to all invoices).

times_redeemedinteger

Total number of times this coupon has been redeemed.

max_redemptionsinteger

Maximum number of times this coupon can be redeemed. null means unlimited.

validboolean

true if the coupon can still be redeemed (times_redeemed has not reached max_redemptions and it has not been deleted).

createdinteger

Unix timestamp when this coupon was created.

Create a couponAsk

Provide either percent_off or amount_off (with currency). Set max_redemptions to cap total usage.

Retrieve a couponAsk

Fetch a coupon by its ID.

Update a couponAsk

Update the coupon's display name or raise the redemption cap. Discount values and duration are immutable after creation.

ParameterTypeDescription
namestringNew human-readable name or code for the coupon.
max_redemptionsintegerRaise (not lower) the maximum redemption limit.

Delete a couponAsk

Permanently deletes a coupon. It can no longer be redeemed. Existing redemptions are not affected.

List couponsAsk

Returns a paginated list of coupons, newest first.

ParameterTypeDescription
limitintegerNumber of results to return. Default 10, max 100.

coupon.created, coupon.updated, and coupon.deleted. See Events.

Was this page helpful?