Skip to main content
PATCH
Update a discount code

Authorizations

X-Suby-Api-Key
string
header
required

Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).

Path Parameters

id
string
required
Example:

"disc_abc123"

Body

application/json

Partial · every field is optional, name included. Omitted fields keep their stored value. Not an allOf on the create body: that would inherit its required, and a PATCH that has to resend the name to change an expiry is a replace wearing a PATCH's name.

name
string
Required string length: 2 - 40
Pattern: ^[A-Z0-9][A-Z0-9_-]*$
Example:

"NOEL2026"

discountType
enum<string>

Changing it rewrites the whole type block · the opposite kind's fields are cleared.

Available options:
PERCENTAGE,
FIXED
discountPercent
integer | null
Required range: 1 <= x <= 99
discountAmountCents
string | null
Pattern: ^[1-9]\d*$
Example:

"500"

currency
string | null
Pattern: ^[A-Z]{3}$
productIds
string[]

Replaces the whole scope. Empty = the entire catalogue.

maxUses
integer | null
Required range: x >= 1
expiresAt
string<date-time> | null
preApply
boolean
isActive
boolean

Response

Code updated

success
boolean
required
Example:

true

data
object
required

Endpoint-specific payload.

message
string