Search + K

Command Palette

Search for a command to run...

Sign In

Cancel a subscription

DELETE /v1/customers/{customer}/subscriptions/{subscription_exposed_id}
Copy endpoint
https://api.stripe.com/

Parameters

path Path Parameters

Name Type
customer required
string
subscription_exposed_id required
string

Request Body

application/x-www-form-urlencoded
{ expand?: string[];invoice_now?: boolean;prorate?: boolean; }

Responses

200 application/json

Successful response.

interface Subscription {
application?: Application
interface Application {
id: string;
name?: string | null;
object: "application";
}
| DeletedApplication
interface DeletedApplication {
deleted: true;
id: string;
name?: string | null;
object: "application";
}
| string | null
;
application_fee_percent?: number | null;
automatic_tax: SubscriptionAutomaticTax
interface SubscriptionAutomaticTax {
disabled_reason?: "requires_location_inputs" | null;
enabled: boolean;
liability?: ConnectAccountReference | null;
}
;
billing_cycle_anchor: number;
billing_cycle_anchor_config?: SubscriptionsResourceBillingCycleAnchorConfig
interface SubscriptionsResourceBillingCycleAnchorConfig {
day_of_month: number;
hour?: number | null;
minute?: number | null;
month?: number | null;
second?: number | null;
}
| null
;
billing_mode: SubscriptionsResourceBillingMode

The billing mode of the subscription.

interface SubscriptionsResourceBillingMode {
flexible?: SubscriptionsResourceBillingModeFlexible | null;
type: "classic" | "flexible";
updated_at?: number;
}
;
billing_thresholds?: SubscriptionBillingThresholds
interface SubscriptionBillingThresholds {
amount_gte?: number | null;
reset_billing_cycle_anchor?: boolean | null;
}
| null
;
cancel_at?: number | null;
cancel_at_period_end: boolean;
canceled_at?: number | null;
cancellation_details?: CancellationDetails
interface CancellationDetails {
comment?: string | null;
feedback?: "customer_service" | "low_quality" | "missing_features" | "other" | "switched_service" | "too_complex" | "too_expensive" | "unused" | null;
reason?: "cancellation_requested" | "payment_disputed" | "payment_failed" | null;
}
| null
;
collection_method: "charge_automatically" | "send_invoice";
created: number;
currency: string;
customer: Customer

This object represents a customer of your business. Use it to create recurring charges, save payment and contact information, and track payments that belong to the same customer.

interface Customer {
address?: Address | null;
balance?: number;
business_name?: string;
cash_balance?: CashBalance | null;
created: number;
currency?: string | null;
customer_account?: string | null;
default_source?: BankAccount | Card | Source | string | null;
delinquent?: boolean | null;
description?: string | null;
discount?: Discount | null;
email?: string | null;
id: string;
individual_name?: string;
invoice_credit_balance?: { };
invoice_prefix?: string | null;
invoice_settings?: InvoiceSettingCustomerSetting;
livemode: boolean;
metadata?: { };
name?: string | null;
next_invoice_sequence?: number;
object: "customer";
phone?: string | null;
preferred_locales?: string[] | null;
shipping?: Shipping | null;
sources?: {
data: (BankAccount | Card | Source)[];
has_more: boolean;
object: "list";
url: string;
}
;
subscriptions?: {
data: Subscription[];
has_more: boolean;
object: "list";
url: string;
}
;
tax?: CustomerTax;
tax_exempt?: "exempt" | "none" | "reverse" | null;
tax_ids?: {
data: TaxId[];
has_more: boolean;
object: "list";
url: string;
}
;
test_clock?: TestHelpersTestClock | string | null;
}
| DeletedCustomer
interface DeletedCustomer {
deleted: true;
id: string;
object: "customer";
}
| string
;
customer_account?: string | null;
days_until_due?: number | null;
default_payment_method?: PaymentMethod

PaymentMethod objects represent your customer's payment instruments. You can use them with PaymentIntents to collect payments or save them to Customer objects to store instrument details for future payments.

Related guides: Payment Methods and More Payment Scenarios.

interface PaymentMethod {
acss_debit?: PaymentMethodAcssDebit;
affirm?: PaymentMethodAffirm;
afterpay_clearpay?: PaymentMethodAfterpayClearpay;
alipay?: PaymentFlowsPrivatePaymentMethodsAlipay;
allow_redisplay?: "always" | "limited" | "unspecified";
alma?: PaymentMethodAlma;
amazon_pay?: PaymentMethodAmazonPay;
au_becs_debit?: PaymentMethodAuBecsDebit;
bacs_debit?: PaymentMethodBacsDebit;
bancontact?: PaymentMethodBancontact;
billie?: PaymentMethodBillie;
billing_details: BillingDetails;
blik?: PaymentMethodBlik;
boleto?: PaymentMethodBoleto;
card?: PaymentMethodCard;
card_present?: PaymentMethodCardPresent;
cashapp?: PaymentMethodCashapp;
created: number;
crypto?: PaymentMethodCrypto;
custom?: PaymentMethodCustom;
customer?: Customer | string | null;
customer_account?: string | null;
customer_balance?: PaymentMethodCustomerBalance;
eps?: PaymentMethodEps;
fpx?: PaymentMethodFpx;
giropay?: PaymentMethodGiropay;
grabpay?: PaymentMethodGrabpay;
id: string;
ideal?: PaymentMethodIdeal;
interac_present?: PaymentMethodInteracPresent;
kakao_pay?: PaymentMethodKakaoPay;
klarna?: PaymentMethodKlarna;
konbini?: PaymentMethodKonbini;
kr_card?: PaymentMethodKrCard;
link?: PaymentMethodLink;
livemode: boolean;
mb_way?: PaymentMethodMbWay;
metadata?: { } | null;
mobilepay?: PaymentMethodMobilepay;
multibanco?: PaymentMethodMultibanco;
naver_pay?: PaymentMethodNaverPay;
nz_bank_account?: PaymentMethodNzBankAccount;
object: "payment_method";
oxxo?: PaymentMethodOxxo;
p24?: PaymentMethodP24;
pay_by_bank?: PaymentMethodPayByBank;
payco?: PaymentMethodPayco;
paynow?: PaymentMethodPaynow;
paypal?: PaymentMethodPaypal;
payto?: PaymentMethodPayto;
pix?: PaymentMethodPix;
promptpay?: PaymentMethodPromptpay;
radar_options?: RadarRadarOptions;
revolut_pay?: PaymentMethodRevolutPay;
samsung_pay?: PaymentMethodSamsungPay;
satispay?: PaymentMethodSatispay;
sepa_debit?: PaymentMethodSepaDebit;
sofort?: PaymentMethodSofort;
swish?: PaymentMethodSwish;
twint?: PaymentMethodTwint;
type: "acss_debit" | "affirm" | "afterpay_clearpay" | "alipay" | "alma" | "amazon_pay" | "au_becs_debit" | "bacs_debit" | "bancontact" | "billie" | "blik" | "boleto" | "card" | "card_present" | "cashapp" | "crypto" | "custom" | "customer_balance" | "eps" | "fpx" | "giropay" | "grabpay" | "ideal" | "interac_present" | "kakao_pay" | "klarna" | "konbini" | "kr_card" | "link" | "mb_way" | "mobilepay" | "multibanco" | "naver_pay" | "nz_bank_account" | "oxxo" | "p24" | "pay_by_bank" | "payco" | "paynow" | "paypal" | "payto" | "pix" | "promptpay" | "revolut_pay" | "samsung_pay" | "satispay" | "sepa_debit" | "sofort" | "swish" | "twint" | "us_bank_account" | "wechat_pay" | "zip";
us_bank_account?: PaymentMethodUsBankAccount;
wechat_pay?: PaymentMethodWechatPay;
zip?: PaymentMethodZip;
}
| string | null
;
default_source?: BankAccount

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank debits and transfers

interface BankAccount {
account?: Account | string | null;
account_holder_name?: string | null;
account_holder_type?: string | null;
account_type?: string | null;
available_payout_methods?: ("instant" | "standard")[] | null;
bank_name?: string | null;
country: string;
currency: string;
customer?: Customer | DeletedCustomer | string | null;
default_for_currency?: boolean | null;
fingerprint?: string | null;
future_requirements?: ExternalAccountRequirements | null;
id: string;
last4: string;
metadata?: { } | null;
object: "bank_account";
requirements?: ExternalAccountRequirements | null;
routing_number?: string | null;
status: string;
}
| Card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card payments with Sources

interface Card {
account?: Account | string | null;
address_city?: string | null;
address_country?: string | null;
address_line1?: string | null;
address_line1_check?: string | null;
address_line2?: string | null;
address_state?: string | null;
address_zip?: string | null;
address_zip_check?: string | null;
allow_redisplay?: "always" | "limited" | "unspecified" | null;
available_payout_methods?: ("instant" | "standard")[] | null;
brand: string;
country?: string | null;
currency?: string | null;
customer?: Customer | DeletedCustomer | string | null;
cvc_check?: string | null;
default_for_currency?: boolean | null;
dynamic_last4?: string | null;
exp_month: number;
exp_year: number;
fingerprint?: string | null;
funding: string;
id: string;
iin?: string;
last4: string;
metadata?: { } | null;
name?: string | null;
networks?: TokenCardNetworks;
object: "card";
regulated_status?: "regulated" | "unregulated" | null;
status?: string | null;
tokenization_method?: string | null;
}
| Source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

Related guides: Sources API and Sources & Customers.

interface Source {
ach_credit_transfer?: SourceTypeAchCreditTransfer;
ach_debit?: SourceTypeAchDebit;
acss_debit?: SourceTypeAcssDebit;
alipay?: SourceTypeAlipay;
allow_redisplay?: "always" | "limited" | "unspecified" | null;
amount?: number | null;
au_becs_debit?: SourceTypeAuBecsDebit;
bancontact?: SourceTypeBancontact;
card?: SourceTypeCard;
card_present?: SourceTypeCardPresent;
client_secret: string;
code_verification?: SourceCodeVerificationFlow;
created: number;
currency?: string | null;
customer?: string;
eps?: SourceTypeEps;
flow: string;
giropay?: SourceTypeGiropay;
id: string;
ideal?: SourceTypeIdeal;
klarna?: SourceTypeKlarna;
livemode: boolean;
metadata?: { } | null;
multibanco?: SourceTypeMultibanco;
object: "source";
owner?: SourceOwner | null;
p24?: SourceTypeP24;
receiver?: SourceReceiverFlow;
redirect?: SourceRedirectFlow;
sepa_debit?: SourceTypeSepaDebit;
sofort?: SourceTypeSofort;
source_order?: SourceOrder;
statement_descriptor?: string | null;
status: string;
three_d_secure?: SourceTypeThreeDSecure;
type: "ach_credit_transfer" | "ach_debit" | "acss_debit" | "alipay" | "au_becs_debit" | "bancontact" | "card" | "card_present" | "eps" | "giropay" | "ideal" | "klarna" | "multibanco" | "p24" | "sepa_debit" | "sofort" | "three_d_secure" | "wechat";
usage?: string | null;
wechat?: SourceTypeWechat;
}
| string | null
;
default_tax_rates?: TaxRate

Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax.

Related guide: Tax rates

interface TaxRate {
active: boolean;
country?: string | null;
created: number;
description?: string | null;
display_name: string;
effective_percentage?: number | null;
flat_amount?: TaxRateFlatAmount | null;
id: string;
inclusive: boolean;
jurisdiction?: string | null;
jurisdiction_level?: "city" | "country" | "county" | "district" | "multiple" | "state" | null;
livemode: boolean;
metadata?: { } | null;
object: "tax_rate";
percentage: number;
rate_type?: "flat_amount" | "percentage" | null;
state?: string | null;
tax_type?: "amusement_tax" | "communications_tax" | "gst" | "hst" | "igst" | "jct" | "lease_tax" | "pst" | "qst" | "retail_delivery_fee" | "rst" | "sales_tax" | "service_tax" | "vat" | null;
}
[]
| null
;
description?: string | null;
discounts: (Discount

A discount represents the actual application of a coupon or promotion code. It contains information about when the discount began, when it will end, and what it is applied to.

Related guide: Applying discounts to subscriptions

interface Discount {
checkout_session?: string | null;
customer?: Customer | DeletedCustomer | string | null;
customer_account?: string | null;
end?: number | null;
id: string;
invoice?: string | null;
invoice_item?: string | null;
object: "discount";
promotion_code?: PromotionCode | string | null;
source: DiscountSource;
start: number;
subscription?: string | null;
subscription_item?: string | null;
}
| string
)[]
;
ended_at?: number | null;
id: string;
invoice_settings: SubscriptionsResourceSubscriptionInvoiceSettings
interface SubscriptionsResourceSubscriptionInvoiceSettings {
account_tax_ids?: (TaxId | DeletedTaxId | string)[] | null;
issuer: ConnectAccountReference;
}
;
items: {
data: SubscriptionItem

Subscription items allow you to create customer subscriptions with more than one plan, making it easy to represent complex billing relationships.

interface SubscriptionItem {
billing_thresholds?: SubscriptionItemBillingThresholds | null;
created: number;
current_period_end: number;
current_period_start: number;
discounts: (Discount | string)[];
id: string;
metadata: { };
object: "subscription_item";
price: Price;
quantity?: number;
subscription: string;
tax_rates?: TaxRate[] | null;
}
[]
;
has_more: boolean;
object: "list";
url: string;
}
;
latest_invoice?: Invoice

Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription.

They contain invoice items, and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary).

If your invoice is configured to be billed through automatic charges, Stripe automatically finalizes your invoice and attempts payment. Note that finalizing the invoice, when automatic, does not happen immediately as the invoice is created. Stripe waits until one hour after the last webhook was successfully sent (or the last webhook timed out after failing). If you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one hour after creation to finalize the invoice.

If your invoice is configured to be billed by sending an email, then based on your email settings, Stripe will email the invoice to your customer and await payment. These emails can contain a link to a hosted page to pay the invoice.

Stripe applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is less than Stripe's minimum allowed charge per currency, the invoice is automatically marked paid, and we add the amount due to the customer's credit balance which is applied to the next invoice.

More details on the customer's credit balance are here.

Related guide: Send invoices to customers

interface Invoice {
account_country?: string | null;
account_name?: string | null;
account_tax_ids?: (TaxId | DeletedTaxId | string)[] | null;
amount_due: number;
amount_overpaid: number;
amount_paid: number;
amount_remaining: number;
amount_shipping: number;
application?: Application | DeletedApplication | string | null;
attempt_count: number;
attempted: boolean;
auto_advance: boolean;
automatic_tax: AutomaticTax;
automatically_finalizes_at?: number | null;
billing_reason?: "automatic_pending_invoice_item_invoice" | "manual" | "quote_accept" | "subscription" | "subscription_create" | "subscription_cycle" | "subscription_threshold" | "subscription_update" | "upcoming" | null;
collection_method: "charge_automatically" | "send_invoice";
confirmation_secret?: InvoicesResourceConfirmationSecret | null;
created: number;
currency: string;
custom_fields?: InvoiceSettingCustomField[] | null;
customer: Customer | DeletedCustomer | string;
customer_account?: string | null;
customer_address?: Address | null;
customer_email?: string | null;
customer_name?: string | null;
customer_phone?: string | null;
customer_shipping?: Shipping | null;
customer_tax_exempt?: "exempt" | "none" | "reverse" | null;
customer_tax_ids?: InvoicesResourceInvoiceTaxId[] | null;
default_payment_method?: PaymentMethod | string | null;
default_source?: BankAccount | Card | Source | string | null;
default_tax_rates: TaxRate[];
description?: string | null;
discounts: (Discount | DeletedDiscount | string)[];
due_date?: number | null;
effective_at?: number | null;
ending_balance?: number | null;
footer?: string | null;
from_invoice?: InvoicesResourceFromInvoice | null;
hosted_invoice_url?: string | null;
id: string;
invoice_pdf?: string | null;
issuer: ConnectAccountReference;
last_finalization_error?: ApiErrors | null;
latest_revision?: Invoice | string | null;
lines: {
data: LineItem[];
has_more: boolean;
object: "list";
url: string;
}
;
livemode: boolean;
metadata?: { } | null;
next_payment_attempt?: number | null;
number?: string | null;
object: "invoice";
on_behalf_of?: Account | string | null;
parent?: BillingBillResourceInvoicingParentsInvoiceParent | null;
payment_settings: InvoicesPaymentSettings;
payments?: {
data: InvoicePayment[];
has_more: boolean;
object: "list";
url: string;
}
;
period_end: number;
period_start: number;
post_payment_credit_notes_amount: number;
pre_payment_credit_notes_amount: number;
receipt_number?: string | null;
rendering?: InvoicesResourceInvoiceRendering | null;
shipping_cost?: InvoicesResourceShippingCost | null;
shipping_details?: Shipping | null;
starting_balance: number;
statement_descriptor?: string | null;
status?: "draft" | "open" | "paid" | "uncollectible" | "void" | null;
status_transitions: InvoicesResourceStatusTransitions;
subtotal: number;
subtotal_excluding_tax?: number | null;
test_clock?: TestHelpersTestClock | string | null;
threshold_reason?: InvoiceThresholdReason;
total: number;
total_discount_amounts?: DiscountsResourceDiscountAmount[] | null;
total_excluding_tax?: number | null;
total_pretax_credit_amounts?: InvoicesResourcePretaxCreditAmount[] | null;
total_taxes?: BillingBillResourceInvoicingTaxesTax[] | null;
webhooks_delivered_at?: number | null;
}
| string | null
;
livemode: boolean;
metadata: { };
next_pending_invoice_item_invoice?: number | null;
object: "subscription";
on_behalf_of?: Account

This is an object representing a Stripe account. You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts.

For accounts where controller.requirement_collection is application, which includes Custom accounts, the properties below are always returned.

For accounts where controller.requirement_collection is stripe, which includes Standard and Express accounts, some properties are only returned until you create an Account Link or Account Session to start Connect Onboarding. Learn about the differences between accounts.

interface Account {
business_profile?: AccountBusinessProfile | null;
business_type?: "company" | "government_entity" | "individual" | "non_profit" | null;
capabilities?: AccountCapabilities;
charges_enabled?: boolean;
company?: LegalEntityCompany;
controller?: AccountUnificationAccountController;
country?: string;
created?: number;
default_currency?: string;
details_submitted?: boolean;
email?: string | null;
external_accounts?: {
data: (BankAccount | Card)[];
has_more: boolean;
object: "list";
url: string;
}
;
future_requirements?: AccountFutureRequirements;
groups?: AccountGroupMembership | null;
id: string;
individual?: Person;
metadata?: { };
object: "account";
payouts_enabled?: boolean;
requirements?: AccountRequirements;
settings?: AccountSettings | null;
tos_acceptance?: AccountTosAcceptance;
type?: "custom" | "express" | "none" | "standard";
}
| string | null
;
pause_collection?: SubscriptionsResourcePauseCollection

The Pause Collection settings determine how we will pause collection for this subscription and for how long the subscription should be paused.

interface SubscriptionsResourcePauseCollection {
behavior: "keep_as_draft" | "mark_uncollectible" | "void";
resumes_at?: number | null;
}
| null
;
payment_settings?: SubscriptionsResourcePaymentSettings
interface SubscriptionsResourcePaymentSettings {
payment_method_options?: SubscriptionsResourcePaymentMethodOptions | null;
payment_method_types?: ("ach_credit_transfer" | "ach_debit" | "acss_debit" | "affirm" | "amazon_pay" | "au_becs_debit" | "bacs_debit" | "bancontact" | "boleto" | "card" | "cashapp" | "crypto" | "custom" | "customer_balance" | "eps" | "fpx" | "giropay" | "grabpay" | "ideal" | "jp_credit_transfer" | "kakao_pay" | "klarna" | "konbini" | "kr_card" | "link" | "multibanco" | "naver_pay" | "nz_bank_account" | "p24" | "payco" | "paynow" | "paypal" | "payto" | "promptpay" | "revolut_pay" | "sepa_credit_transfer" | "sepa_debit" | "sofort" | "swish" | "us_bank_account" | "wechat_pay")[] | null;
save_default_payment_method?: "off" | "on_subscription" | null;
}
| null
;
pending_invoice_item_interval?: SubscriptionPendingInvoiceItemInterval
interface SubscriptionPendingInvoiceItemInterval {
interval: "day" | "month" | "week" | "year";
interval_count: number;
}
| null
;
pending_setup_intent?: SetupIntent

A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use PaymentIntents to drive the payment flow.

Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent transitions through multiple statuses as it guides you through the setup process.

Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in certain regions might need to be run through Strong Customer Authentication during payment method collection to streamline later off-session payments. If you use the SetupIntent with a Customer, it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or setup_future_usage on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.

By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.

Related guide: Setup Intents API

interface SetupIntent {
application?: Application | string | null;
attach_to_self?: boolean;
automatic_payment_methods?: PaymentFlowsAutomaticPaymentMethodsSetupIntent | null;
cancellation_reason?: "abandoned" | "duplicate" | "requested_by_customer" | null;
client_secret?: string | null;
created: number;
customer?: Customer | DeletedCustomer | string | null;
customer_account?: string | null;
description?: string | null;
excluded_payment_method_types?: ("acss_debit" | "affirm" | "afterpay_clearpay" | "alipay" | "alma" | "amazon_pay" | "au_becs_debit" | "bacs_debit" | "bancontact" | "billie" | "blik" | "boleto" | "card" | "cashapp" | "crypto" | "customer_balance" | "eps" | "fpx" | "giropay" | "grabpay" | "ideal" | "kakao_pay" | "klarna" | "konbini" | "kr_card" | "mb_way" | "mobilepay" | "multibanco" | "naver_pay" | "nz_bank_account" | "oxxo" | "p24" | "pay_by_bank" | "payco" | "paynow" | "paypal" | "payto" | "pix" | "promptpay" | "revolut_pay" | "samsung_pay" | "satispay" | "sepa_debit" | "sofort" | "swish" | "twint" | "us_bank_account" | "wechat_pay" | "zip")[] | null;
flow_directions?: ("inbound" | "outbound")[] | null;
id: string;
last_setup_error?: ApiErrors | null;
latest_attempt?: SetupAttempt | string | null;
livemode: boolean;
mandate?: Mandate | string | null;
metadata?: { } | null;
next_action?: SetupIntentNextAction | null;
object: "setup_intent";
on_behalf_of?: Account | string | null;
payment_method?: PaymentMethod | string | null;
payment_method_configuration_details?: PaymentMethodConfigBizPaymentMethodConfigurationDetails | null;
payment_method_options?: SetupIntentPaymentMethodOptions | null;
payment_method_types: string[];
single_use_mandate?: Mandate | string | null;
status: "canceled" | "processing" | "requires_action" | "requires_confirmation" | "requires_payment_method" | "succeeded";
usage: string;
}
| string | null
;
pending_update?: SubscriptionsResourcePendingUpdate

Pending Updates store the changes pending from a previous update that will be applied to the Subscription upon successful payment.

interface SubscriptionsResourcePendingUpdate {
billing_cycle_anchor?: number | null;
expires_at: number;
subscription_items?: SubscriptionItem[] | null;
trial_end?: number | null;
trial_from_plan?: boolean | null;
}
| null
;
schedule?: SubscriptionSchedule

A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes.

Related guide: Subscription schedules

interface SubscriptionSchedule {
application?: Application | DeletedApplication | string | null;
billing_mode: SubscriptionsResourceBillingMode;
canceled_at?: number | null;
completed_at?: number | null;
created: number;
current_phase?: SubscriptionScheduleCurrentPhase | null;
customer: Customer | DeletedCustomer | string;
customer_account?: string | null;
default_settings: SubscriptionSchedulesResourceDefaultSettings;
end_behavior: "cancel" | "none" | "release" | "renew";
id: string;
livemode: boolean;
metadata?: { } | null;
object: "subscription_schedule";
phases: SubscriptionSchedulePhaseConfiguration[];
released_at?: number | null;
released_subscription?: string | null;
status: "active" | "canceled" | "completed" | "not_started" | "released";
subscription?: Subscription | string | null;
test_clock?: TestHelpersTestClock | string | null;
}
| string | null
;
start_date: number;
status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
test_clock?: TestHelpersTestClock

A test clock enables deterministic control over objects in testmode. With a test clock, you can create objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.

interface TestHelpersTestClock {
created: number;
deletes_after: number;
frozen_time: number;
id: string;
livemode: boolean;
name?: string | null;
object: "test_helpers.test_clock";
status: "advancing" | "internal_failure" | "ready";
status_details: BillingClocksResourceStatusDetailsStatusDetails;
}
| string | null
;
transfer_data?: SubscriptionTransferData
interface SubscriptionTransferData {
amount_percent?: number | null;
destination: Account | string;
}
| null
;
trial_end?: number | null;
trial_settings?: SubscriptionsTrialsResourceTrialSettings

Configures how this subscription behaves during the trial period.

interface SubscriptionsTrialsResourceTrialSettings {
end_behavior: SubscriptionsTrialsResourceEndBehavior;
}
| null
;
trial_start?: number | null;
}
default application/json

Error response.

interface Error {
error: ApiErrors
interface ApiErrors {
advice_code?: string;
charge?: string;
code?: string;
decline_code?: string;
doc_url?: string;
message?: string;
network_advice_code?: string;
network_decline_code?: string;
param?: string;
payment_intent?: PaymentIntent;
payment_method?: PaymentMethod;
payment_method_type?: string;
request_log_url?: string;
setup_intent?: SetupIntent;
source?: BankAccount | Card | Source;
type: "api_error" | "card_error" | "idempotency_error" | "invalid_request_error";
}
;
}