v1

latestOpenAPI 3.0.12026-08-062532117.6 KB

Update a promotional code

Updates a promotional code identified by promotionalCodeId, and fires the promotional_code.updated webhook.

Set active to false to switch a code off without deleting it — this is the safe way to retire a code an affiliate has already shared. Changing code renames it, and the new string must be unique within the program.

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

put/promotional-codes

Request body

promotionalCodeIdstring uuid required

The promotional code ID to update

codestring

Rename the code. Must be unique within the program.

activeboolean

Set to false to retire the code without deleting it

expiresAtstring date-time

Expiration date

maxRedemptionsinteger

Maximum redemptions

firstTimeOrderboolean

Limit to first-time orders

minimumAmountnumber float

Minimum purchase amount

minimumAmountCurrencystring

Currency for minimum amount

limitToCustomersboolean

Limit to specific customers

customerIdstring

Specific customer ID

limitToAffiliateboolean

Only affiliate can use

externalIdstring

The code's ID in the connected billing provider

Response

The updated promotional code.

idstring uuid

The promotional code ID

codestring

The actual promotional code string

couponIdstring uuid

The parent coupon ID

affiliateIdstring uuid nullable

The affiliate ID this code is assigned to

externalIdstring nullable

External ID (e.g., Stripe promotion code ID)

activeboolean

Whether the promotional code is active

expiresAtstring date-time nullable

Expiration date for the code

maxRedemptionsinteger nullable

How many times this code can be redeemed. null means unlimited. Redemptions are also capped by the parent coupon's own limit.

timesRedeemedinteger

Number of times this code has been redeemed

firstTimeOrderboolean

Whether this code is limited to first-time orders

minimumAmountnumber float nullable

Minimum purchase amount required

minimumAmountCurrencystring nullable

Currency for minimum amount

limitToCustomersboolean

Whether code is limited to specific customers

customerIdstring nullable

Specific customer ID this code is limited to

limitToAffiliateboolean

Whether only the assigned affiliate may redeem this code

isAutoGeneratedboolean

Whether this code was generated from a codeStructure rather than supplied by hand

createdAtstring date-time

Timestamp when the code was created

updatedAtstring date-time

Timestamp when the code was last updated

isAffiliateGeneratedboolean

Whether the affiliate created this code themselves from their portal