Debian Codegraph @

stripe/params/_invoice_add_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 InvoiceAddLinesParams(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`.
16 """
17 lines: List["InvoiceAddLinesParamsLine"]
18 """
19 The line items to add.
20 """
21
22
23 class InvoiceAddLinesParamsLine(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[InvoiceAddLinesParamsLineDiscount]"
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 invoice_item: NotRequired[str]
43 """
44 ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
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`.
49 """
50 period: NotRequired["InvoiceAddLinesParamsLinePeriod"]
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["InvoiceAddLinesParamsLinePriceData"]
55 """
56 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
57 """
58 pricing: NotRequired["InvoiceAddLinesParamsLinePricing"]
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[InvoiceAddLinesParamsLineTaxAmount]"
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 InvoiceAddLinesParamsLineDiscount(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 InvoiceAddLinesParamsLinePeriod(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 InvoiceAddLinesParamsLinePriceData(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["InvoiceAddLinesParamsLinePriceDataProductData"]
114 """
115 Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
116 """
117 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
118 """
119 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.
120 """
121 unit_amount: NotRequired[int]
122 """
123 A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
124 """
125 unit_amount_decimal: NotRequired[str]
126 """
127 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.
128 """
129
130
131 class InvoiceAddLinesParamsLinePriceDataProductData(TypedDict):
132 description: NotRequired[str]
133 """
134 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.
135 """
136 images: NotRequired[List[str]]
137 """
138 A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
139 """
140 metadata: NotRequired[Dict[str, str]]
141 """
142 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`.
143 """
144 name: str
145 """
146 The product's name, meant to be displayable to the customer.
147 """
148 tax_code: NotRequired[str]
149 """
150 A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
151 """
152 unit_label: NotRequired[str]
153 """
154 A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
155 """
156
157
158 class InvoiceAddLinesParamsLinePricing(TypedDict):
159 price: NotRequired[str]
160 """
161 The ID of the price object.
162 """
163
164
165 class InvoiceAddLinesParamsLineTaxAmount(TypedDict):
166 amount: int
167 """
168 The amount, in cents (or local equivalent), of the tax.
169 """
170 tax_rate_data: "InvoiceAddLinesParamsLineTaxAmountTaxRateData"
171 """
172 Data to find or create a TaxRate object.
173
174 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.
175 """
176 taxability_reason: NotRequired[
177 Literal[
178 "customer_exempt",
179 "not_collecting",
180 "not_subject_to_tax",
181 "not_supported",
182 "portion_product_exempt",
183 "portion_reduced_rated",
184 "portion_standard_rated",
185 "product_exempt",
186 "product_exempt_holiday",
187 "proportionally_rated",
188 "reduced_rated",
189 "reverse_charge",
190 "standard_rated",
191 "taxable_basis_reduced",
192 "zero_rated",
193 ]
194 ]
195 """
196 The reasoning behind this tax, for example, if the product is tax exempt.
197 """
198 taxable_amount: int
199 """
200 The amount on which tax is calculated, in cents (or local equivalent).
201 """
202
203
204 class InvoiceAddLinesParamsLineTaxAmountTaxRateData(TypedDict):
205 country: NotRequired[str]
206 """
207 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
208 """
209 description: NotRequired[str]
210 """
211 An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
212 """
213 display_name: str
214 """
215 The display name of the tax rate, which will be shown to users.
216 """
217 inclusive: bool
218 """
219 This specifies if the tax rate is inclusive or exclusive.
220 """
221 jurisdiction: NotRequired[str]
222 """
223 The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice.
224 """
225 jurisdiction_level: NotRequired[
226 Literal["city", "country", "county", "district", "multiple", "state"]
227 ]
228 """
229 The level of the jurisdiction that imposes this tax rate.
230 """
231 percentage: float
232 """
233 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.
234 """
235 state: NotRequired[str]
236 """
237 [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.
238 """
239 tax_type: NotRequired[
240 Literal[
241 "amusement_tax",
242 "communications_tax",
243 "gst",
244 "hst",
245 "igst",
246 "jct",
247 "lease_tax",
248 "pst",
249 "qst",
250 "retail_delivery_fee",
251 "rst",
252 "sales_tax",
253 "service_tax",
254 "vat",
255 ]
256 ]
257 """
258 The high-level tax type, such as `vat` or `sales_tax`.
259 """