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.
API key authentication. Use "Bearer YOUR_API_KEY" format.
In: header
Internal name for the coupon.
1 <= lengthThe coupon code a customer enters.
^[A-Za-z0-9_-]+$1 <= lengthA positive integer representing the amount to subtract from an invoice total (required if percent_off is not passed).
0 < value <= 99999999Three-letter ISO code for the currency of the amountOff parameter (required if amountOff is passed).
"aed" | "aud" | "brl" | "cad" | "chf" | "clp" | "czk" | "dkk" | "eur" | "gbp" | "hkd" | "inr" | "jpy" | "mxn" | "myr" | "nok" | "nzd" | "ron" | "php" | "pln" | "sek" | "sgd" | "usd" | "zar""once" | "repeating" | "forever"A positive integer representing the number of months the coupon applies for (required if duration === repeating)
0 < valueA 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).
1 <= value <= 100When enabled, applies this coupon discount to the setup fee.
A list of pageIds that this coupon can be used within.
The total amount of times this coupon can be used. Doesn't limit a single customer from redeeming multiple times.
0 < valueThe ISO datetime that this coupon must be used before.
date-timeResponse 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"
}
}