Skip to content
Join our SlackContact usGet started

Subscriptions

List Subscriptions
client.subscriptions.list(SubscriptionListParams { limit, offset, rate_card_id, subject_id } query?, RequestOptionsoptions?): SubscriptionListResponse { has_more, subscriptions }
get/subscriptions
Create Subscription
client.subscriptions.create(SubscriptionCreateParams { checkout_callback_urls, rate_card_id, subject_id, 2 more } body, RequestOptionsoptions?): SubscriptionCreateResponse { result }
post/subscriptions
Get Subscription
client.subscriptions.retrieve(stringsubscriptionID, RequestOptionsoptions?): SubscriptionResource { id, cancels_at_end_of_cycle, current_period, 6 more }
get/subscriptions/{subscription_id}
Cancel Subscription
client.subscriptions.cancel(stringsubscriptionID, SubscriptionCancelParams { cancel_at_end_of_cycle, reason } body, RequestOptionsoptions?): SubscriptionResource { id, cancels_at_end_of_cycle, current_period, 6 more }
post/subscriptions/{subscription_id}/cancel
Change Subscription Rate Card
client.subscriptions.changeRateCard(stringsubscriptionID, SubscriptionChangeRateCardParams { checkout_callback_urls, rate_card_id, upgrade_behavior } body, RequestOptionsoptions?): SubscriptionChangeRateCardResponse { result }
post/subscriptions/{subscription_id}/change-rate-card
ModelsExpand Collapse
CheckoutCallback { cancelled_url, success_url }
cancelled_url: string

The URL to redirect to after the checkout is cancelled.

minLength1
formaturi
success_url: string

The URL to redirect to after the checkout is successful.

minLength1
formaturi
SubscriptionResource { id, cancels_at_end_of_cycle, current_period, 6 more }
id: string

The ID of the subscription.

cancels_at_end_of_cycle: boolean

Whether the subscription will be cancelled at the end of the current cycle.

current_period: CurrentPeriod | null

The current period of the subscription if it is active.

end: string
formatdate-time
start: string
formatdate-time
inclusive_end?: boolean
inclusive_start?: boolean
cycles_next_at: string | null

The date and time the next cycle of the subscription will start.

formatdate-time
effective_at: string

The date and time the subscription became effective.

formatdate-time
metadata: Record<string, string>
rate_card_id: string

The ID of the rate card of the subscription.

status: "active" | "cancelled" | "paused"

The status of the subscription.

Accepts one of the following:
"active"
"cancelled"
"paused"
subject_id: string

The ID of the subject that the subscription is for.