Debian Codegraph @

stripe/params/_invoice_line_item_update_params.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from typing import Dict, List
4 from typing_extensions import Literal, NotRequired, TypedDict
5
6
7 class InvoiceLineItemUpdateParams(TypedDict):
8 amount: NotRequired[int]
9 """
10 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.
11 """
12 description: NotRequired[str]
13 """
14 An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
15 """
16 discountable: NotRequired[bool]
17 """
18 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.
19 """
20 discounts: NotRequired[
21 "Literal['']|List[InvoiceLineItemUpdateParamsDiscount]"
22 ]
23 """
24 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.
25 """
26 expand: NotRequired[List[str]]
27 """
28 Specifies which fields in the response should be expanded.
29 """
30 metadata: NotRequired["Literal['']|Dict[str, str]"]
31 """
32 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.
33 """
34 period: NotRequired["InvoiceLineItemUpdateParamsPeriod"]
35 """
36 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.
37 """
38 price_data: NotRequired["InvoiceLineItemUpdateParamsPriceData"]
39 """
40 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
41 """
42 pricing: NotRequired["InvoiceLineItemUpdateParamsPricing"]
43 """
44 The pricing information for the invoice item.
45 """
46 quantity: NotRequired[int]
47 """
48 Non-negative integer. The quantity of units for the line item.
49 """
50 tax_amounts: NotRequired[
51 "Literal['']|List[InvoiceLineItemUpdateParamsTaxAmount]"
52 ]
53 """
54 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.
55 """
56 tax_rates: NotRequired["Literal['']|List[str]"]
57 """
58 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.
59 """
60
61
62 class InvoiceLineItemUpdateParamsDiscount(TypedDict):
63 coupon: NotRequired[str]
64 """
65 ID of the coupon to create a new discount for.
66 """
67 discount: NotRequired[str]
68 """
69 ID of an existing discount on the object (or one of its ancestors) to reuse.
70 """
71 promotion_code: NotRequired[str]
72 """
73 ID of the promotion code to create a new discount for.
74 """
75
76
77 class InvoiceLineItemUpdateParamsPeriod(TypedDict):
78 end: int
79 """
80 The end of the period, which must be greater than or equal to the start. This value is inclusive.
81 """
82 start: int
83 """
84 The start of the period. This value is inclusive.
85 """
86
87
88 class InvoiceLineItemUpdateParamsPriceData(TypedDict):
89 currency: str
90 """
91 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).
92 """
93 product: NotRequired[str]
94 """
95 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.
96 """
97 product_data: NotRequired[
98 "InvoiceLineItemUpdateParamsPriceDataProductData"
99 ]
100 """
101 Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
102 """
103 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
104 """
105 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.
106 """
107 unit_amount: NotRequired[int]
108 """
109 A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
110 """
111 unit_amount_decimal: NotRequired[str]
112 """
113 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.
114 """
115
116
117 class InvoiceLineItemUpdateParamsPriceDataProductData(TypedDict):
118 description: NotRequired[str]
119 """
120 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.
121 """
122 images: NotRequired[List[str]]
123 """
124 A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
125 """
126 metadata: NotRequired[Dict[str, str]]
127 """
128 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`.
129 """
130 name: str
131 """
132 The product's name, meant to be displayable to the customer.
133 """
134 tax_code: NotRequired[str]
135 """
136 A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
137 """
138 unit_label: NotRequired[str]
139 """
140 A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
141 """
142
143
144 class InvoiceLineItemUpdateParamsPricing(TypedDict):
145 price: NotRequired[str]
146 """
147 The ID of the price object.
148 """
149
150
151 class InvoiceLineItemUpdateParamsTaxAmount(TypedDict):
152 amount: int
153 """
154 The amount, in cents (or local equivalent), of the tax.
155 """
156 tax_rate_data: "InvoiceLineItemUpdateParamsTaxAmountTaxRateData"
157 """
158 Data to find or create a TaxRate object.
159
160 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.
161 """
162 taxability_reason: NotRequired[
163 Literal[
164 "customer_exempt",
165 "not_collecting",
166 "not_subject_to_tax",
167 "not_supported",
168 "portion_product_exempt",
169 "portion_reduced_rated",
170 "portion_standard_rated",
171 "product_exempt",
172 "product_exempt_holiday",
173 "proportionally_rated",
174 "reduced_rated",
175 "reverse_charge",
176 "standard_rated",
177 "taxable_basis_reduced",
178 "zero_rated",
179 ]
180 ]
181 """
182 The reasoning behind this tax, for example, if the product is tax exempt.
183 """
184 taxable_amount: int
185 """
186 The amount on which tax is calculated, in cents (or local equivalent).
187 """
188
189
190 class InvoiceLineItemUpdateParamsTaxAmountTaxRateData(TypedDict):
191 country: NotRequired[str]
192 """
193 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
194 """
195 description: NotRequired[str]
196 """
197 An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
198 """
199 display_name: str
200 """
201 The display name of the tax rate, which will be shown to users.
202 """
203 inclusive: bool
204 """
205 This specifies if the tax rate is inclusive or exclusive.
206 """
207 jurisdiction: NotRequired[str]
208 """
209 The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice.
210 """
211 jurisdiction_level: NotRequired[
212 Literal["city", "country", "county", "district", "multiple", "state"]
213 ]
214 """
215 The level of the jurisdiction that imposes this tax rate.
216 """
217 percentage: float
218 """
219 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.
220 """
221 state: NotRequired[str]
222 """
223 [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.
224 """
225 tax_type: NotRequired[
226 Literal[
227 "amusement_tax",
228 "communications_tax",
229 "gst",
230 "hst",
231 "igst",
232 "jct",
233 "lease_tax",
234 "pst",
235 "qst",
236 "retail_delivery_fee",
237 "rst",
238 "sales_tax",
239 "service_tax",
240 "vat",
241 ]
242 ]
243 """
244 The high-level tax type, such as `vat` or `sales_tax`.
245 """