Debian Codegraph @

stripe/params/_subscription_create_params.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._request_options import RequestOptions
4 from typing import Dict, List
5 from typing_extensions import Literal, NotRequired, TypedDict
6
7
8 class SubscriptionCreateParams(RequestOptions):
9 add_invoice_items: NotRequired[
10 List["SubscriptionCreateParamsAddInvoiceItem"]
11 ]
12 """
13 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.
14 """
15 application_fee_percent: NotRequired["Literal['']|float"]
16 """
17 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).
18 """
19 automatic_tax: NotRequired["SubscriptionCreateParamsAutomaticTax"]
20 """
21 Automatic tax settings for this subscription.
22 """
23 backdate_start_date: NotRequired[int]
24 """
25 A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.
26 """
27 billing_cycle_anchor: NotRequired[int]
28 """
29 A future timestamp in UTC format to anchor the subscription's [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
30 """
31 billing_cycle_anchor_config: NotRequired[
32 "SubscriptionCreateParamsBillingCycleAnchorConfig"
33 ]
34 """
35 Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurrence of the day_of_month at the hour, minute, and second UTC.
36 """
37 billing_mode: NotRequired["SubscriptionCreateParamsBillingMode"]
38 """
39 Controls how prorations and invoices for subscriptions are calculated and orchestrated.
40 """
41 billing_thresholds: NotRequired[
42 "Literal['']|SubscriptionCreateParamsBillingThresholds"
43 ]
44 """
45 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.
46 """
47 cancel_at: NotRequired["int|Literal['max_period_end', 'min_period_end']"]
48 """
49 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.
50 """
51 cancel_at_period_end: NotRequired[bool]
52 """
53 Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
54 """
55 collection_method: NotRequired[
56 Literal["charge_automatically", "send_invoice"]
57 ]
58 """
59 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`.
60 """
61 currency: NotRequired[str]
62 """
63 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).
64 """
65 customer: NotRequired[str]
66 """
67 The identifier of the customer to subscribe.
68 """
69 customer_account: NotRequired[str]
70 """
71 The identifier of the account representing the customer to subscribe.
72 """
73 days_until_due: NotRequired[int]
74 """
75 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`.
76 """
77 default_payment_method: NotRequired[str]
78 """
79 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).
80 """
81 default_source: NotRequired[str]
82 """
83 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).
84 """
85 default_tax_rates: NotRequired["Literal['']|List[str]"]
86 """
87 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.
88 """
89 description: NotRequired[str]
90 """
91 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.
92 """
93 discounts: NotRequired[
94 "Literal['']|List[SubscriptionCreateParamsDiscount]"
95 ]
96 """
97 The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
98 """
99 expand: NotRequired[List[str]]
100 """
101 Specifies which fields in the response should be expanded.
102 """
103 invoice_settings: NotRequired["SubscriptionCreateParamsInvoiceSettings"]
104 """
105 All invoices will be billed using the specified settings.
106 """
107 items: NotRequired[List["SubscriptionCreateParamsItem"]]
108 """
109 A list of up to 20 subscription items, each with an attached price.
110 """
111 metadata: NotRequired["Literal['']|Dict[str, str]"]
112 """
113 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`.
114 """
115 off_session: NotRequired[bool]
116 """
117 Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
118 """
119 on_behalf_of: NotRequired["Literal['']|str"]
120 """
121 The account on behalf of which to charge, for each of the subscription's invoices.
122 """
123 payment_behavior: NotRequired[
124 Literal[
125 "allow_incomplete",
126 "default_incomplete",
127 "error_if_incomplete",
128 "pending_if_incomplete",
129 ]
130 ]
131 """
132 Only applies to subscriptions with `collection_method=charge_automatically`.
133
134 Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. Creating Subscriptions with this status allows you to manage scenarios where additional customer 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.
135
136 Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. This allows simpler management of scenarios where additional customer 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. If the PaymentIntent is not confirmed within 23 hours Subscriptions transition to `status=incomplete_expired`, which is a terminal state.
137
138 Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice can't be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't create a 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/upgrades#2019-03-14) to learn more.
139
140 `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription.
141
142 Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status.
143 """
144 payment_settings: NotRequired["SubscriptionCreateParamsPaymentSettings"]
145 """
146 Payment settings to pass to invoices created by the subscription.
147 """
148 pending_invoice_item_interval: NotRequired[
149 "Literal['']|SubscriptionCreateParamsPendingInvoiceItemInterval"
150 ]
151 """
152 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.
153 """
154 proration_behavior: NotRequired[
155 Literal["always_invoice", "create_prorations", "none"]
156 ]
157 """
158 Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.
159 """
160 transfer_data: NotRequired["SubscriptionCreateParamsTransferData"]
161 """
162 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.
163 """
164 trial_end: NotRequired["Literal['now']|int"]
165 """
166 Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
167 """
168 trial_from_plan: NotRequired[bool]
169 """
170 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.
171 """
172 trial_period_days: NotRequired[int]
173 """
174 Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
175 """
176 trial_settings: NotRequired["SubscriptionCreateParamsTrialSettings"]
177 """
178 Settings related to subscription trials.
179 """
180
181
182 class SubscriptionCreateParamsAddInvoiceItem(TypedDict):
183 discounts: NotRequired[
184 List["SubscriptionCreateParamsAddInvoiceItemDiscount"]
185 ]
186 """
187 The coupons to redeem into discounts for the item.
188 """
189 metadata: NotRequired[Dict[str, str]]
190 """
191 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`.
192 """
193 period: NotRequired["SubscriptionCreateParamsAddInvoiceItemPeriod"]
194 """
195 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`.
196 """
197 price: NotRequired[str]
198 """
199 The ID of the price object. One of `price` or `price_data` is required.
200 """
201 price_data: NotRequired["SubscriptionCreateParamsAddInvoiceItemPriceData"]
202 """
203 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
204 """
205 quantity: NotRequired[int]
206 """
207 Quantity for this item. Defaults to 1.
208 """
209 tax_rates: NotRequired["Literal['']|List[str]"]
210 """
211 The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
212 """
213
214
215 class SubscriptionCreateParamsAddInvoiceItemDiscount(TypedDict):
216 coupon: NotRequired[str]
217 """
218 ID of the coupon to create a new discount for.
219 """
220 discount: NotRequired[str]
221 """
222 ID of an existing discount on the object (or one of its ancestors) to reuse.
223 """
224 promotion_code: NotRequired[str]
225 """
226 ID of the promotion code to create a new discount for.
227 """
228
229
230 class SubscriptionCreateParamsAddInvoiceItemPeriod(TypedDict):
231 end: "SubscriptionCreateParamsAddInvoiceItemPeriodEnd"
232 """
233 End of the invoice item period.
234 """
235 start: "SubscriptionCreateParamsAddInvoiceItemPeriodStart"
236 """
237 Start of the invoice item period.
238 """
239
240
241 class SubscriptionCreateParamsAddInvoiceItemPeriodEnd(TypedDict):
242 timestamp: NotRequired[int]
243 """
244 A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
245 """
246 type: Literal["min_item_period_end", "timestamp"]
247 """
248 Select how to calculate the end of the invoice item period.
249 """
250
251
252 class SubscriptionCreateParamsAddInvoiceItemPeriodStart(TypedDict):
253 timestamp: NotRequired[int]
254 """
255 A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
256 """
257 type: Literal["max_item_period_start", "now", "timestamp"]
258 """
259 Select how to calculate the start of the invoice item period.
260 """
261
262
263 class SubscriptionCreateParamsAddInvoiceItemPriceData(TypedDict):
264 currency: str
265 """
266 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).
267 """
268 product: str
269 """
270 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
271 """
272 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
273 """
274 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.
275 """
276 unit_amount: NotRequired[int]
277 """
278 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.
279 """
280 unit_amount_decimal: NotRequired[str]
281 """
282 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.
283 """
284
285
286 class SubscriptionCreateParamsAutomaticTax(TypedDict):
287 enabled: bool
288 """
289 Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
290 """
291 liability: NotRequired["SubscriptionCreateParamsAutomaticTaxLiability"]
292 """
293 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.
294 """
295
296
297 class SubscriptionCreateParamsAutomaticTaxLiability(TypedDict):
298 account: NotRequired[str]
299 """
300 The connected account being referenced when `type` is `account`.
301 """
302 type: Literal["account", "self"]
303 """
304 Type of the account referenced in the request.
305 """
306
307
308 class SubscriptionCreateParamsBillingCycleAnchorConfig(TypedDict):
309 day_of_month: int
310 """
311 The day of the month the anchor should be. Ranges from 1 to 31.
312 """
313 hour: NotRequired[int]
314 """
315 The hour of the day the anchor should be. Ranges from 0 to 23.
316 """
317 minute: NotRequired[int]
318 """
319 The minute of the hour the anchor should be. Ranges from 0 to 59.
320 """
321 month: NotRequired[int]
322 """
323 The month to start full cycle periods. Ranges from 1 to 12.
324 """
325 second: NotRequired[int]
326 """
327 The second of the minute the anchor should be. Ranges from 0 to 59.
328 """
329
330
331 class SubscriptionCreateParamsBillingMode(TypedDict):
332 flexible: NotRequired["SubscriptionCreateParamsBillingModeFlexible"]
333 """
334 Configure behavior for flexible billing mode.
335 """
336 type: Literal["classic", "flexible"]
337 """
338 Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`.
339 """
340
341
342 class SubscriptionCreateParamsBillingModeFlexible(TypedDict):
343 proration_discounts: NotRequired[Literal["included", "itemized"]]
344 """
345 Controls how invoices and invoice items display proration amounts and discount amounts.
346 """
347
348
349 class SubscriptionCreateParamsBillingThresholds(TypedDict):
350 amount_gte: NotRequired[int]
351 """
352 Monetary threshold that triggers the subscription to advance to a new billing period
353 """
354 reset_billing_cycle_anchor: NotRequired[bool]
355 """
356 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.
357 """
358
359
360 class SubscriptionCreateParamsDiscount(TypedDict):
361 coupon: NotRequired[str]
362 """
363 ID of the coupon to create a new discount for.
364 """
365 discount: NotRequired[str]
366 """
367 ID of an existing discount on the object (or one of its ancestors) to reuse.
368 """
369 promotion_code: NotRequired[str]
370 """
371 ID of the promotion code to create a new discount for.
372 """
373
374
375 class SubscriptionCreateParamsInvoiceSettings(TypedDict):
376 account_tax_ids: NotRequired["Literal['']|List[str]"]
377 """
378 The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
379 """
380 issuer: NotRequired["SubscriptionCreateParamsInvoiceSettingsIssuer"]
381 """
382 The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
383 """
384
385
386 class SubscriptionCreateParamsInvoiceSettingsIssuer(TypedDict):
387 account: NotRequired[str]
388 """
389 The connected account being referenced when `type` is `account`.
390 """
391 type: Literal["account", "self"]
392 """
393 Type of the account referenced in the request.
394 """
395
396
397 class SubscriptionCreateParamsItem(TypedDict):
398 billing_thresholds: NotRequired[
399 "Literal['']|SubscriptionCreateParamsItemBillingThresholds"
400 ]
401 """
402 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.
403 """
404 discounts: NotRequired[
405 "Literal['']|List[SubscriptionCreateParamsItemDiscount]"
406 ]
407 """
408 The coupons to redeem into discounts for the subscription item.
409 """
410 metadata: NotRequired[Dict[str, str]]
411 """
412 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`.
413 """
414 plan: NotRequired[str]
415 """
416 Plan ID for this item, as a string.
417 """
418 price: NotRequired[str]
419 """
420 The ID of the price object.
421 """
422 price_data: NotRequired["SubscriptionCreateParamsItemPriceData"]
423 """
424 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
425 """
426 quantity: NotRequired[int]
427 """
428 Quantity for this item.
429 """
430 tax_rates: NotRequired["Literal['']|List[str]"]
431 """
432 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.
433 """
434
435
436 class SubscriptionCreateParamsItemBillingThresholds(TypedDict):
437 usage_gte: int
438 """
439 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))
440 """
441
442
443 class SubscriptionCreateParamsItemDiscount(TypedDict):
444 coupon: NotRequired[str]
445 """
446 ID of the coupon to create a new discount for.
447 """
448 discount: NotRequired[str]
449 """
450 ID of an existing discount on the object (or one of its ancestors) to reuse.
451 """
452 promotion_code: NotRequired[str]
453 """
454 ID of the promotion code to create a new discount for.
455 """
456
457
458 class SubscriptionCreateParamsItemPriceData(TypedDict):
459 currency: str
460 """
461 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).
462 """
463 product: str
464 """
465 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
466 """
467 recurring: "SubscriptionCreateParamsItemPriceDataRecurring"
468 """
469 The recurring components of a price such as `interval` and `interval_count`.
470 """
471 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
472 """
473 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.
474 """
475 unit_amount: NotRequired[int]
476 """
477 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
478 """
479 unit_amount_decimal: NotRequired[str]
480 """
481 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.
482 """
483
484
485 class SubscriptionCreateParamsItemPriceDataRecurring(TypedDict):
486 interval: Literal["day", "month", "week", "year"]
487 """
488 Specifies billing frequency. Either `day`, `week`, `month` or `year`.
489 """
490 interval_count: NotRequired[int]
491 """
492 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).
493 """
494
495
496 class SubscriptionCreateParamsPaymentSettings(TypedDict):
497 payment_method_options: NotRequired[
498 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptions"
499 ]
500 """
501 Payment-method-specific configuration to provide to invoices created by the subscription.
502 """
503 payment_method_types: NotRequired[
504 "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']]"
505 ]
506 """
507 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
508 """
509 save_default_payment_method: NotRequired[Literal["off", "on_subscription"]]
510 """
511 Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
512 """
513
514
515 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptions(TypedDict):
516 acss_debit: NotRequired[
517 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit"
518 ]
519 """
520 This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent.
521 """
522 bancontact: NotRequired[
523 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBancontact"
524 ]
525 """
526 This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
527 """
528 card: NotRequired[
529 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCard"
530 ]
531 """
532 This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
533 """
534 customer_balance: NotRequired[
535 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance"
536 ]
537 """
538 This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent.
539 """
540 konbini: NotRequired[
541 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsKonbini"
542 ]
543 """
544 This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
545 """
546 payto: NotRequired[
547 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPayto"
548 ]
549 """
550 This sub-hash contains details about the PayTo payment method options to pass to the invoice's PaymentIntent.
551 """
552 sepa_debit: NotRequired[
553 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit"
554 ]
555 """
556 This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent.
557 """
558 us_bank_account: NotRequired[
559 "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount"
560 ]
561 """
562 This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent.
563 """
564
565
566 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(
567 TypedDict,
568 ):
569 mandate_options: NotRequired[
570 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions"
571 ]
572 """
573 Additional fields for Mandate creation
574 """
575 verification_method: NotRequired[
576 Literal["automatic", "instant", "microdeposits"]
577 ]
578 """
579 Verification method for the intent
580 """
581
582
583 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions(
584 TypedDict,
585 ):
586 transaction_type: NotRequired[Literal["business", "personal"]]
587 """
588 Transaction type of the mandate.
589 """
590
591
592 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBancontact(
593 TypedDict,
594 ):
595 preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]]
596 """
597 Preferred language of the Bancontact authorization page that the customer is redirected to.
598 """
599
600
601 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCard(
602 TypedDict,
603 ):
604 mandate_options: NotRequired[
605 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions"
606 ]
607 """
608 Configuration options for setting up an eMandate for cards issued in India.
609 """
610 network: NotRequired[
611 Literal[
612 "amex",
613 "cartes_bancaires",
614 "diners",
615 "discover",
616 "eftpos_au",
617 "girocard",
618 "interac",
619 "jcb",
620 "link",
621 "mastercard",
622 "unionpay",
623 "unknown",
624 "visa",
625 ]
626 ]
627 """
628 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.
629 """
630 request_three_d_secure: NotRequired[
631 Literal["any", "automatic", "challenge"]
632 ]
633 """
634 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.
635 """
636
637
638 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions(
639 TypedDict,
640 ):
641 amount: NotRequired[int]
642 """
643 Amount to be charged for future payments.
644 """
645 amount_type: NotRequired[Literal["fixed", "maximum"]]
646 """
647 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.
648 """
649 description: NotRequired[str]
650 """
651 A description of the mandate or subscription that is meant to be displayed to the customer.
652 """
653
654
655 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance(
656 TypedDict,
657 ):
658 bank_transfer: NotRequired[
659 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer"
660 ]
661 """
662 Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
663 """
664 funding_type: NotRequired[str]
665 """
666 The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
667 """
668
669
670 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer(
671 TypedDict,
672 ):
673 eu_bank_transfer: NotRequired[
674 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer"
675 ]
676 """
677 Configuration for eu_bank_transfer funding type.
678 """
679 type: NotRequired[str]
680 """
681 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`.
682 """
683
684
685 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer(
686 TypedDict,
687 ):
688 country: str
689 """
690 The desired country code of the bank account information. Permitted values include: `DE`, `FR`, `IE`, or `NL`.
691 """
692
693
694 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsKonbini(
695 TypedDict,
696 ):
697 pass
698
699
700 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPayto(
701 TypedDict,
702 ):
703 mandate_options: NotRequired[
704 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions"
705 ]
706 """
707 Additional fields for Mandate creation.
708 """
709
710
711 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions(
712 TypedDict,
713 ):
714 amount: NotRequired[int]
715 """
716 The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit.
717 """
718 purpose: NotRequired[
719 Literal[
720 "dependant_support",
721 "government",
722 "loan",
723 "mortgage",
724 "other",
725 "pension",
726 "personal",
727 "retail",
728 "salary",
729 "tax",
730 "utility",
731 ]
732 ]
733 """
734 The purpose for which payments are made. Has a default value based on your merchant category code.
735 """
736
737
738 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(
739 TypedDict,
740 ):
741 pass
742
743
744 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount(
745 TypedDict,
746 ):
747 financial_connections: NotRequired[
748 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections"
749 ]
750 """
751 Additional fields for Financial Connections Session creation
752 """
753 verification_method: NotRequired[
754 Literal["automatic", "instant", "microdeposits"]
755 ]
756 """
757 Verification method for the intent
758 """
759
760
761 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections(
762 TypedDict,
763 ):
764 filters: NotRequired[
765 "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters"
766 ]
767 """
768 Provide filters for the linked accounts that the customer can select for the payment method.
769 """
770 permissions: NotRequired[
771 List[
772 Literal["balances", "ownership", "payment_method", "transactions"]
773 ]
774 ]
775 """
776 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`.
777 """
778 prefetch: NotRequired[
779 List[Literal["balances", "ownership", "transactions"]]
780 ]
781 """
782 List of data features that you would like to retrieve upon account creation.
783 """
784
785
786 class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters(
787 TypedDict,
788 ):
789 account_subcategories: NotRequired[List[Literal["checking", "savings"]]]
790 """
791 The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
792 """
793
794
795 class SubscriptionCreateParamsPendingInvoiceItemInterval(TypedDict):
796 interval: Literal["day", "month", "week", "year"]
797 """
798 Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
799 """
800 interval_count: NotRequired[int]
801 """
802 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).
803 """
804
805
806 class SubscriptionCreateParamsTransferData(TypedDict):
807 amount_percent: NotRequired[float]
808 """
809 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.
810 """
811 destination: str
812 """
813 ID of an existing, connected Stripe account.
814 """
815
816
817 class SubscriptionCreateParamsTrialSettings(TypedDict):
818 end_behavior: "SubscriptionCreateParamsTrialSettingsEndBehavior"
819 """
820 Defines how the subscription should behave when the user's free trial ends.
821 """
822
823
824 class SubscriptionCreateParamsTrialSettingsEndBehavior(TypedDict):
825 missing_payment_method: Literal["cancel", "create_invoice", "pause"]
826 """
827 Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
828 """