Debian Codegraph @

stripe/params/_subscription_update_params.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from typing import Dict, List
4 from typing_extensions import Literal, NotRequired, TypedDict
5
6
7 class SubscriptionUpdateParams(TypedDict):
8 add_invoice_items: NotRequired[
9 List["SubscriptionUpdateParamsAddInvoiceItem"]
10 ]
11 """
12 A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.
13 """
14 application_fee_percent: NotRequired["Literal['']|float"]
15 """
16 A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
17 """
18 automatic_tax: NotRequired["SubscriptionUpdateParamsAutomaticTax"]
19 """
20 Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
21 """
22 billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]]
23 """
24 Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle).
25 """
26 billing_thresholds: NotRequired[
27 "Literal['']|SubscriptionUpdateParamsBillingThresholds"
28 ]
29 """
30 Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
31 """
32 cancel_at: NotRequired[
33 "Literal['']|int|Literal['max_period_end', 'min_period_end']"
34 ]
35 """
36 A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
37 """
38 cancel_at_period_end: NotRequired[bool]
39 """
40 Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
41 """
42 cancellation_details: NotRequired[
43 "SubscriptionUpdateParamsCancellationDetails"
44 ]
45 """
46 Details about why this subscription was cancelled
47 """
48 collection_method: NotRequired[
49 Literal["charge_automatically", "send_invoice"]
50 ]
51 """
52 Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
53 """
54 days_until_due: NotRequired[int]
55 """
56 Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
57 """
58 default_payment_method: NotRequired[str]
59 """
60 ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
61 """
62 default_source: NotRequired["Literal['']|str"]
63 """
64 ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
65 """
66 default_tax_rates: NotRequired["Literal['']|List[str]"]
67 """
68 The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates.
69 """
70 description: NotRequired["Literal['']|str"]
71 """
72 The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
73 """
74 discounts: NotRequired[
75 "Literal['']|List[SubscriptionUpdateParamsDiscount]"
76 ]
77 """
78 The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
79 """
80 expand: NotRequired[List[str]]
81 """
82 Specifies which fields in the response should be expanded.
83 """
84 invoice_settings: NotRequired["SubscriptionUpdateParamsInvoiceSettings"]
85 """
86 All invoices will be billed using the specified settings.
87 """
88 items: NotRequired[List["SubscriptionUpdateParamsItem"]]
89 """
90 A list of up to 20 subscription items, each with an attached price.
91 """
92 metadata: NotRequired["Literal['']|Dict[str, str]"]
93 """
94 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
95 """
96 off_session: NotRequired[bool]
97 """
98 Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
99 """
100 on_behalf_of: NotRequired["Literal['']|str"]
101 """
102 The account on behalf of which to charge, for each of the subscription's invoices.
103 """
104 pause_collection: NotRequired[
105 "Literal['']|SubscriptionUpdateParamsPauseCollection"
106 ]
107 """
108 If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
109 """
110 payment_behavior: NotRequired[
111 Literal[
112 "allow_incomplete",
113 "default_incomplete",
114 "error_if_incomplete",
115 "pending_if_incomplete",
116 ]
117 ]
118 """
119 Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://docs.stripe.com/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.
120
121 Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://docs.stripe.com/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.
122
123 Use `pending_if_incomplete` to update the subscription using [pending updates](https://docs.stripe.com/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://docs.stripe.com/billing/pending-updates-reference#supported-attributes).
124
125 Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
126 """
127 payment_settings: NotRequired["SubscriptionUpdateParamsPaymentSettings"]
128 """
129 Payment settings to pass to invoices created by the subscription.
130 """
131 pending_invoice_item_interval: NotRequired[
132 "Literal['']|SubscriptionUpdateParamsPendingInvoiceItemInterval"
133 ]
134 """
135 Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval.
136 """
137 proration_behavior: NotRequired[
138 Literal["always_invoice", "create_prorations", "none"]
139 ]
140 """
141 Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
142 """
143 proration_date: NotRequired[int]
144 """
145 If set, prorations will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. `proration_date` can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
146 """
147 transfer_data: NotRequired[
148 "Literal['']|SubscriptionUpdateParamsTransferData"
149 ]
150 """
151 If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value.
152 """
153 trial_end: NotRequired["Literal['now']|int"]
154 """
155 Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, `trial_end` will override the default trial period of the plan the customer is being subscribed to. The `billing_cycle_anchor` will be updated to the `trial_end` value. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
156 """
157 trial_from_plan: NotRequired[bool]
158 """
159 Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
160 """
161 trial_settings: NotRequired["SubscriptionUpdateParamsTrialSettings"]
162 """
163 Settings related to subscription trials.
164 """
165
166
167 class SubscriptionUpdateParamsAddInvoiceItem(TypedDict):
168 discounts: NotRequired[
169 List["SubscriptionUpdateParamsAddInvoiceItemDiscount"]
170 ]
171 """
172 The coupons to redeem into discounts for the item.
173 """
174 metadata: NotRequired[Dict[str, str]]
175 """
176 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
177 """
178 period: NotRequired["SubscriptionUpdateParamsAddInvoiceItemPeriod"]
179 """
180 The period associated with this invoice item. If not set, `period.start.type` defaults to `max_item_period_start` and `period.end.type` defaults to `min_item_period_end`.
181 """
182 price: NotRequired[str]
183 """
184 The ID of the price object. One of `price` or `price_data` is required.
185 """
186 price_data: NotRequired["SubscriptionUpdateParamsAddInvoiceItemPriceData"]
187 """
188 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
189 """
190 quantity: NotRequired[int]
191 """
192 Quantity for this item. Defaults to 1.
193 """
194 tax_rates: NotRequired["Literal['']|List[str]"]
195 """
196 The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
197 """
198
199
200 class SubscriptionUpdateParamsAddInvoiceItemDiscount(TypedDict):
201 coupon: NotRequired[str]
202 """
203 ID of the coupon to create a new discount for.
204 """
205 discount: NotRequired[str]
206 """
207 ID of an existing discount on the object (or one of its ancestors) to reuse.
208 """
209 promotion_code: NotRequired[str]
210 """
211 ID of the promotion code to create a new discount for.
212 """
213
214
215 class SubscriptionUpdateParamsAddInvoiceItemPeriod(TypedDict):
216 end: "SubscriptionUpdateParamsAddInvoiceItemPeriodEnd"
217 """
218 End of the invoice item period.
219 """
220 start: "SubscriptionUpdateParamsAddInvoiceItemPeriodStart"
221 """
222 Start of the invoice item period.
223 """
224
225
226 class SubscriptionUpdateParamsAddInvoiceItemPeriodEnd(TypedDict):
227 timestamp: NotRequired[int]
228 """
229 A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
230 """
231 type: Literal["min_item_period_end", "timestamp"]
232 """
233 Select how to calculate the end of the invoice item period.
234 """
235
236
237 class SubscriptionUpdateParamsAddInvoiceItemPeriodStart(TypedDict):
238 timestamp: NotRequired[int]
239 """
240 A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
241 """
242 type: Literal["max_item_period_start", "now", "timestamp"]
243 """
244 Select how to calculate the start of the invoice item period.
245 """
246
247
248 class SubscriptionUpdateParamsAddInvoiceItemPriceData(TypedDict):
249 currency: str
250 """
251 Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
252 """
253 product: str
254 """
255 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
256 """
257 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
258 """
259 Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
260 """
261 unit_amount: NotRequired[int]
262 """
263 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
264 """
265 unit_amount_decimal: NotRequired[str]
266 """
267 Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
268 """
269
270
271 class SubscriptionUpdateParamsAutomaticTax(TypedDict):
272 enabled: bool
273 """
274 Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
275 """
276 liability: NotRequired["SubscriptionUpdateParamsAutomaticTaxLiability"]
277 """
278 The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
279 """
280
281
282 class SubscriptionUpdateParamsAutomaticTaxLiability(TypedDict):
283 account: NotRequired[str]
284 """
285 The connected account being referenced when `type` is `account`.
286 """
287 type: Literal["account", "self"]
288 """
289 Type of the account referenced in the request.
290 """
291
292
293 class SubscriptionUpdateParamsBillingThresholds(TypedDict):
294 amount_gte: NotRequired[int]
295 """
296 Monetary threshold that triggers the subscription to advance to a new billing period
297 """
298 reset_billing_cycle_anchor: NotRequired[bool]
299 """
300 Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
301 """
302
303
304 class SubscriptionUpdateParamsCancellationDetails(TypedDict):
305 comment: NotRequired["Literal['']|str"]
306 """
307 Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
308 """
309 feedback: NotRequired[
310 "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']"
311 ]
312 """
313 The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
314 """
315
316
317 class SubscriptionUpdateParamsDiscount(TypedDict):
318 coupon: NotRequired[str]
319 """
320 ID of the coupon to create a new discount for.
321 """
322 discount: NotRequired[str]
323 """
324 ID of an existing discount on the object (or one of its ancestors) to reuse.
325 """
326 promotion_code: NotRequired[str]
327 """
328 ID of the promotion code to create a new discount for.
329 """
330
331
332 class SubscriptionUpdateParamsInvoiceSettings(TypedDict):
333 account_tax_ids: NotRequired["Literal['']|List[str]"]
334 """
335 The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
336 """
337 issuer: NotRequired["SubscriptionUpdateParamsInvoiceSettingsIssuer"]
338 """
339 The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
340 """
341
342
343 class SubscriptionUpdateParamsInvoiceSettingsIssuer(TypedDict):
344 account: NotRequired[str]
345 """
346 The connected account being referenced when `type` is `account`.
347 """
348 type: Literal["account", "self"]
349 """
350 Type of the account referenced in the request.
351 """
352
353
354 class SubscriptionUpdateParamsItem(TypedDict):
355 billing_thresholds: NotRequired[
356 "Literal['']|SubscriptionUpdateParamsItemBillingThresholds"
357 ]
358 """
359 Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
360 """
361 clear_usage: NotRequired[bool]
362 """
363 Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
364 """
365 deleted: NotRequired[bool]
366 """
367 A flag that, if set to `true`, will delete the specified item.
368 """
369 discounts: NotRequired[
370 "Literal['']|List[SubscriptionUpdateParamsItemDiscount]"
371 ]
372 """
373 The coupons to redeem into discounts for the subscription item.
374 """
375 id: NotRequired[str]
376 """
377 Subscription item to update.
378 """
379 metadata: NotRequired["Literal['']|Dict[str, str]"]
380 """
381 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
382 """
383 plan: NotRequired[str]
384 """
385 Plan ID for this item, as a string.
386 """
387 price: NotRequired[str]
388 """
389 The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
390 """
391 price_data: NotRequired["SubscriptionUpdateParamsItemPriceData"]
392 """
393 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
394 """
395 quantity: NotRequired[int]
396 """
397 Quantity for this item.
398 """
399 tax_rates: NotRequired["Literal['']|List[str]"]
400 """
401 A list of [Tax Rate](https://docs.stripe.com/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://docs.stripe.com/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
402 """
403
404
405 class SubscriptionUpdateParamsItemBillingThresholds(TypedDict):
406 usage_gte: int
407 """
408 Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://docs.stripe.com/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
409 """
410
411
412 class SubscriptionUpdateParamsItemDiscount(TypedDict):
413 coupon: NotRequired[str]
414 """
415 ID of the coupon to create a new discount for.
416 """
417 discount: NotRequired[str]
418 """
419 ID of an existing discount on the object (or one of its ancestors) to reuse.
420 """
421 promotion_code: NotRequired[str]
422 """
423 ID of the promotion code to create a new discount for.
424 """
425
426
427 class SubscriptionUpdateParamsItemPriceData(TypedDict):
428 currency: str
429 """
430 Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
431 """
432 product: str
433 """
434 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
435 """
436 recurring: "SubscriptionUpdateParamsItemPriceDataRecurring"
437 """
438 The recurring components of a price such as `interval` and `interval_count`.
439 """
440 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
441 """
442 Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
443 """
444 unit_amount: NotRequired[int]
445 """
446 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
447 """
448 unit_amount_decimal: NotRequired[str]
449 """
450 Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
451 """
452
453
454 class SubscriptionUpdateParamsItemPriceDataRecurring(TypedDict):
455 interval: Literal["day", "month", "week", "year"]
456 """
457 Specifies billing frequency. Either `day`, `week`, `month` or `year`.
458 """
459 interval_count: NotRequired[int]
460 """
461 The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
462 """
463
464
465 class SubscriptionUpdateParamsPauseCollection(TypedDict):
466 behavior: Literal["keep_as_draft", "mark_uncollectible", "void"]
467 """
468 The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
469 """
470 resumes_at: NotRequired[int]
471 """
472 The time after which the subscription will resume collecting payments.
473 """
474
475
476 class SubscriptionUpdateParamsPaymentSettings(TypedDict):
477 payment_method_options: NotRequired[
478 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptions"
479 ]
480 """
481 Payment-method-specific configuration to provide to invoices created by the subscription.
482 """
483 payment_method_types: NotRequired[
484 "Literal['']|List[Literal['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', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]"
485 ]
486 """
487 The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
488 """
489 save_default_payment_method: NotRequired[Literal["off", "on_subscription"]]
490 """
491 Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
492 """
493
494
495 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict):
496 acss_debit: NotRequired[
497 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit"
498 ]
499 """
500 This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent.
501 """
502 bancontact: NotRequired[
503 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact"
504 ]
505 """
506 This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
507 """
508 card: NotRequired[
509 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCard"
510 ]
511 """
512 This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
513 """
514 customer_balance: NotRequired[
515 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance"
516 ]
517 """
518 This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent.
519 """
520 konbini: NotRequired[
521 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsKonbini"
522 ]
523 """
524 This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
525 """
526 payto: NotRequired[
527 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPayto"
528 ]
529 """
530 This sub-hash contains details about the PayTo payment method options to pass to the invoice's PaymentIntent.
531 """
532 sepa_debit: NotRequired[
533 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit"
534 ]
535 """
536 This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent.
537 """
538 us_bank_account: NotRequired[
539 "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount"
540 ]
541 """
542 This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent.
543 """
544
545
546 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(
547 TypedDict,
548 ):
549 mandate_options: NotRequired[
550 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions"
551 ]
552 """
553 Additional fields for Mandate creation
554 """
555 verification_method: NotRequired[
556 Literal["automatic", "instant", "microdeposits"]
557 ]
558 """
559 Verification method for the intent
560 """
561
562
563 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions(
564 TypedDict,
565 ):
566 transaction_type: NotRequired[Literal["business", "personal"]]
567 """
568 Transaction type of the mandate.
569 """
570
571
572 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact(
573 TypedDict,
574 ):
575 preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]]
576 """
577 Preferred language of the Bancontact authorization page that the customer is redirected to.
578 """
579
580
581 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCard(
582 TypedDict,
583 ):
584 mandate_options: NotRequired[
585 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions"
586 ]
587 """
588 Configuration options for setting up an eMandate for cards issued in India.
589 """
590 network: NotRequired[
591 Literal[
592 "amex",
593 "cartes_bancaires",
594 "diners",
595 "discover",
596 "eftpos_au",
597 "girocard",
598 "interac",
599 "jcb",
600 "link",
601 "mastercard",
602 "unionpay",
603 "unknown",
604 "visa",
605 ]
606 ]
607 """
608 Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time.
609 """
610 request_three_d_secure: NotRequired[
611 Literal["any", "automatic", "challenge"]
612 ]
613 """
614 We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
615 """
616
617
618 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions(
619 TypedDict,
620 ):
621 amount: NotRequired[int]
622 """
623 Amount to be charged for future payments.
624 """
625 amount_type: NotRequired[Literal["fixed", "maximum"]]
626 """
627 One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
628 """
629 description: NotRequired[str]
630 """
631 A description of the mandate or subscription that is meant to be displayed to the customer.
632 """
633
634
635 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance(
636 TypedDict,
637 ):
638 bank_transfer: NotRequired[
639 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer"
640 ]
641 """
642 Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
643 """
644 funding_type: NotRequired[str]
645 """
646 The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
647 """
648
649
650 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer(
651 TypedDict,
652 ):
653 eu_bank_transfer: NotRequired[
654 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer"
655 ]
656 """
657 Configuration for eu_bank_transfer funding type.
658 """
659 type: NotRequired[str]
660 """
661 The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
662 """
663
664
665 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer(
666 TypedDict,
667 ):
668 country: str
669 """
670 The desired country code of the bank account information. Permitted values include: `DE`, `FR`, `IE`, or `NL`.
671 """
672
673
674 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(
675 TypedDict,
676 ):
677 pass
678
679
680 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPayto(
681 TypedDict,
682 ):
683 mandate_options: NotRequired[
684 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions"
685 ]
686 """
687 Additional fields for Mandate creation.
688 """
689
690
691 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions(
692 TypedDict,
693 ):
694 amount: NotRequired[int]
695 """
696 The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit.
697 """
698 purpose: NotRequired[
699 Literal[
700 "dependant_support",
701 "government",
702 "loan",
703 "mortgage",
704 "other",
705 "pension",
706 "personal",
707 "retail",
708 "salary",
709 "tax",
710 "utility",
711 ]
712 ]
713 """
714 The purpose for which payments are made. Has a default value based on your merchant category code.
715 """
716
717
718 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(
719 TypedDict,
720 ):
721 pass
722
723
724 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount(
725 TypedDict,
726 ):
727 financial_connections: NotRequired[
728 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections"
729 ]
730 """
731 Additional fields for Financial Connections Session creation
732 """
733 verification_method: NotRequired[
734 Literal["automatic", "instant", "microdeposits"]
735 ]
736 """
737 Verification method for the intent
738 """
739
740
741 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections(
742 TypedDict,
743 ):
744 filters: NotRequired[
745 "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters"
746 ]
747 """
748 Provide filters for the linked accounts that the customer can select for the payment method.
749 """
750 permissions: NotRequired[
751 List[
752 Literal["balances", "ownership", "payment_method", "transactions"]
753 ]
754 ]
755 """
756 The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
757 """
758 prefetch: NotRequired[
759 List[Literal["balances", "ownership", "transactions"]]
760 ]
761 """
762 List of data features that you would like to retrieve upon account creation.
763 """
764
765
766 class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters(
767 TypedDict,
768 ):
769 account_subcategories: NotRequired[List[Literal["checking", "savings"]]]
770 """
771 The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
772 """
773
774
775 class SubscriptionUpdateParamsPendingInvoiceItemInterval(TypedDict):
776 interval: Literal["day", "month", "week", "year"]
777 """
778 Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
779 """
780 interval_count: NotRequired[int]
781 """
782 The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
783 """
784
785
786 class SubscriptionUpdateParamsTransferData(TypedDict):
787 amount_percent: NotRequired[float]
788 """
789 A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
790 """
791 destination: str
792 """
793 ID of an existing, connected Stripe account.
794 """
795
796
797 class SubscriptionUpdateParamsTrialSettings(TypedDict):
798 end_behavior: "SubscriptionUpdateParamsTrialSettingsEndBehavior"
799 """
800 Defines how the subscription should behave when the user's free trial ends.
801 """
802
803
804 class SubscriptionUpdateParamsTrialSettingsEndBehavior(TypedDict):
805 missing_payment_method: Literal["cancel", "create_invoice", "pause"]
806 """
807 Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
808 """