Create a coupon

Creates a coupon. A coupon has either an amountOff and currency or percentOff. The coupon created will be automatically synchronized with Stripe if you have a connected stripe account. If you are not connected the endpoint will throw an error. In addition to Checkout Page rate limits, Stripe rate limits apply when creating coupons.

POST
/v1/coupons/
AuthorizationBearer <token>

API key authentication. Use "Bearer YOUR_API_KEY" format.

In: header

labelstring

Internal name for the coupon.

Length1 <= length
codestring

The coupon code a customer enters.

Match^[A-Za-z0-9_-]+$
Length1 <= length
amountOff?number

A positive integer representing the amount to subtract from an invoice total (required if percent_off is not passed).

Range0 < value <= 99999999
currency?string

Three-letter ISO code for the currency of the amountOff parameter (required if amountOff is passed).

Value in"aed" | "aud" | "brl" | "cad" | "chf" | "clp" | "czk" | "dkk" | "eur" | "gbp" | "hkd" | "inr" | "jpy" | "mxn" | "myr" | "nok" | "nzd" | "ron" | "php" | "pln" | "sek" | "sgd" | "usd" | "zar"
durationstring
Value in"once" | "repeating" | "forever"
durationInMonths?number

A positive integer representing the number of months the coupon applies for (required if duration === repeating)

Range0 < value
percentOff?number

A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if amount_off is not passed).

Range1 <= value <= 100
appliesToSetupFee?boolean

When enabled, applies this coupon discount to the setup fee.

pageIds?array<string>

A list of pageIds that this coupon can be used within.

maxRedemptions?number

The total amount of times this coupon can be used. Doesn't limit a single customer from redeeming multiple times.

Range0 < value
redeemBy?string

The ISO datetime that this coupon must be used before.

Formatdate-time

Response Body

application/json

curl -X POST "https://api.checkoutpage.com/v1/coupons/" \  -H "Content-Type: application/json" \  -d '{    "label": "Free shipping within US",    "code": "10Off",    "duration": "once"  }'
{
  "data": {
    "id": "string",
    "label": "Free shipping within US",
    "code": "10Off",
    "amountOff": 0,
    "currency": "string",
    "percentOff": 0,
    "appliesToSetupFee": true,
    "duration": "once",
    "durationInMonths": 0,
    "redeemBy": "2019-08-24T14:15:22Z",
    "maxRedemptions": 0,
    "timesRedeemed": 0,
    "deleted": false,
    "sellerId": "string",
    "pageIds": [
      "string"
    ],
    "stripeCouponId": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
Empty
Empty
Empty
Empty
Empty
Empty