Skip to main content
POST
Create coupon

Autorizações

X-Api-Key
string
header
obrigatório

Corpo

application/json

Body for creating a new discount coupon.

discountType
enum<string>
obrigatório

Discount type (percentage or fixed amount).

Opções disponíveis:
percentage,
fixed_amount
discountValue
integer<int32>
obrigatório

Discount amount. For PERCENTAGE: 1..100. For FIXED_AMOUNT: amount in the smallest currency unit (cents).

Intervalo necessário: x >= 1
Exemplo:

10

duration
enum<string>
obrigatório

How the discount is applied across billing cycles.

Opções disponíveis:
once,
repeating,
forever
scope
enum<string>
obrigatório

Whether the coupon applies to all plans or a specific list.

Opções disponíveis:
hub,
plans
applicablePlanIds
string<uuid>[]

Required when scope = SPECIFIC. Plan public IDs the coupon applies to.

code
string

Public coupon code shared with customers. Letters, numbers and underscores only.

Required string length: 3 - 50
Pattern: ^[A-Za-z0-9_]+$
Exemplo:

"WELCOME10"

durationMonths
integer<int32>

Required when duration = REPEATING. Number of months the discount lasts (1..36).

Intervalo necessário: 1 <= x <= 36
Exemplo:

3

maxUses
integer<int32>

Maximum total redemptions of this coupon. Omit for unlimited.

Intervalo necessário: x >= 1
Exemplo:

100

name
string

Optional internal display name for the coupon.

Maximum string length: 100
Exemplo:

"Welcome 10% off"

validFrom
string<date-time>

Start of the validity window. Defaults to now when omitted.

Exemplo:

"2026-06-01T00:00:00Z"

validUntil
string<date-time>

End of the validity window. Must be in the future when provided.

Exemplo:

"2026-12-31T23:59:59Z"

Resposta

Created

active
boolean
applicablePlans
object[]
code
string
createdAt
string<date-time>
currency
string
discountType
enum<string>
Opções disponíveis:
percentage,
fixed_amount
discountValue
integer<int32>
duration
enum<string>
Opções disponíveis:
once,
repeating,
forever
durationMonths
integer<int32>
isExhausted
boolean
isExpired
boolean
maxUses
integer<int32>
name
string
publicId
string<uuid>
scope
enum<string>
Opções disponíveis:
hub,
plans
stripeCouponId
string
stripePromotionCodeId
string
timesUsed
integer<int32>
updatedAt
string<date-time>
validFrom
string<date-time>
validUntil
string<date-time>