Debian Codegraph @

stripe/params/_invoice_update_lines_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 InvoiceUpdateLinesParams(RequestOptions):
9 expand: NotRequired[List[str]]
10 """
11 Specifies which fields in the response should be expanded.
12 """
13 invoice_metadata: NotRequired["Literal['']|Dict[str, str]"]
14 """
15 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`. For [type=subscription](https://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
16 """
17 lines: List["InvoiceUpdateLinesParamsLine"]
18 """
19 The line items to update.
20 """
21
22
23 class InvoiceUpdateLinesParamsLine(TypedDict):
24 amount: NotRequired[int]
25 """
26 The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
27 """
28 description: NotRequired[str]
29 """
30 An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
31 """
32 discountable: NotRequired[bool]
33 """
34 Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
35 """
36 discounts: NotRequired[
37 "Literal['']|List[InvoiceUpdateLinesParamsLineDiscount]"
38 ]
39 """
40 The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
41 """
42 id: str
43 """
44 ID of an existing line item on the invoice.
45 """
46 metadata: NotRequired["Literal['']|Dict[str, str]"]
47 """
48 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`. For [type=subscription](https://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
49 """
50 period: NotRequired["InvoiceUpdateLinesParamsLinePeriod"]
51 """
52 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.
53 """
54 price_data: NotRequired["InvoiceUpdateLinesParamsLinePriceData"]
55 """
56 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
57 """
58 pricing: NotRequired["InvoiceUpdateLinesParamsLinePricing"]
59 """
60 The pricing information for the invoice item.
61 """
62 quantity: NotRequired[int]
63 """
64 Non-negative integer. The quantity of units for the line item.
65 """
66 tax_amounts: NotRequired[
67 "Literal['']|List[InvoiceUpdateLinesParamsLineTaxAmount]"
68 ]
69 """
70 A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
71 """
72 tax_rates: NotRequired["Literal['']|List[str]"]
73 """
74 The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
75 """
76
77
78 class InvoiceUpdateLinesParamsLineDiscount(TypedDict):
79 coupon: NotRequired[str]
80 """
81 ID of the coupon to create a new discount for.
82 """
83 discount: NotRequired[str]
84 """
85 ID of an existing discount on the object (or one of its ancestors) to reuse.
86 """
87 promotion_code: NotRequired[str]
88 """
89 ID of the promotion code to create a new discount for.
90 """
91
92
93 class InvoiceUpdateLinesParamsLinePeriod(TypedDict):
94 end: int
95 """
96 The end of the period, which must be greater than or equal to the start. This value is inclusive.
97 """
98 start: int
99 """
100 The start of the period. This value is inclusive.
101 """
102
103
104 class InvoiceUpdateLinesParamsLinePriceData(TypedDict):
105 currency: str
106 """
107 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).
108 """
109 product: NotRequired[str]
110 """
111 The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
112 """
113 product_data: NotRequired[
114 "InvoiceUpdateLinesParamsLinePriceDataProductData"
115 ]
116 """
117 Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
118 """
119 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
120 """
121 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.
122 """
123 unit_amount: NotRequired[int]
124 """
125 A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
126 """
127 unit_amount_decimal: NotRequired[str]
128 """
129 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.
130 """
131
132
133 class InvoiceUpdateLinesParamsLinePriceDataProductData(TypedDict):
134 description: NotRequired[str]
135 """
136 The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
137 """
138 images: NotRequired[List[str]]
139 """
140 A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
141 """
142 metadata: NotRequired[Dict[str, str]]
143 """
144 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`.
145 """
146 name: str
147 """
148 The product's name, meant to be displayable to the customer.
149 """
150 tax_code: NotRequired[str]
151 """
152 A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
153 """
154 unit_label: NotRequired[str]
155 """
156 A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
157 """
158
159
160 class InvoiceUpdateLinesParamsLinePricing(TypedDict):
161 price: NotRequired[str]
162 """
163 The ID of the price object.
164 """
165
166
167 class InvoiceUpdateLinesParamsLineTaxAmount(TypedDict):
168 amount: int
169 """
170 The amount, in cents (or local equivalent), of the tax.
171 """
172 tax_rate_data: "InvoiceUpdateLinesParamsLineTaxAmountTaxRateData"
173 """
174 Data to find or create a TaxRate object.
175
176 Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items.
177 """
178 taxability_reason: NotRequired[
179 Literal[
180 "customer_exempt",
181 "not_collecting",
182 "not_subject_to_tax",
183 "not_supported",
184 "portion_product_exempt",
185 "portion_reduced_rated",
186 "portion_standard_rated",
187 "product_exempt",
188 "product_exempt_holiday",
189 "proportionally_rated",
190 "reduced_rated",
191 "reverse_charge",
192 "standard_rated",
193 "taxable_basis_reduced",
194 "zero_rated",
195 ]
196 ]
197 """
198 The reasoning behind this tax, for example, if the product is tax exempt.
199 """
200 taxable_amount: int
201 """
202 The amount on which tax is calculated, in cents (or local equivalent).
203 """
204
205
206 class InvoiceUpdateLinesParamsLineTaxAmountTaxRateData(TypedDict):
207 country: NotRequired[str]
208 """
209 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
210 """
211 description: NotRequired[str]
212 """
213 An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
214 """
215 display_name: str
216 """
217 The display name of the tax rate, which will be shown to users.
218 """
219 inclusive: bool
220 """
221 This specifies if the tax rate is inclusive or exclusive.
222 """
223 jurisdiction: NotRequired[str]
224 """
225 The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice.
226 """
227 jurisdiction_level: NotRequired[
228 Literal["city", "country", "county", "district", "multiple", "state"]
229 ]
230 """
231 The level of the jurisdiction that imposes this tax rate.
232 """
233 percentage: float
234 """
235 The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
236 """
237 state: NotRequired[str]
238 """
239 [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
240 """
241 tax_type: NotRequired[
242 Literal[
243 "amusement_tax",
244 "communications_tax",
245 "gst",
246 "hst",
247 "igst",
248 "jct",
249 "lease_tax",
250 "pst",
251 "qst",
252 "retail_delivery_fee",
253 "rst",
254 "sales_tax",
255 "service_tax",
256 "vat",
257 ]
258 ]
259 """
260 The high-level tax type, such as `vat` or `sales_tax`.
261 """