v1

latestOpenAPI 3.0.12026-08-062532117.6 KB

Update a coupon

Updates a coupon identified by couponId, and fires the coupon.updated webhook.

Changing the discount affects every promotional code that points at this coupon, including codes already in circulation. Set valid to false to stop a coupon being applied without deleting it.

Every field you send is applied directly to the coupon, so sending a field that is not listed below will fail the request.

put/coupons

Request body

couponIdstring uuid required

The coupon to update

namestring

Name of the coupon

couponType'PERCENTAGE' | 'FLAT'

Whether the discount is a percentage or a fixed amount

percentOffnumber float

Percentage taken off, 1–100

amountOffnumber float

Fixed amount taken off. Must be greater than zero.

currencystring

Currency for amountOff

duration'once' | 'forever' | 'repeating'

How long the discount keeps applying to a subscription

durationInMonthsinteger

Number of months the discount repeats for

maxRedemptionsinteger

Total redemptions allowed

limitToProductsboolean

Restrict the coupon to productIds

productIdsstring[]

Products the coupon applies to

validboolean

Set to false to stop the coupon being redeemed

redeemBystring date-time

Last date the coupon can be redeemed

Response

The updated coupon.

idstring uuid

The coupon ID

namestring nullable

Name of the coupon

externalIdstring nullable

The coupon's ID in the connected billing provider, for example a Stripe coupon ID

couponType'PERCENTAGE' | 'FLAT'

Whether the discount is a percentage or a fixed amount

percentOffnumber float nullable

Percentage taken off, 1–100. Used when couponType is PERCENTAGE.

amountOffnumber float nullable

Fixed amount taken off. Used when couponType is FLAT.

currencystring nullable

Currency for amountOff, for example USD

duration'once' | 'forever' | 'repeating'

How long the discount keeps applying to a subscription

durationInMonthsinteger nullable

Number of months the discount repeats for. Only set when duration is repeating.

maxRedemptionsinteger nullable

Total redemptions allowed across every promotional code on this coupon. null means unlimited.

timesRedeemedinteger

How many times this coupon has been redeemed so far

couponCategory'CUSTOMER' | 'PAYOUT'

Whether the coupon discounts customers or is used to pay affiliates as a non-cash reward

limitToProductsboolean

Whether the coupon only applies to productIds

productIdsstring[]

Products the coupon is restricted to

collectionIdsstring[]

Collections the coupon is restricted to

validboolean

Whether the coupon can currently be redeemed

redeemBystring date-time nullable

Last date the coupon can be redeemed

integrationType'NONE' | 'STRIPE' | 'CHARGEBEE' | 'PADDLE' | 'SHOPIFY' | 'WOOCOMMERCE' | 'ZYLVIE' | 'POLAR' nullable

The billing provider this coupon is synced with

affiliateProgramIdstring uuid

The affiliate program this coupon belongs to

createdAtstring date-time

When the coupon was created

updatedAtstring date-time

When the coupon was last updated

autoCouponRuleobject nullable

Rule used to generate codes automatically for affiliates, if configured