Skip to main content
PATCH
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

discount_id
string
required

Discount Id

Body

application/json

Request body for patching (updating) a discount.

All fields are optional and only update if provided.

amount
integer<int32> | null

If present, update the discount amount in basis points (e.g., 540 = 5.4%, 10000 = 100%).

Must be at least 1 if provided.

code
string | null

If present, update the discount code (uppercase).

expires_at
string<date-time> | null
metadata
null | Metadata · object

Additional metadata for the discount

name
string | null
preserve_on_plan_change
boolean | null

Whether this discount should be preserved when a subscription changes plans. If not provided, the existing value is kept.

restricted_to
string[] | null

If present, replaces all restricted product IDs with this new set. To remove all restrictions, send empty array

subscription_cycles
integer<int32> | null

Number of subscription billing cycles this discount is valid for. If not provided, the discount will be applied indefinitely to all recurring payments related to the subscription.

type
null | enum<string>

If present, update the discount type. Currently only percentage is supported.

Available options:
percentage
usage_limit
integer<int32> | null

Response

Updated discount

amount
integer<int32>
required

The discount amount in basis points (e.g., 540 => 5.4%).

business_id
string
required

The business this discount belongs to.

code
string
required

The discount code (up to 16 chars).

created_at
string<date-time>
required

Timestamp when the discount is created

discount_id
string
required

The unique discount ID

metadata
Metadata · object
required

Arbitrary key-value metadata. Values can be string, integer, number, or boolean.

preserve_on_plan_change
boolean
required

Whether this discount should be preserved when a subscription changes plans. Default: false (discount is removed on plan change)

restricted_to
string[]
required

List of product IDs to which this discount is restricted.

times_used
integer<int32>
required

How many times this discount has been used.

type
enum<string>
required

The type of discount. Currently only percentage is supported.

Available options:
percentage
expires_at
string<date-time> | null

Optional date/time after which discount is expired.

name
string | null

Name for the Discount

subscription_cycles
integer<int32> | null

Number of subscription billing cycles this discount is valid for. If not provided, the discount will be applied indefinitely to all recurring payments related to the subscription.

usage_limit
integer<int32> | null

Usage limit for this discount, if any.

Last modified on March 25, 2026