Order Details
User History
Prices
Products
Licenses
Pay Links
Transactions
Payments
Plans
Users
Modifiers
Payments
One-off Charges
Webhooks
post

/2.1/product/create_coupon

Create a new coupon for the given product or a checkout.

Coupons are great. Whether they’re underpinning your marketing campaigns, giving your customers a little extra discount at the checkout, or smoothing things out when things go awry, they can be really versatile tools.

Our coupon API provides you with:

  • Creation and management of large groups of coupons
  • A lot of flexibility in the kind of discounts you can create
  • Real-time, on-demand coupon creation

Request Body

Form data (application/x-www-form-urlencoded)
vendor_id
integer

The vendor ID identifies your seller account. This can be found in Developer Tools > Authentication.

required
minimum: 1
pattern: \d+
vendor_auth_code
string

The vendor auth code is a private API key for authenticating API requests. This key should never be used in client side code or shared publicly. This can be found in Developer Tools > Authentication.

required
pattern: [0-9a-f]+
coupon_code
string

Will be randomly generated if not specified.

maxLength: 300
minLength: 5
coupon_prefix
string

Prefix for generated codes. Not valid if coupon_code is specified.

num_coupons
integer

Number of coupons to generate. Not valid if coupon_code is specified.

description
string

Description of the coupon. This will be displayed in the Seller Dashboard.

maxLength: 300
coupon_type
string

Either product (valid for specified products or subscription plans) or checkout (valid for any checkout).

required
Allowed Values: product, checkout
product_ids
string

Comma-separated list of product IDs. Required if coupon_type is product.

discount_type
string

Either flat or percentage.

required
Allowed Values: flat, percentage
discount_amount
number

A currency amount (eg. 10.00) if discount_type is flat, or a percentage amount (eg. 10 for 10%) if discount_type is percentage.

required
pattern: ^\d+(\.\d{2})?$
currency
string

The currency must match the balance currency specified in your account here. Required if discount_amount is flat.

Allowed Values: USD, GBP, EUR
pattern: [A-Z]{3}
allowed_uses
integer

Number of times a coupon can be used in a checkout. This will be set to 999,999 by default, if not specified.

pattern: \d+
expires
string

The date (in format YYYY-MM-DD) the coupon is valid until. The coupon will expire on the date at 00:00:00 UTC.

format: date
pattern: \d{4}-\d{2}-\d{2}
recurring
integer

If the coupon is used on subscription products, this indicates whether the discount should apply to recurring payments after the initial purchase.

Allowed Values: 0, 1
group
string

The name of the coupon group this coupon should be assigned to.

maxLength: 50
minLength: 1

Responses

1 Example
Schema
object
or
object

An unsuccessful call to the Dashboard API will return a 200 response containing a field success set to false and an error object.

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
$$.env
No $$.env variables are being used in this request.