Create coupon

Create a new coupon for the site. Provide either amount_off (fixed discount) or percent_off (percentage discount), but not both.

Query Params
int32
required

The unique identifier of the site associated with your account.

Body Params
string
required
length between 3 and 40

Display name of the coupon shown on invoices and receipts.

string
required
length between 3 and 255

Unique redemption code. Letters and numbers only.

string
enum
required

How long the discount applies. "forever" applies indefinitely, "once" applies to a single invoice.

Allowed:
number

Fixed amount discount (e.g. 5.00 for $5.00 off). Accepts up to 2 decimal places. Required if percent_off is not provided. Cannot be combined with percent_off.

number
0 to 100

Percentage discount between 0 and 100. Required if amount_off is not provided. Cannot be combined with amount_off.

string
length between 3 and 3

Three-letter ISO currency code. Required when amount_off is provided.

date

Expiration date in YYYY-MM-DD format. Must be a future date.

integer
≥ 1

Maximum number of times this coupon can be redeemed.

plans
array of integers

Array of plan IDs this coupon is restricted to. If set, the coupon can only be used with these plans.

plans
metadata
object

Custom key-value metadata.

Headers
string
required
Defaults to Bearer eyJ***
Responses

Language
Credentials
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json