Create promo code
Create a new promo code. Optionally restrict it to specific plans and a billing interval. **100% discounts are not supported.** Percentage codes must be strictly less than 100% (`discountValue` < 10000 basis points). For full waivers, use an introductory offer on the plan instead. At checkout, any code — percentage or fixed amount — that would reduce the total below the currency's minimum charge ($0.50 USD equivalent) is silently dropped.
Create a new promo code. Optionally restrict it to specific plans and a billing interval.
100% discounts are not supported. Percentage codes must be strictly less than 100% (discountValue < 10000 basis points). For full waivers, use an introductory offer on the plan instead. At checkout, any code — percentage or fixed amount — that would reduce the total below the currency's minimum charge ($0.50 USD equivalent) is silently dropped.
Authorization
ApiKeyAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
1 <= lengthValue in
- "percentage"
- "amount"
0 < value <= 90071992547409910 < value <= 90071992547409910 < value <= 9007199254740991date-timeResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/promo-codes" \ -H "Content-Type: application/json" \ -d '{ "code": "string", "discountType": "percentage", "discountValue": 1 }'{ "success": true, "data": { "id": "string", "code": "string", "discountType": "percentage", "discountValue": -9007199254740991, "durationCycles": -9007199254740991, "billingInterval": "weekly", "maxRedemptions": -9007199254740991, "expiresAt": "2019-08-24T14:15:22Z", "isActive": true, "redemptionCount": -9007199254740991, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "object": "promo_code", "livemode": true }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}