Skip to main content
PATCH
Python

Authorizations

Authorization
string
header
required

You can generate a Personal Access Token from your settings.

Path Parameters

id
string<uuid4>
required

The subscription ID.

Body

application/json
metadata
Metadata · object

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

product_id
string<uuid4> | null

Update subscription to another product.

Example:

"d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23"

proration_behavior
enum<string> | null

Determine how to handle the proration billing. If not provided, will use the default organization setting.

Available options:
invoice,
prorate,
next_period,
reset
discount_id
string<uuid4> | null

Update the subscription to apply a new discount. If set to null, the discount will be removed. The change will be applied on the next billing cycle.

trial_end

Set or extend the trial period of the subscription. If set to now, the trial will end immediately and the first billing cycle will be charged synchronously. The subscription remains trialing if the payment fails.

Example:

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

Response

Subscription updated.

created_at
string<date-time>
required

Creation timestamp of the object.

Example:

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

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

Example:

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

id
string<uuid4>
required

The ID of the object.

amount
integer
required

The amount of the subscription.

Example:

10000

currency
string
required

The currency of the subscription.

Example:

"usd"

recurring_interval
enum<string>
required

The interval at which the subscription recurs.

Available options:
day,
week,
month,
year
Example:

"month"

recurring_interval_count
integer
required

Number of interval units of the subscription. If this is set to 1 the charge will happen every interval (e.g. every month), if set to 2 it will be every other month, and so on.

status
enum<string>
required

The status of the subscription.

Available options:
incomplete,
incomplete_expired,
trialing,
active,
past_due,
canceled,
unpaid,
paused
Example:

"active"

current_period_start
string<date-time>
required

The start timestamp of the current billing period.

Example:

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

current_period_end
string<date-time>
required

The end timestamp of the current billing period.

Example:

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

current_meter_period_start
string<date-time> | null
required

The start timestamp of the current meter period, if the product has a meter cycle set. Metered credits are granted and overage is settled on this cadence.

Example:

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

current_meter_period_end
string<date-time> | null
required

The end timestamp of the current meter period, if the product has a meter cycle set. This is when credits next renew.

Example:

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

trial_start
string<date-time> | null
required

The start timestamp of the trial period, if any.

Example:

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

trial_end
string<date-time> | null
required

The end timestamp of the trial period, if any.

Example:

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

cancel_at_period_end
boolean
required

Whether the subscription will be canceled at the end of the current period.

canceled_at
string<date-time> | null
required

The timestamp when the subscription was canceled. The subscription might still be active if cancel_at_period_end is true.

Example:

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

started_at
string<date-time> | null
required

The timestamp when the subscription started.

Example:

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

ends_at
string<date-time> | null
required

The timestamp when the subscription will end.

Example:

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

ended_at
string<date-time> | null
required

The timestamp when the subscription ended.

Example:

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

pause_at_period_end
boolean
required

Whether the subscription will be paused at the end of the current period.

paused_at
string<date-time> | null
required

The timestamp when the subscription was paused.

Example:

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

resumes_at
string<date-time> | null
required

The timestamp when a paused subscription is scheduled to automatically resume, if set.

Example:

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

customer_id
string<uuid4>
required

The ID of the subscribed customer.

product_id
string<uuid4>
required

The ID of the subscribed product.

discount_id
string<uuid4> | null
required

The ID of the applied discount, if any.

checkout_id
string<uuid4> | null
required
units
integer | null
required

The number of units for unit-based subscriptions. None for non-unit subscriptions.

customer_cancellation_reason
enum<string> | null
required
Available options:
customer_service,
low_quality,
missing_features,
switched_service,
too_complex,
too_expensive,
unused,
other
customer_cancellation_comment
string | null
required
metadata
object
required
customer
SubscriptionCustomer · object
required
product
Product · object
required

A product.

discount
DiscountFixedOnceForeverDurationBase · object
required
prices
(LegacyRecurringProductPriceFixed · object | LegacyRecurringProductPriceCustom · object | ProductPriceFixed · object | ProductPriceCustom · object | ProductPriceSeatBased · object | ProductPriceUnitBased · object | ProductPriceMeteredUnit · object | ProductPriceMeteredTiers · object)[]
required

List of enabled prices for the subscription.

A recurring price for a product, i.e. a subscription.

Deprecated: The recurring interval should be set on the product itself.

meters
SubscriptionMeter · object[]
required

List of meters associated with the subscription.

pending_update
PendingSubscriptionUpdate · object | null
required

Pending subscription update that will be applied at the beginning of the next period. If null, there is no pending update.

past_due_at
string<date-time> | null

The timestamp when the subscription entered past_due status.

Example:

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

seats
integer | null

The number of seats for seat-based subscriptions. None for non-seat subscriptions.

custom_field_data
Custom Field Data · object

Key-value object storing custom field values.