| 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 ShippingRateCreateParams(RequestOptions): |
| 9 |
delivery_estimate: NotRequired["ShippingRateCreateParamsDeliveryEstimate"] |
| 10 |
""" |
| 11 |
The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. |
| 12 |
""" |
| 13 |
display_name: str |
| 14 |
""" |
| 15 |
The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. |
| 16 |
""" |
| 17 |
expand: NotRequired[List[str]] |
| 18 |
""" |
| 19 |
Specifies which fields in the response should be expanded. |
| 20 |
""" |
| 21 |
fixed_amount: NotRequired["ShippingRateCreateParamsFixedAmount"] |
| 22 |
""" |
| 23 |
Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. |
| 24 |
""" |
| 25 |
metadata: NotRequired[Dict[str, str]] |
| 26 |
""" |
| 27 |
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`. |
| 28 |
""" |
| 29 |
tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] |
| 30 |
""" |
| 31 |
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
| 32 |
""" |
| 33 |
tax_code: NotRequired[str] |
| 34 |
""" |
| 35 |
A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. |
| 36 |
""" |
| 37 |
type: NotRequired[Literal["fixed_amount"]] |
| 38 |
""" |
| 39 |
The type of calculation to use on the shipping rate. |
| 40 |
""" |
| 41 |
|
| 42 |
|
| 43 |
class ShippingRateCreateParamsDeliveryEstimate(TypedDict): |
| 44 |
maximum: NotRequired["ShippingRateCreateParamsDeliveryEstimateMaximum"] |
| 45 |
""" |
| 46 |
The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. |
| 47 |
""" |
| 48 |
minimum: NotRequired["ShippingRateCreateParamsDeliveryEstimateMinimum"] |
| 49 |
""" |
| 50 |
The lower bound of the estimated range. If empty, represents no lower bound. |
| 51 |
""" |
| 52 |
|
| 53 |
|
| 54 |
class ShippingRateCreateParamsDeliveryEstimateMaximum(TypedDict): |
| 55 |
unit: Literal["business_day", "day", "hour", "month", "week"] |
| 56 |
""" |
| 57 |
A unit of time. |
| 58 |
""" |
| 59 |
value: int |
| 60 |
""" |
| 61 |
Must be greater than 0. |
| 62 |
""" |
| 63 |
|
| 64 |
|
| 65 |
class ShippingRateCreateParamsDeliveryEstimateMinimum(TypedDict): |
| 66 |
unit: Literal["business_day", "day", "hour", "month", "week"] |
| 67 |
""" |
| 68 |
A unit of time. |
| 69 |
""" |
| 70 |
value: int |
| 71 |
""" |
| 72 |
Must be greater than 0. |
| 73 |
""" |
| 74 |
|
| 75 |
|
| 76 |
class ShippingRateCreateParamsFixedAmount(TypedDict): |
| 77 |
amount: int |
| 78 |
""" |
| 79 |
A non-negative integer in cents representing how much to charge. |
| 80 |
""" |
| 81 |
currency: str |
| 82 |
""" |
| 83 |
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). |
| 84 |
""" |
| 85 |
currency_options: NotRequired[ |
| 86 |
Dict[str, "ShippingRateCreateParamsFixedAmountCurrencyOptions"] |
| 87 |
] |
| 88 |
""" |
| 89 |
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). |
| 90 |
""" |
| 91 |
|
| 92 |
|
| 93 |
class ShippingRateCreateParamsFixedAmountCurrencyOptions(TypedDict): |
| 94 |
amount: int |
| 95 |
""" |
| 96 |
A non-negative integer in cents representing how much to charge. |
| 97 |
""" |
| 98 |
tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] |
| 99 |
""" |
| 100 |
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
| 101 |
""" |