Create or register coupon code
create_couponGive an affiliate a discount code so sales using it are credited to them. With createInProvider true, LinkJolt creates the code in the brand's connected Stripe, Polar or Creem (the one it creates codes in unless provider is given), as the dashboard's Add coupon does: set percentOff, or amountOff with currency, and duration (once, forever, or repeating with durationInMonths). Without it, the code must already exist in the payment platform and this registers it (for a Stripe code customers type, pass its promo_ id). Confirm the code, the discount and the affiliate with the person first. If no platform that creates codes is connected, the answer gives the link to connect Stripe. Requires an Ultimate or Scale plan key with write access; a test key only registers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The readable code, e.g. SARAH20 | |
| currency | No | 3-letter ISO code for amountOff | |
| duration | No | With createInProvider: how long the discount lasts for a customer | |
| provider | No | Where the discount lives (default stripe when registering; with createInProvider, the platform the brand creates codes in) | |
| amountOff | No | Fixed amount off, with currency: the real discount with createInProvider, a label when registering | |
| campaignId | Yes | The campaign the coupon belongs to | |
| percentOff | No | Percent off (1-100): the real discount with createInProvider, a label when registering | |
| affiliateId | Yes | The affiliate the code is attributed to | |
| description | No | With createInProvider: the discount's name in the payment platform (default: the code) | |
| appleOfferType | No | Apple offer type: 1 introductory, 2 promotional, 3 offer code | |
| creemDiscountId | No | Registering a Creem code: its discount id (dis_...) | |
| polarDiscountId | No | Registering a Polar code: its discount id | |
| createInProvider | No | Create the code in the brand's connected Stripe, Polar or Creem instead of registering one that already exists | |
| durationInMonths | No | With duration repeating: for how many months (1-36) | |
| paddleDiscountId | No | Registering a Paddle code: its discount id (dsc_...) | |
| stripePromotionCodeId | No | Registering a Stripe code: its promotion code id (promo_...). Needed for a code customers type: Stripe sends only this id with the sale, never the code text |