Skip to main content
POST
TypeScript

Autorisationer

Authorization
string
header
påkrævet

An Account API key, an App API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.

Scopes

promo_code:update

Overskrifter

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Eksempel:

"d9105228-4a08-46b1-8b91-42fed586d383"

Api-Version-Date
string

Pins the request to a dated API version.

Eksempel:

"2026-11-17"

Sti-parametre

id
string
påkrævet

Promo code ID (promo_ tag).

Svar

promo code activated

account
object
påkrævet

Account that owns the promo code.

affiliate
object | null
påkrævet

Affiliate credited with referrals that use the promo code, or null when no affiliate is attached.

amount_off
number
påkrævet

Discount amount. Percentage discounts are represented as a decimal fraction.

Eksempel:

0.25

churned_users_only
boolean
påkrævet

Whether the promo code is restricted to churned customers.

Eksempel:

false

code
string | null
påkrævet

Code entered at checkout.

Eksempel:

"affiliate25"

created_at
string
påkrævet

When the promo code was created, as an ISO 8601 timestamp.

Eksempel:

"2026-01-01T12:00:00.000Z"

currency
enum<string>
påkrævet

Currency used for a fixed-amount discount.

Tilgængelige muligheder:
usd,
sgd,
inr,
aud,
brl,
cad,
dkk,
eur,
nok,
gbp,
sek,
chf,
hkd,
huf,
jpy,
mxn,
myr,
pln,
czk,
nzd,
aed,
eth,
ape,
cop,
ron,
thb,
bgn,
idr,
dop,
php,
try,
krw,
twd,
vnd,
pkr,
clp,
uyu,
ars,
zar,
dzd,
tnd,
mad,
kes,
kwd,
jod,
all,
xcd,
amd,
bsd,
bhd,
bob,
bam,
khr,
crc,
xof,
egp,
etb,
gmd,
ghs,
gtq,
gyd,
ils,
jmd,
mop,
mga,
mur,
mdl,
mnt,
nad,
ngn,
mkd,
omr,
pyg,
pen,
qar,
rwf,
sar,
rsd,
lkr,
tzs,
ttd,
uzs,
rub,
btc,
cny,
usdt,
kzt,
awg,
whop_usd,
xau,
hnl
Eksempel:

"usd"

duration
enum<string>
påkrævet

How long the discount applies.

Tilgængelige muligheder:
forever,
once,
repeating
Eksempel:

"repeating"

existing_memberships_only
boolean
påkrævet

Whether the promo code applies only to existing memberships.

Eksempel:

false

expires_at
string | null
påkrævet

When the promo code expires, as an ISO 8601 timestamp.

Eksempel:

"2026-01-01T12:00:00.000Z"

id
string
påkrævet

Promo code ID, prefixed promo_.

Eksempel:

"promo_xxxxxxxxxxxxxx"

metadata
object
påkrævet

Custom key-value metadata stored on the promo code.

Eksempel:
new_users_only
boolean
påkrævet

Whether the promo code is restricted to new customers.

Eksempel:

true

one_per_customer
boolean
påkrævet

Whether each customer may redeem the promo code only once.

Eksempel:

true

product
object | null
påkrævet

Product the promo code is restricted to, or null when it is not product-scoped.

promo_duration_months
integer | null
påkrævet

Billing intervals the discount applies to.

Eksempel:

3

promo_type
enum<string>
påkrævet

Whether the discount is percentage-based or a fixed amount.

Tilgængelige muligheder:
percentage,
flat_amount
Eksempel:

"percentage"

status
enum<string>
påkrævet

Promo code lifecycle status.

Tilgængelige muligheder:
active,
inactive,
archived
Eksempel:

"active"

stock
integer
påkrævet

Maximum uses when stock is limited.

Eksempel:

200

unlimited_stock
boolean
påkrævet

Whether the promo code has no redemption limit.

Eksempel:

false

updated_at
string
påkrævet

When the promo code was updated, as an ISO 8601 timestamp.

Eksempel:

"2026-01-01T12:00:00.000Z"

uses
integer
påkrævet

Memberships that used the promo code.

Eksempel:

0