Debian Codegraph @

stripe/params/checkout/_session_modify_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 SessionModifyParams(RequestOptions):
9 collected_information: NotRequired[
10 "SessionModifyParamsCollectedInformation"
11 ]
12 """
13 Information about the customer collected within the Checkout Session. Can only be set when updating `embedded` or `custom` sessions.
14 """
15 expand: NotRequired[List[str]]
16 """
17 Specifies which fields in the response should be expanded.
18 """
19 line_items: NotRequired[List["SessionModifyParamsLineItem"]]
20 """
21 A list of items the customer is purchasing.
22
23 When updating line items, you must retransmit the entire array of line items.
24
25 To retain an existing line item, specify its `id`.
26
27 To update an existing line item, specify its `id` along with the new values of the fields to update.
28
29 To add a new line item, specify one of `price` or `price_data` and `quantity`.
30
31 To remove an existing line item, omit the line item's ID from the retransmitted array.
32
33 To reorder a line item, specify it at the desired position in the retransmitted array.
34 """
35 metadata: NotRequired["Literal['']|Dict[str, str]"]
36 """
37 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`.
38 """
39 shipping_options: NotRequired[
40 "Literal['']|List[SessionModifyParamsShippingOption]"
41 ]
42 """
43 The shipping rate options to apply to this Session. Up to a maximum of 5.
44 """
45
46
47 class SessionModifyParamsCollectedInformation(TypedDict):
48 shipping_details: NotRequired[
49 "SessionModifyParamsCollectedInformationShippingDetails"
50 ]
51 """
52 The shipping details to apply to this Session.
53 """
54
55
56 class SessionModifyParamsCollectedInformationShippingDetails(TypedDict):
57 address: "SessionModifyParamsCollectedInformationShippingDetailsAddress"
58 """
59 The address of the customer
60 """
61 name: str
62 """
63 The name of customer
64 """
65
66
67 class SessionModifyParamsCollectedInformationShippingDetailsAddress(TypedDict):
68 city: NotRequired[str]
69 """
70 City, district, suburb, town, or village.
71 """
72 country: str
73 """
74 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
75 """
76 line1: str
77 """
78 Address line 1, such as the street, PO Box, or company name.
79 """
80 line2: NotRequired[str]
81 """
82 Address line 2, such as the apartment, suite, unit, or building.
83 """
84 postal_code: NotRequired[str]
85 """
86 ZIP or postal code.
87 """
88 state: NotRequired[str]
89 """
90 State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
91 """
92
93
94 class SessionModifyParamsLineItem(TypedDict):
95 adjustable_quantity: NotRequired[
96 "SessionModifyParamsLineItemAdjustableQuantity"
97 ]
98 """
99 When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout.
100 """
101 id: NotRequired[str]
102 """
103 ID of an existing line item.
104 """
105 metadata: NotRequired["Literal['']|Dict[str, str]"]
106 """
107 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`.
108 """
109 price: NotRequired[str]
110 """
111 The ID of the [Price](https://docs.stripe.com/api/prices). One of `price` or `price_data` is required when creating a new line item.
112 """
113 price_data: NotRequired["SessionModifyParamsLineItemPriceData"]
114 """
115 Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required when creating a new line item.
116 """
117 quantity: NotRequired[int]
118 """
119 The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`.
120 """
121 tax_rates: NotRequired["Literal['']|List[str]"]
122 """
123 The [tax rates](https://docs.stripe.com/api/tax_rates) which apply to this line item.
124 """
125
126
127 class SessionModifyParamsLineItemAdjustableQuantity(TypedDict):
128 enabled: bool
129 """
130 Set to true if the quantity can be adjusted to any positive integer. Setting to false will remove any previously specified constraints on quantity.
131 """
132 maximum: NotRequired[int]
133 """
134 The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999.
135 """
136 minimum: NotRequired[int]
137 """
138 The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0.
139 """
140
141
142 class SessionModifyParamsLineItemPriceData(TypedDict):
143 currency: str
144 """
145 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).
146 """
147 product: NotRequired[str]
148 """
149 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.
150 """
151 product_data: NotRequired[
152 "SessionModifyParamsLineItemPriceDataProductData"
153 ]
154 """
155 Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
156 """
157 recurring: NotRequired["SessionModifyParamsLineItemPriceDataRecurring"]
158 """
159 The recurring components of a price such as `interval` and `interval_count`.
160 """
161 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
162 """
163 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.
164 """
165 unit_amount: NotRequired[int]
166 """
167 A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
168 """
169 unit_amount_decimal: NotRequired[str]
170 """
171 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.
172 """
173
174
175 class SessionModifyParamsLineItemPriceDataProductData(TypedDict):
176 description: NotRequired[str]
177 """
178 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.
179 """
180 images: NotRequired[List[str]]
181 """
182 A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
183 """
184 metadata: NotRequired[Dict[str, str]]
185 """
186 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`.
187 """
188 name: str
189 """
190 The product's name, meant to be displayable to the customer.
191 """
192 tax_code: NotRequired[str]
193 """
194 A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
195 """
196 unit_label: NotRequired[str]
197 """
198 A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
199 """
200
201
202 class SessionModifyParamsLineItemPriceDataRecurring(TypedDict):
203 interval: Literal["day", "month", "week", "year"]
204 """
205 Specifies billing frequency. Either `day`, `week`, `month` or `year`.
206 """
207 interval_count: NotRequired[int]
208 """
209 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).
210 """
211
212
213 class SessionModifyParamsShippingOption(TypedDict):
214 shipping_rate: NotRequired[str]
215 """
216 The ID of the Shipping Rate to use for this shipping option.
217 """
218 shipping_rate_data: NotRequired[
219 "SessionModifyParamsShippingOptionShippingRateData"
220 ]
221 """
222 Parameters to be passed to Shipping Rate creation for this shipping option.
223 """
224
225
226 class SessionModifyParamsShippingOptionShippingRateData(TypedDict):
227 delivery_estimate: NotRequired[
228 "SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate"
229 ]
230 """
231 The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
232 """
233 display_name: str
234 """
235 The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
236 """
237 fixed_amount: NotRequired[
238 "SessionModifyParamsShippingOptionShippingRateDataFixedAmount"
239 ]
240 """
241 Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
242 """
243 metadata: NotRequired[Dict[str, str]]
244 """
245 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`.
246 """
247 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
248 """
249 Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
250 """
251 tax_code: NotRequired[str]
252 """
253 A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
254 """
255 type: NotRequired[Literal["fixed_amount"]]
256 """
257 The type of calculation to use on the shipping rate.
258 """
259
260
261 class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate(
262 TypedDict,
263 ):
264 maximum: NotRequired[
265 "SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMaximum"
266 ]
267 """
268 The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
269 """
270 minimum: NotRequired[
271 "SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMinimum"
272 ]
273 """
274 The lower bound of the estimated range. If empty, represents no lower bound.
275 """
276
277
278 class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMaximum(
279 TypedDict,
280 ):
281 unit: Literal["business_day", "day", "hour", "month", "week"]
282 """
283 A unit of time.
284 """
285 value: int
286 """
287 Must be greater than 0.
288 """
289
290
291 class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMinimum(
292 TypedDict,
293 ):
294 unit: Literal["business_day", "day", "hour", "month", "week"]
295 """
296 A unit of time.
297 """
298 value: int
299 """
300 Must be greater than 0.
301 """
302
303
304 class SessionModifyParamsShippingOptionShippingRateDataFixedAmount(TypedDict):
305 amount: int
306 """
307 A non-negative integer in cents representing how much to charge.
308 """
309 currency: str
310 """
311 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).
312 """
313 currency_options: NotRequired[
314 Dict[
315 str,
316 "SessionModifyParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions",
317 ]
318 ]
319 """
320 Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
321 """
322
323
324 class SessionModifyParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions(
325 TypedDict,
326 ):
327 amount: int
328 """
329 A non-negative integer in cents representing how much to charge.
330 """
331 tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]]
332 """
333 Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
334 """