Skip to main content
PATCH
Update discount

Authorizations

Authorization
string
header
required

Organization API key using Authorization: Bearer sk_....

Path Parameters

id
string
required

Identifier of the discount.

Body

application/json

Request body for updating a discount. All fields are optional.

name
string

Display name of the discount.

Minimum string length: 1
Example:

"Buen Fin 25%"

description
string | null

Optional description.

Example:

null

codes
string[]

Replaces all existing codes with this list. Codes are uppercased automatically.

Required string length: 1 - 140
Example:
type
enum<string>

Whether the discount is a fixed amount (FIXED) or a percentage (PERCENTAGE).

Available options:
FIXED,
PERCENTAGE
Example:

"PERCENTAGE"

amountOff
integer | null

Fixed discount amount in minor currency units. Required when type is FIXED.

Required range: 0 <= x <= 99999999999
Example:

null

percentageOff
number | null

Percentage to discount (0-100). Required when type is PERCENTAGE.

Required range: 0 <= x <= 100
Example:

25

active
boolean

Whether the discount is active.

Example:

true

oneOff
boolean

Whether this discount is single-use.

Example:

false

expiresAt
string<date-time> | null

Optional expiration date.

Example:

null

maxApplications
integer | null

Maximum number of times this discount can be applied.

Required range: x >= 1
Example:

null

Response

Discount updated

Updated discount.

discount
object
required

A reusable discount that can be applied to invoices or subscriptions.