Debian Codegraph @

stripe/params/_quote_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 QuoteCreateParams(RequestOptions):
9 application_fee_amount: NotRequired["Literal['']|int"]
10 """
11 The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
12 """
13 application_fee_percent: NotRequired["Literal['']|float"]
14 """
15 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. There must be at least 1 line item with a recurring price to use this field.
16 """
17 automatic_tax: NotRequired["QuoteCreateParamsAutomaticTax"]
18 """
19 Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
20 """
21 collection_method: NotRequired[
22 Literal["charge_automatically", "send_invoice"]
23 ]
24 """
25 Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or 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`.
26 """
27 customer: NotRequired[str]
28 """
29 The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
30 """
31 customer_account: NotRequired[str]
32 """
33 The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
34 """
35 default_tax_rates: NotRequired["Literal['']|List[str]"]
36 """
37 The tax rates that will apply to any line item that does not have `tax_rates` set.
38 """
39 description: NotRequired["Literal['']|str"]
40 """
41 A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
42 """
43 discounts: NotRequired["Literal['']|List[QuoteCreateParamsDiscount]"]
44 """
45 The discounts applied to the quote.
46 """
47 expand: NotRequired[List[str]]
48 """
49 Specifies which fields in the response should be expanded.
50 """
51 expires_at: NotRequired[int]
52 """
53 A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
54 """
55 footer: NotRequired["Literal['']|str"]
56 """
57 A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
58 """
59 from_quote: NotRequired["QuoteCreateParamsFromQuote"]
60 """
61 Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`.
62 """
63 header: NotRequired["Literal['']|str"]
64 """
65 A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
66 """
67 invoice_settings: NotRequired["QuoteCreateParamsInvoiceSettings"]
68 """
69 All invoices will be billed using the specified settings.
70 """
71 line_items: NotRequired[List["QuoteCreateParamsLineItem"]]
72 """
73 A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
74 """
75 metadata: NotRequired[Dict[str, str]]
76 """
77 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`.
78 """
79 on_behalf_of: NotRequired["Literal['']|str"]
80 """
81 The account on behalf of which to charge.
82 """
83 subscription_data: NotRequired["QuoteCreateParamsSubscriptionData"]
84 """
85 When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
86 """
87 test_clock: NotRequired[str]
88 """
89 ID of the test clock to attach to the quote.
90 """
91 transfer_data: NotRequired["Literal['']|QuoteCreateParamsTransferData"]
92 """
93 The data with which to automatically create a Transfer for each of the invoices.
94 """
95
96
97 class QuoteCreateParamsAutomaticTax(TypedDict):
98 enabled: bool
99 """
100 Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
101 """
102 liability: NotRequired["QuoteCreateParamsAutomaticTaxLiability"]
103 """
104 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.
105 """
106
107
108 class QuoteCreateParamsAutomaticTaxLiability(TypedDict):
109 account: NotRequired[str]
110 """
111 The connected account being referenced when `type` is `account`.
112 """
113 type: Literal["account", "self"]
114 """
115 Type of the account referenced in the request.
116 """
117
118
119 class QuoteCreateParamsDiscount(TypedDict):
120 coupon: NotRequired[str]
121 """
122 ID of the coupon to create a new discount for.
123 """
124 discount: NotRequired[str]
125 """
126 ID of an existing discount on the object (or one of its ancestors) to reuse.
127 """
128 promotion_code: NotRequired[str]
129 """
130 ID of the promotion code to create a new discount for.
131 """
132
133
134 class QuoteCreateParamsFromQuote(TypedDict):
135 is_revision: NotRequired[bool]
136 """
137 Whether this quote is a revision of the previous quote.
138 """
139 quote: str
140 """
141 The `id` of the quote that will be cloned.
142 """
143
144
145 class QuoteCreateParamsInvoiceSettings(TypedDict):
146 days_until_due: NotRequired[int]
147 """
148 Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
149 """
150 issuer: NotRequired["QuoteCreateParamsInvoiceSettingsIssuer"]
151 """
152 The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
153 """
154
155
156 class QuoteCreateParamsInvoiceSettingsIssuer(TypedDict):
157 account: NotRequired[str]
158 """
159 The connected account being referenced when `type` is `account`.
160 """
161 type: Literal["account", "self"]
162 """
163 Type of the account referenced in the request.
164 """
165
166
167 class QuoteCreateParamsLineItem(TypedDict):
168 discounts: NotRequired[
169 "Literal['']|List[QuoteCreateParamsLineItemDiscount]"
170 ]
171 """
172 The discounts applied to this line item.
173 """
174 price: NotRequired[str]
175 """
176 The ID of the price object. One of `price` or `price_data` is required.
177 """
178 price_data: NotRequired["QuoteCreateParamsLineItemPriceData"]
179 """
180 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
181 """
182 quantity: NotRequired[int]
183 """
184 The quantity of the line item.
185 """
186 tax_rates: NotRequired["Literal['']|List[str]"]
187 """
188 The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
189 """
190
191
192 class QuoteCreateParamsLineItemDiscount(TypedDict):
193 coupon: NotRequired[str]
194 """
195 ID of the coupon to create a new discount for.
196 """
197 discount: NotRequired[str]
198 """
199 ID of an existing discount on the object (or one of its ancestors) to reuse.
200 """
201 promotion_code: NotRequired[str]
202 """
203 ID of the promotion code to create a new discount for.
204 """
205
206
207 class QuoteCreateParamsLineItemPriceData(TypedDict):
208 currency: str
209 """
210 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).
211 """
212 product: str
213 """
214 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
215 """
216 recurring: NotRequired["QuoteCreateParamsLineItemPriceDataRecurring"]
217 """
218 The recurring components of a price such as `interval` and `interval_count`.
219 """
220 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
221 """
222 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.
223 """
224 unit_amount: NotRequired[int]
225 """
226 A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
227 """
228 unit_amount_decimal: NotRequired[str]
229 """
230 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.
231 """
232
233
234 class QuoteCreateParamsLineItemPriceDataRecurring(TypedDict):
235 interval: Literal["day", "month", "week", "year"]
236 """
237 Specifies billing frequency. Either `day`, `week`, `month` or `year`.
238 """
239 interval_count: NotRequired[int]
240 """
241 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).
242 """
243
244
245 class QuoteCreateParamsSubscriptionData(TypedDict):
246 billing_mode: NotRequired["QuoteCreateParamsSubscriptionDataBillingMode"]
247 """
248 Controls how prorations and invoices for subscriptions are calculated and orchestrated.
249 """
250 description: NotRequired[str]
251 """
252 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.
253 """
254 effective_date: NotRequired[
255 "Literal['']|Literal['current_period_end']|int"
256 ]
257 """
258 When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
259 """
260 metadata: NotRequired[Dict[str, str]]
261 """
262 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
263 """
264 trial_period_days: NotRequired["Literal['']|int"]
265 """
266 Integer representing the number of trial period days before the customer is charged for the first time.
267 """
268
269
270 class QuoteCreateParamsSubscriptionDataBillingMode(TypedDict):
271 flexible: NotRequired[
272 "QuoteCreateParamsSubscriptionDataBillingModeFlexible"
273 ]
274 """
275 Configure behavior for flexible billing mode.
276 """
277 type: Literal["classic", "flexible"]
278 """
279 Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`.
280 """
281
282
283 class QuoteCreateParamsSubscriptionDataBillingModeFlexible(TypedDict):
284 proration_discounts: NotRequired[Literal["included", "itemized"]]
285 """
286 Controls how invoices and invoice items display proration amounts and discount amounts.
287 """
288
289
290 class QuoteCreateParamsTransferData(TypedDict):
291 amount: NotRequired[int]
292 """
293 The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
294 """
295 amount_percent: NotRequired[float]
296 """
297 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. There must be at least 1 line item with a recurring price to use this field.
298 """
299 destination: str
300 """
301 ID of an existing, connected Stripe account.
302 """