Debian Codegraph @

stripe/params/_invoice_create_preview_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 InvoiceCreatePreviewParams(RequestOptions):
9 automatic_tax: NotRequired["InvoiceCreatePreviewParamsAutomaticTax"]
10 """
11 Settings for automatic tax lookup for this invoice preview.
12 """
13 currency: NotRequired[str]
14 """
15 The currency to preview this invoice in. Defaults to that of `customer` if not specified.
16 """
17 customer: NotRequired[str]
18 """
19 The identifier of the customer whose upcoming invoice you're retrieving. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
20 """
21 customer_account: NotRequired[str]
22 """
23 The identifier of the account representing the customer whose upcoming invoice you're retrieving. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set.
24 """
25 customer_details: NotRequired["InvoiceCreatePreviewParamsCustomerDetails"]
26 """
27 Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
28 """
29 discounts: NotRequired[
30 "Literal['']|List[InvoiceCreatePreviewParamsDiscount]"
31 ]
32 """
33 The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
34 """
35 expand: NotRequired[List[str]]
36 """
37 Specifies which fields in the response should be expanded.
38 """
39 invoice_items: NotRequired[List["InvoiceCreatePreviewParamsInvoiceItem"]]
40 """
41 List of invoice items to add or update in the upcoming invoice preview (up to 250).
42 """
43 issuer: NotRequired["InvoiceCreatePreviewParamsIssuer"]
44 """
45 The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
46 """
47 on_behalf_of: NotRequired["Literal['']|str"]
48 """
49 The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://docs.stripe.com/billing/invoices/connect) documentation for details.
50 """
51 preview_mode: NotRequired[Literal["next", "recurring"]]
52 """
53 Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
54 """
55 schedule: NotRequired[str]
56 """
57 The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
58 """
59 schedule_details: NotRequired["InvoiceCreatePreviewParamsScheduleDetails"]
60 """
61 The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
62 """
63 subscription: NotRequired[str]
64 """
65 The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
66 """
67 subscription_details: NotRequired[
68 "InvoiceCreatePreviewParamsSubscriptionDetails"
69 ]
70 """
71 The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
72 """
73
74
75 class InvoiceCreatePreviewParamsAutomaticTax(TypedDict):
76 enabled: bool
77 """
78 Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://docs.stripe.com/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
79 """
80 liability: NotRequired["InvoiceCreatePreviewParamsAutomaticTaxLiability"]
81 """
82 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.
83 """
84
85
86 class InvoiceCreatePreviewParamsAutomaticTaxLiability(TypedDict):
87 account: NotRequired[str]
88 """
89 The connected account being referenced when `type` is `account`.
90 """
91 type: Literal["account", "self"]
92 """
93 Type of the account referenced in the request.
94 """
95
96
97 class InvoiceCreatePreviewParamsCustomerDetails(TypedDict):
98 address: NotRequired[
99 "Literal['']|InvoiceCreatePreviewParamsCustomerDetailsAddress"
100 ]
101 """
102 The customer's address. Learn about [country-specific requirements for calculating tax](https://docs.stripe.com/invoicing/taxes?dashboard-or-api=dashboard#set-up-customer).
103 """
104 shipping: NotRequired[
105 "Literal['']|InvoiceCreatePreviewParamsCustomerDetailsShipping"
106 ]
107 """
108 The customer's shipping information. Appears on invoices emailed to this customer.
109 """
110 tax: NotRequired["InvoiceCreatePreviewParamsCustomerDetailsTax"]
111 """
112 Tax details about the customer.
113 """
114 tax_exempt: NotRequired["Literal['']|Literal['exempt', 'none', 'reverse']"]
115 """
116 The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
117 """
118 tax_ids: NotRequired[
119 List["InvoiceCreatePreviewParamsCustomerDetailsTaxId"]
120 ]
121 """
122 The customer's tax IDs.
123 """
124
125
126 class InvoiceCreatePreviewParamsCustomerDetailsAddress(TypedDict):
127 city: NotRequired[str]
128 """
129 City, district, suburb, town, or village.
130 """
131 country: NotRequired[str]
132 """
133 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
134 """
135 line1: NotRequired[str]
136 """
137 Address line 1, such as the street, PO Box, or company name.
138 """
139 line2: NotRequired[str]
140 """
141 Address line 2, such as the apartment, suite, unit, or building.
142 """
143 postal_code: NotRequired[str]
144 """
145 ZIP or postal code.
146 """
147 state: NotRequired[str]
148 """
149 State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
150 """
151
152
153 class InvoiceCreatePreviewParamsCustomerDetailsShipping(TypedDict):
154 address: "InvoiceCreatePreviewParamsCustomerDetailsShippingAddress"
155 """
156 Customer shipping address.
157 """
158 name: str
159 """
160 Customer name.
161 """
162 phone: NotRequired[str]
163 """
164 Customer phone (including extension).
165 """
166
167
168 class InvoiceCreatePreviewParamsCustomerDetailsShippingAddress(TypedDict):
169 city: NotRequired[str]
170 """
171 City, district, suburb, town, or village.
172 """
173 country: NotRequired[str]
174 """
175 A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
176 """
177 line1: NotRequired[str]
178 """
179 Address line 1, such as the street, PO Box, or company name.
180 """
181 line2: NotRequired[str]
182 """
183 Address line 2, such as the apartment, suite, unit, or building.
184 """
185 postal_code: NotRequired[str]
186 """
187 ZIP or postal code.
188 """
189 state: NotRequired[str]
190 """
191 State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
192 """
193
194
195 class InvoiceCreatePreviewParamsCustomerDetailsTax(TypedDict):
196 ip_address: NotRequired["Literal['']|str"]
197 """
198 A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
199 """
200
201
202 class InvoiceCreatePreviewParamsCustomerDetailsTaxId(TypedDict):
203 type: Literal[
204 "ad_nrt",
205 "ae_trn",
206 "al_tin",
207 "am_tin",
208 "ao_tin",
209 "ar_cuit",
210 "au_abn",
211 "au_arn",
212 "aw_tin",
213 "az_tin",
214 "ba_tin",
215 "bb_tin",
216 "bd_bin",
217 "bf_ifu",
218 "bg_uic",
219 "bh_vat",
220 "bj_ifu",
221 "bo_tin",
222 "br_cnpj",
223 "br_cpf",
224 "bs_tin",
225 "by_tin",
226 "ca_bn",
227 "ca_gst_hst",
228 "ca_pst_bc",
229 "ca_pst_mb",
230 "ca_pst_sk",
231 "ca_qst",
232 "cd_nif",
233 "ch_uid",
234 "ch_vat",
235 "cl_tin",
236 "cm_niu",
237 "cn_tin",
238 "co_nit",
239 "cr_tin",
240 "cv_nif",
241 "de_stn",
242 "do_rcn",
243 "ec_ruc",
244 "eg_tin",
245 "es_cif",
246 "et_tin",
247 "eu_oss_vat",
248 "eu_vat",
249 "gb_vat",
250 "ge_vat",
251 "gn_nif",
252 "hk_br",
253 "hr_oib",
254 "hu_tin",
255 "id_npwp",
256 "il_vat",
257 "in_gst",
258 "is_vat",
259 "jp_cn",
260 "jp_rn",
261 "jp_trn",
262 "ke_pin",
263 "kg_tin",
264 "kh_tin",
265 "kr_brn",
266 "kz_bin",
267 "la_tin",
268 "li_uid",
269 "li_vat",
270 "lk_vat",
271 "ma_vat",
272 "md_vat",
273 "me_pib",
274 "mk_vat",
275 "mr_nif",
276 "mx_rfc",
277 "my_frp",
278 "my_itn",
279 "my_sst",
280 "ng_tin",
281 "no_vat",
282 "no_voec",
283 "np_pan",
284 "nz_gst",
285 "om_vat",
286 "pe_ruc",
287 "ph_tin",
288 "pl_nip",
289 "ro_tin",
290 "rs_pib",
291 "ru_inn",
292 "ru_kpp",
293 "sa_vat",
294 "sg_gst",
295 "sg_uen",
296 "si_tin",
297 "sn_ninea",
298 "sr_fin",
299 "sv_nit",
300 "th_vat",
301 "tj_tin",
302 "tr_tin",
303 "tw_vat",
304 "tz_vat",
305 "ua_vat",
306 "ug_tin",
307 "us_ein",
308 "uy_ruc",
309 "uz_tin",
310 "uz_vat",
311 "ve_rif",
312 "vn_tin",
313 "za_vat",
314 "zm_tin",
315 "zw_tin",
316 ]
317 """
318 Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
319 """
320 value: str
321 """
322 Value of the tax ID.
323 """
324
325
326 class InvoiceCreatePreviewParamsDiscount(TypedDict):
327 coupon: NotRequired[str]
328 """
329 ID of the coupon to create a new discount for.
330 """
331 discount: NotRequired[str]
332 """
333 ID of an existing discount on the object (or one of its ancestors) to reuse.
334 """
335 promotion_code: NotRequired[str]
336 """
337 ID of the promotion code to create a new discount for.
338 """
339
340
341 class InvoiceCreatePreviewParamsInvoiceItem(TypedDict):
342 amount: NotRequired[int]
343 """
344 The integer amount in cents (or local equivalent) of previewed invoice item.
345 """
346 currency: NotRequired[str]
347 """
348 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). Only applicable to new invoice items.
349 """
350 description: NotRequired[str]
351 """
352 An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
353 """
354 discountable: NotRequired[bool]
355 """
356 Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
357 """
358 discounts: NotRequired[
359 "Literal['']|List[InvoiceCreatePreviewParamsInvoiceItemDiscount]"
360 ]
361 """
362 The coupons to redeem into discounts for the invoice item in the preview.
363 """
364 invoiceitem: NotRequired[str]
365 """
366 The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
367 """
368 metadata: NotRequired["Literal['']|Dict[str, str]"]
369 """
370 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`.
371 """
372 period: NotRequired["InvoiceCreatePreviewParamsInvoiceItemPeriod"]
373 """
374 The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://docs.stripe.com/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://docs.stripe.com/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
375 """
376 price: NotRequired[str]
377 """
378 The ID of the price object. One of `price` or `price_data` is required.
379 """
380 price_data: NotRequired["InvoiceCreatePreviewParamsInvoiceItemPriceData"]
381 """
382 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
383 """
384 quantity: NotRequired[int]
385 """
386 Non-negative integer. The quantity of units for the invoice item.
387 """
388 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
389 """
390 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.
391 """
392 tax_code: NotRequired["Literal['']|str"]
393 """
394 A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
395 """
396 tax_rates: NotRequired["Literal['']|List[str]"]
397 """
398 The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
399 """
400 unit_amount: NotRequired[int]
401 """
402 The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
403 """
404 unit_amount_decimal: NotRequired[str]
405 """
406 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.
407 """
408
409
410 class InvoiceCreatePreviewParamsInvoiceItemDiscount(TypedDict):
411 coupon: NotRequired[str]
412 """
413 ID of the coupon to create a new discount for.
414 """
415 discount: NotRequired[str]
416 """
417 ID of an existing discount on the object (or one of its ancestors) to reuse.
418 """
419 promotion_code: NotRequired[str]
420 """
421 ID of the promotion code to create a new discount for.
422 """
423
424
425 class InvoiceCreatePreviewParamsInvoiceItemPeriod(TypedDict):
426 end: int
427 """
428 The end of the period, which must be greater than or equal to the start. This value is inclusive.
429 """
430 start: int
431 """
432 The start of the period. This value is inclusive.
433 """
434
435
436 class InvoiceCreatePreviewParamsInvoiceItemPriceData(TypedDict):
437 currency: str
438 """
439 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).
440 """
441 product: str
442 """
443 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
444 """
445 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
446 """
447 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.
448 """
449 unit_amount: NotRequired[int]
450 """
451 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
452 """
453 unit_amount_decimal: NotRequired[str]
454 """
455 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.
456 """
457
458
459 class InvoiceCreatePreviewParamsIssuer(TypedDict):
460 account: NotRequired[str]
461 """
462 The connected account being referenced when `type` is `account`.
463 """
464 type: Literal["account", "self"]
465 """
466 Type of the account referenced in the request.
467 """
468
469
470 class InvoiceCreatePreviewParamsScheduleDetails(TypedDict):
471 billing_mode: NotRequired[
472 "InvoiceCreatePreviewParamsScheduleDetailsBillingMode"
473 ]
474 """
475 Controls how prorations and invoices for subscriptions are calculated and orchestrated.
476 """
477 end_behavior: NotRequired[Literal["cancel", "release"]]
478 """
479 Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
480 """
481 phases: NotRequired[List["InvoiceCreatePreviewParamsScheduleDetailsPhase"]]
482 """
483 List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
484 """
485 proration_behavior: NotRequired[
486 Literal["always_invoice", "create_prorations", "none"]
487 ]
488 """
489 In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
490 """
491
492
493 class InvoiceCreatePreviewParamsScheduleDetailsBillingMode(TypedDict):
494 flexible: NotRequired[
495 "InvoiceCreatePreviewParamsScheduleDetailsBillingModeFlexible"
496 ]
497 """
498 Configure behavior for flexible billing mode.
499 """
500 type: Literal["classic", "flexible"]
501 """
502 Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`.
503 """
504
505
506 class InvoiceCreatePreviewParamsScheduleDetailsBillingModeFlexible(TypedDict):
507 proration_discounts: NotRequired[Literal["included", "itemized"]]
508 """
509 Controls how invoices and invoice items display proration amounts and discount amounts.
510 """
511
512
513 class InvoiceCreatePreviewParamsScheduleDetailsPhase(TypedDict):
514 add_invoice_items: NotRequired[
515 List["InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem"]
516 ]
517 """
518 A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
519 """
520 application_fee_percent: NotRequired[float]
521 """
522 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).
523 """
524 automatic_tax: NotRequired[
525 "InvoiceCreatePreviewParamsScheduleDetailsPhaseAutomaticTax"
526 ]
527 """
528 Automatic tax settings for this phase.
529 """
530 billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]]
531 """
532 Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle).
533 """
534 billing_thresholds: NotRequired[
535 "Literal['']|InvoiceCreatePreviewParamsScheduleDetailsPhaseBillingThresholds"
536 ]
537 """
538 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.
539 """
540 collection_method: NotRequired[
541 Literal["charge_automatically", "send_invoice"]
542 ]
543 """
544 Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing 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` on creation.
545 """
546 currency: NotRequired[str]
547 """
548 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).
549 """
550 default_payment_method: NotRequired[str]
551 """
552 ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
553 """
554 default_tax_rates: NotRequired["Literal['']|List[str]"]
555 """
556 A list of [Tax Rate](https://docs.stripe.com/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://docs.stripe.com/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://docs.stripe.com/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
557 """
558 description: NotRequired["Literal['']|str"]
559 """
560 Subscription 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.
561 """
562 discounts: NotRequired[
563 "Literal['']|List[InvoiceCreatePreviewParamsScheduleDetailsPhaseDiscount]"
564 ]
565 """
566 The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
567 """
568 duration: NotRequired[
569 "InvoiceCreatePreviewParamsScheduleDetailsPhaseDuration"
570 ]
571 """
572 The number of intervals the phase should last. If set, `end_date` must not be set.
573 """
574 end_date: NotRequired["int|Literal['now']"]
575 """
576 The date at which this phase of the subscription schedule ends. If set, `duration` must not be set.
577 """
578 invoice_settings: NotRequired[
579 "InvoiceCreatePreviewParamsScheduleDetailsPhaseInvoiceSettings"
580 ]
581 """
582 All invoices will be billed using the specified settings.
583 """
584 items: List["InvoiceCreatePreviewParamsScheduleDetailsPhaseItem"]
585 """
586 List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
587 """
588 metadata: NotRequired[Dict[str, str]]
589 """
590 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
591 """
592 on_behalf_of: NotRequired[str]
593 """
594 The account on behalf of which to charge, for each of the associated subscription's invoices.
595 """
596 proration_behavior: NotRequired[
597 Literal["always_invoice", "create_prorations", "none"]
598 ]
599 """
600 Controls whether the subscription schedule should create [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
601 """
602 start_date: NotRequired["int|Literal['now']"]
603 """
604 The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
605 """
606 transfer_data: NotRequired[
607 "InvoiceCreatePreviewParamsScheduleDetailsPhaseTransferData"
608 ]
609 """
610 The data with which to automatically create a Transfer for each of the associated subscription's invoices.
611 """
612 trial: NotRequired[bool]
613 """
614 If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
615 """
616 trial_end: NotRequired["int|Literal['now']"]
617 """
618 Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
619 """
620
621
622 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict):
623 discounts: NotRequired[
624 List[
625 "InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount"
626 ]
627 ]
628 """
629 The coupons to redeem into discounts for the item.
630 """
631 metadata: NotRequired[Dict[str, str]]
632 """
633 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`.
634 """
635 period: NotRequired[
636 "InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriod"
637 ]
638 """
639 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`.
640 """
641 price: NotRequired[str]
642 """
643 The ID of the price object. One of `price` or `price_data` is required.
644 """
645 price_data: NotRequired[
646 "InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData"
647 ]
648 """
649 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
650 """
651 quantity: NotRequired[int]
652 """
653 Quantity for this item. Defaults to 1.
654 """
655 tax_rates: NotRequired["Literal['']|List[str]"]
656 """
657 The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
658 """
659
660
661 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount(
662 TypedDict,
663 ):
664 coupon: NotRequired[str]
665 """
666 ID of the coupon to create a new discount for.
667 """
668 discount: NotRequired[str]
669 """
670 ID of an existing discount on the object (or one of its ancestors) to reuse.
671 """
672 promotion_code: NotRequired[str]
673 """
674 ID of the promotion code to create a new discount for.
675 """
676
677
678 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriod(
679 TypedDict,
680 ):
681 end: (
682 "InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriodEnd"
683 )
684 """
685 End of the invoice item period.
686 """
687 start: "InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriodStart"
688 """
689 Start of the invoice item period.
690 """
691
692
693 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriodEnd(
694 TypedDict,
695 ):
696 timestamp: NotRequired[int]
697 """
698 A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
699 """
700 type: Literal["min_item_period_end", "phase_end", "timestamp"]
701 """
702 Select how to calculate the end of the invoice item period.
703 """
704
705
706 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriodStart(
707 TypedDict,
708 ):
709 timestamp: NotRequired[int]
710 """
711 A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
712 """
713 type: Literal["max_item_period_start", "phase_start", "timestamp"]
714 """
715 Select how to calculate the start of the invoice item period.
716 """
717
718
719 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData(
720 TypedDict,
721 ):
722 currency: str
723 """
724 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).
725 """
726 product: str
727 """
728 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
729 """
730 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
731 """
732 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.
733 """
734 unit_amount: NotRequired[int]
735 """
736 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.
737 """
738 unit_amount_decimal: NotRequired[str]
739 """
740 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.
741 """
742
743
744 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAutomaticTax(TypedDict):
745 enabled: bool
746 """
747 Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
748 """
749 liability: NotRequired[
750 "InvoiceCreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability"
751 ]
752 """
753 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.
754 """
755
756
757 class InvoiceCreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability(
758 TypedDict,
759 ):
760 account: NotRequired[str]
761 """
762 The connected account being referenced when `type` is `account`.
763 """
764 type: Literal["account", "self"]
765 """
766 Type of the account referenced in the request.
767 """
768
769
770 class InvoiceCreatePreviewParamsScheduleDetailsPhaseBillingThresholds(
771 TypedDict,
772 ):
773 amount_gte: NotRequired[int]
774 """
775 Monetary threshold that triggers the subscription to advance to a new billing period
776 """
777 reset_billing_cycle_anchor: NotRequired[bool]
778 """
779 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.
780 """
781
782
783 class InvoiceCreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict):
784 coupon: NotRequired[str]
785 """
786 ID of the coupon to create a new discount for.
787 """
788 discount: NotRequired[str]
789 """
790 ID of an existing discount on the object (or one of its ancestors) to reuse.
791 """
792 promotion_code: NotRequired[str]
793 """
794 ID of the promotion code to create a new discount for.
795 """
796
797
798 class InvoiceCreatePreviewParamsScheduleDetailsPhaseDuration(TypedDict):
799 interval: Literal["day", "month", "week", "year"]
800 """
801 Specifies phase duration. Either `day`, `week`, `month` or `year`.
802 """
803 interval_count: NotRequired[int]
804 """
805 The multiplier applied to the interval.
806 """
807
808
809 class InvoiceCreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict):
810 account_tax_ids: NotRequired["Literal['']|List[str]"]
811 """
812 The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
813 """
814 days_until_due: NotRequired[int]
815 """
816 Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
817 """
818 issuer: NotRequired[
819 "InvoiceCreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer"
820 ]
821 """
822 The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
823 """
824
825
826 class InvoiceCreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer(
827 TypedDict,
828 ):
829 account: NotRequired[str]
830 """
831 The connected account being referenced when `type` is `account`.
832 """
833 type: Literal["account", "self"]
834 """
835 Type of the account referenced in the request.
836 """
837
838
839 class InvoiceCreatePreviewParamsScheduleDetailsPhaseItem(TypedDict):
840 billing_thresholds: NotRequired[
841 "Literal['']|InvoiceCreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds"
842 ]
843 """
844 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.
845 """
846 discounts: NotRequired[
847 "Literal['']|List[InvoiceCreatePreviewParamsScheduleDetailsPhaseItemDiscount]"
848 ]
849 """
850 The coupons to redeem into discounts for the subscription item.
851 """
852 metadata: NotRequired[Dict[str, str]]
853 """
854 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
855 """
856 plan: NotRequired[str]
857 """
858 The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
859 """
860 price: NotRequired[str]
861 """
862 The ID of the price object.
863 """
864 price_data: NotRequired[
865 "InvoiceCreatePreviewParamsScheduleDetailsPhaseItemPriceData"
866 ]
867 """
868 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
869 """
870 quantity: NotRequired[int]
871 """
872 Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
873 """
874 tax_rates: NotRequired["Literal['']|List[str]"]
875 """
876 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.
877 """
878
879
880 class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds(
881 TypedDict,
882 ):
883 usage_gte: int
884 """
885 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))
886 """
887
888
889 class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict):
890 coupon: NotRequired[str]
891 """
892 ID of the coupon to create a new discount for.
893 """
894 discount: NotRequired[str]
895 """
896 ID of an existing discount on the object (or one of its ancestors) to reuse.
897 """
898 promotion_code: NotRequired[str]
899 """
900 ID of the promotion code to create a new discount for.
901 """
902
903
904 class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict):
905 currency: str
906 """
907 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).
908 """
909 product: str
910 """
911 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
912 """
913 recurring: (
914 "InvoiceCreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring"
915 )
916 """
917 The recurring components of a price such as `interval` and `interval_count`.
918 """
919 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
920 """
921 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.
922 """
923 unit_amount: NotRequired[int]
924 """
925 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
926 """
927 unit_amount_decimal: NotRequired[str]
928 """
929 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.
930 """
931
932
933 class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring(
934 TypedDict,
935 ):
936 interval: Literal["day", "month", "week", "year"]
937 """
938 Specifies billing frequency. Either `day`, `week`, `month` or `year`.
939 """
940 interval_count: NotRequired[int]
941 """
942 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).
943 """
944
945
946 class InvoiceCreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict):
947 amount_percent: NotRequired[float]
948 """
949 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.
950 """
951 destination: str
952 """
953 ID of an existing, connected Stripe account.
954 """
955
956
957 class InvoiceCreatePreviewParamsSubscriptionDetails(TypedDict):
958 billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"]
959 """
960 For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
961 """
962 billing_mode: NotRequired[
963 "InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode"
964 ]
965 """
966 Controls how prorations and invoices for subscriptions are calculated and orchestrated.
967 """
968 cancel_at: NotRequired[
969 "Literal['']|int|Literal['max_period_end', 'min_period_end']"
970 ]
971 """
972 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.
973 """
974 cancel_at_period_end: NotRequired[bool]
975 """
976 Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
977 """
978 cancel_now: NotRequired[bool]
979 """
980 This simulates the subscription being canceled or expired immediately.
981 """
982 default_tax_rates: NotRequired["Literal['']|List[str]"]
983 """
984 If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
985 """
986 items: NotRequired[
987 List["InvoiceCreatePreviewParamsSubscriptionDetailsItem"]
988 ]
989 """
990 A list of up to 20 subscription items, each with an attached price.
991 """
992 proration_behavior: NotRequired[
993 Literal["always_invoice", "create_prorations", "none"]
994 ]
995 """
996 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`.
997 """
998 proration_date: NotRequired[int]
999 """
1000 If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
1001 """
1002 resume_at: NotRequired[Literal["now"]]
1003 """
1004 For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
1005 """
1006 start_date: NotRequired[int]
1007 """
1008 Date a subscription is intended to start (can be future or past).
1009 """
1010 trial_end: NotRequired["Literal['now']|int"]
1011 """
1012 If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required.
1013 """
1014
1015
1016 class InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict):
1017 flexible: NotRequired[
1018 "InvoiceCreatePreviewParamsSubscriptionDetailsBillingModeFlexible"
1019 ]
1020 """
1021 Configure behavior for flexible billing mode.
1022 """
1023 type: Literal["classic", "flexible"]
1024 """
1025 Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`.
1026 """
1027
1028
1029 class InvoiceCreatePreviewParamsSubscriptionDetailsBillingModeFlexible(
1030 TypedDict,
1031 ):
1032 proration_discounts: NotRequired[Literal["included", "itemized"]]
1033 """
1034 Controls how invoices and invoice items display proration amounts and discount amounts.
1035 """
1036
1037
1038 class InvoiceCreatePreviewParamsSubscriptionDetailsItem(TypedDict):
1039 billing_thresholds: NotRequired[
1040 "Literal['']|InvoiceCreatePreviewParamsSubscriptionDetailsItemBillingThresholds"
1041 ]
1042 """
1043 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.
1044 """
1045 clear_usage: NotRequired[bool]
1046 """
1047 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.
1048 """
1049 deleted: NotRequired[bool]
1050 """
1051 A flag that, if set to `true`, will delete the specified item.
1052 """
1053 discounts: NotRequired[
1054 "Literal['']|List[InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscount]"
1055 ]
1056 """
1057 The coupons to redeem into discounts for the subscription item.
1058 """
1059 id: NotRequired[str]
1060 """
1061 Subscription item to update.
1062 """
1063 metadata: NotRequired["Literal['']|Dict[str, str]"]
1064 """
1065 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`.
1066 """
1067 plan: NotRequired[str]
1068 """
1069 Plan ID for this item, as a string.
1070 """
1071 price: NotRequired[str]
1072 """
1073 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.
1074 """
1075 price_data: NotRequired[
1076 "InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceData"
1077 ]
1078 """
1079 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
1080 """
1081 quantity: NotRequired[int]
1082 """
1083 Quantity for this item.
1084 """
1085 tax_rates: NotRequired["Literal['']|List[str]"]
1086 """
1087 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.
1088 """
1089
1090
1091 class InvoiceCreatePreviewParamsSubscriptionDetailsItemBillingThresholds(
1092 TypedDict,
1093 ):
1094 usage_gte: int
1095 """
1096 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))
1097 """
1098
1099
1100 class InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict):
1101 coupon: NotRequired[str]
1102 """
1103 ID of the coupon to create a new discount for.
1104 """
1105 discount: NotRequired[str]
1106 """
1107 ID of an existing discount on the object (or one of its ancestors) to reuse.
1108 """
1109 promotion_code: NotRequired[str]
1110 """
1111 ID of the promotion code to create a new discount for.
1112 """
1113
1114
1115 class InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict):
1116 currency: str
1117 """
1118 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).
1119 """
1120 product: str
1121 """
1122 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1123 """
1124 recurring: (
1125 "InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring"
1126 )
1127 """
1128 The recurring components of a price such as `interval` and `interval_count`.
1129 """
1130 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
1131 """
1132 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.
1133 """
1134 unit_amount: NotRequired[int]
1135 """
1136 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1137 """
1138 unit_amount_decimal: NotRequired[str]
1139 """
1140 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.
1141 """
1142
1143
1144 class InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring(
1145 TypedDict,
1146 ):
1147 interval: Literal["day", "month", "week", "year"]
1148 """
1149 Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1150 """
1151 interval_count: NotRequired[int]
1152 """
1153 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).
1154 """