Debian Codegraph @

stripe/params/tax/_calculation_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 CalculationCreateParams(RequestOptions):
9 currency: str
10 """
11 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).
12 """
13 customer: NotRequired[str]
14 """
15 The ID of an existing customer to use for this calculation. If provided, the customer's address and tax IDs are copied to `customer_details`.
16 """
17 customer_details: NotRequired["CalculationCreateParamsCustomerDetails"]
18 """
19 Details about the customer, including address and tax IDs.
20 """
21 expand: NotRequired[List[str]]
22 """
23 Specifies which fields in the response should be expanded.
24 """
25 line_items: List["CalculationCreateParamsLineItem"]
26 """
27 A list of items the customer is purchasing.
28 """
29 ship_from_details: NotRequired["CalculationCreateParamsShipFromDetails"]
30 """
31 Details about the address from which the goods are being shipped.
32 """
33 shipping_cost: NotRequired["CalculationCreateParamsShippingCost"]
34 """
35 Shipping cost details to be used for the calculation.
36 """
37 tax_date: NotRequired[int]
38 """
39 Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future.
40 """
41
42
43 class CalculationCreateParamsCustomerDetails(TypedDict):
44 address: NotRequired["CalculationCreateParamsCustomerDetailsAddress"]
45 """
46 The customer's postal address (for example, home or business location).
47 """
48 address_source: NotRequired[Literal["billing", "shipping"]]
49 """
50 The type of customer address provided.
51 """
52 ip_address: NotRequired[str]
53 """
54 The customer's IP address (IPv4 or IPv6).
55 """
56 tax_ids: NotRequired[List["CalculationCreateParamsCustomerDetailsTaxId"]]
57 """
58 The customer's tax IDs. Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. Stripe Tax doesn't validate tax IDs for correctness.
59 """
60 taxability_override: NotRequired[
61 Literal["customer_exempt", "none", "reverse_charge"]
62 ]
63 """
64 Overrides the tax calculation result to allow you to not collect tax from your customer. Use this if you've manually checked your customer's tax exemptions. Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies.
65 """
66
67
68 class CalculationCreateParamsCustomerDetailsAddress(TypedDict):
69 city: NotRequired["Literal['']|str"]
70 """
71 City, district, suburb, town, or village.
72 """
73 country: str
74 """
75 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
76 """
77 line1: NotRequired["Literal['']|str"]
78 """
79 Address line 1, such as the street, PO Box, or company name.
80 """
81 line2: NotRequired["Literal['']|str"]
82 """
83 Address line 2, such as the apartment, suite, unit, or building.
84 """
85 postal_code: NotRequired["Literal['']|str"]
86 """
87 ZIP or postal code.
88 """
89 state: NotRequired["Literal['']|str"]
90 """
91 State, county, province, or region. We recommend sending [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code value when possible.
92 """
93
94
95 class CalculationCreateParamsCustomerDetailsTaxId(TypedDict):
96 type: Literal[
97 "ad_nrt",
98 "ae_trn",
99 "al_tin",
100 "am_tin",
101 "ao_tin",
102 "ar_cuit",
103 "au_abn",
104 "au_arn",
105 "aw_tin",
106 "az_tin",
107 "ba_tin",
108 "bb_tin",
109 "bd_bin",
110 "bf_ifu",
111 "bg_uic",
112 "bh_vat",
113 "bj_ifu",
114 "bo_tin",
115 "br_cnpj",
116 "br_cpf",
117 "bs_tin",
118 "by_tin",
119 "ca_bn",
120 "ca_gst_hst",
121 "ca_pst_bc",
122 "ca_pst_mb",
123 "ca_pst_sk",
124 "ca_qst",
125 "cd_nif",
126 "ch_uid",
127 "ch_vat",
128 "cl_tin",
129 "cm_niu",
130 "cn_tin",
131 "co_nit",
132 "cr_tin",
133 "cv_nif",
134 "de_stn",
135 "do_rcn",
136 "ec_ruc",
137 "eg_tin",
138 "es_cif",
139 "et_tin",
140 "eu_oss_vat",
141 "eu_vat",
142 "gb_vat",
143 "ge_vat",
144 "gn_nif",
145 "hk_br",
146 "hr_oib",
147 "hu_tin",
148 "id_npwp",
149 "il_vat",
150 "in_gst",
151 "is_vat",
152 "jp_cn",
153 "jp_rn",
154 "jp_trn",
155 "ke_pin",
156 "kg_tin",
157 "kh_tin",
158 "kr_brn",
159 "kz_bin",
160 "la_tin",
161 "li_uid",
162 "li_vat",
163 "lk_vat",
164 "ma_vat",
165 "md_vat",
166 "me_pib",
167 "mk_vat",
168 "mr_nif",
169 "mx_rfc",
170 "my_frp",
171 "my_itn",
172 "my_sst",
173 "ng_tin",
174 "no_vat",
175 "no_voec",
176 "np_pan",
177 "nz_gst",
178 "om_vat",
179 "pe_ruc",
180 "ph_tin",
181 "pl_nip",
182 "ro_tin",
183 "rs_pib",
184 "ru_inn",
185 "ru_kpp",
186 "sa_vat",
187 "sg_gst",
188 "sg_uen",
189 "si_tin",
190 "sn_ninea",
191 "sr_fin",
192 "sv_nit",
193 "th_vat",
194 "tj_tin",
195 "tr_tin",
196 "tw_vat",
197 "tz_vat",
198 "ua_vat",
199 "ug_tin",
200 "us_ein",
201 "uy_ruc",
202 "uz_tin",
203 "uz_vat",
204 "ve_rif",
205 "vn_tin",
206 "za_vat",
207 "zm_tin",
208 "zw_tin",
209 ]
210 """
211 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`
212 """
213 value: str
214 """
215 Value of the tax ID.
216 """
217
218
219 class CalculationCreateParamsLineItem(TypedDict):
220 amount: int
221 """
222 A positive integer representing the line item's total price in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
223 If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
224 """
225 metadata: NotRequired[Dict[str, str]]
226 """
227 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.
228 """
229 product: NotRequired[str]
230 """
231 If provided, the product's `tax_code` will be used as the line item's `tax_code`.
232 """
233 quantity: NotRequired[int]
234 """
235 The number of units of the item being purchased. Used to calculate the per-unit price from the total `amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25.
236 """
237 reference: NotRequired[str]
238 """
239 A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](https://docs.stripe.com/tax/reports).
240 """
241 tax_behavior: NotRequired[Literal["exclusive", "inclusive"]]
242 """
243 Specifies whether the `amount` includes taxes. Defaults to `exclusive`.
244 """
245 tax_code: NotRequired[str]
246 """
247 A [tax code](https://docs.stripe.com/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings.
248 """
249
250
251 class CalculationCreateParamsShipFromDetails(TypedDict):
252 address: "CalculationCreateParamsShipFromDetailsAddress"
253 """
254 The address from which the goods are being shipped from.
255 """
256
257
258 class CalculationCreateParamsShipFromDetailsAddress(TypedDict):
259 city: NotRequired["Literal['']|str"]
260 """
261 City, district, suburb, town, or village.
262 """
263 country: str
264 """
265 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
266 """
267 line1: NotRequired["Literal['']|str"]
268 """
269 Address line 1, such as the street, PO Box, or company name.
270 """
271 line2: NotRequired["Literal['']|str"]
272 """
273 Address line 2, such as the apartment, suite, unit, or building.
274 """
275 postal_code: NotRequired["Literal['']|str"]
276 """
277 ZIP or postal code.
278 """
279 state: NotRequired["Literal['']|str"]
280 """
281 State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix, such as "NY" or "TX".
282 """
283
284
285 class CalculationCreateParamsShippingCost(TypedDict):
286 amount: NotRequired[int]
287 """
288 A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
289 """
290 shipping_rate: NotRequired[str]
291 """
292 If provided, the [shipping rate](https://docs.stripe.com/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters.
293 """
294 tax_behavior: NotRequired[Literal["exclusive", "inclusive"]]
295 """
296 Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`.
297 """
298 tax_code: NotRequired[str]
299 """
300 The [tax code](https://docs.stripe.com/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://dashboard.stripe.com/settings/tax) is used.
301 """