| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._request_options import RequestOptions |
| 4 |
from typing import Dict, List, Union |
| 5 |
from typing_extensions import Literal, NotRequired, TypedDict |
| 6 |
|
| 7 |
|
| 8 |
class ProductCreateParams(RequestOptions): |
| 9 |
active: NotRequired[bool] |
| 10 |
""" |
| 11 |
Whether the product is currently available for purchase. Defaults to `true`. |
| 12 |
""" |
| 13 |
default_price_data: NotRequired["ProductCreateParamsDefaultPriceData"] |
| 14 |
""" |
| 15 |
Data used to generate a new [Price](https://docs.stripe.com/api/prices) object. This Price will be set as the default price for this product. |
| 16 |
""" |
| 17 |
description: NotRequired[str] |
| 18 |
""" |
| 19 |
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. |
| 20 |
""" |
| 21 |
expand: NotRequired[List[str]] |
| 22 |
""" |
| 23 |
Specifies which fields in the response should be expanded. |
| 24 |
""" |
| 25 |
id: NotRequired[str] |
| 26 |
""" |
| 27 |
An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. |
| 28 |
""" |
| 29 |
images: NotRequired[List[str]] |
| 30 |
""" |
| 31 |
A list of up to 8 URLs of images for this product, meant to be displayable to the customer. |
| 32 |
""" |
| 33 |
marketing_features: NotRequired[ |
| 34 |
List["ProductCreateParamsMarketingFeature"] |
| 35 |
] |
| 36 |
""" |
| 37 |
A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://docs.stripe.com/payments/checkout/pricing-table). |
| 38 |
""" |
| 39 |
metadata: NotRequired[Dict[str, str]] |
| 40 |
""" |
| 41 |
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`. |
| 42 |
""" |
| 43 |
name: str |
| 44 |
""" |
| 45 |
The product's name, meant to be displayable to the customer. |
| 46 |
""" |
| 47 |
package_dimensions: NotRequired["ProductCreateParamsPackageDimensions"] |
| 48 |
""" |
| 49 |
The dimensions of this product for shipping purposes. |
| 50 |
""" |
| 51 |
shippable: NotRequired[bool] |
| 52 |
""" |
| 53 |
Whether this product is shipped (i.e., physical goods). |
| 54 |
""" |
| 55 |
statement_descriptor: NotRequired[str] |
| 56 |
""" |
| 57 |
An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. |
| 58 |
|
| 59 |
This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. |
| 60 |
It must contain at least one letter. Only used for subscription payments. |
| 61 |
""" |
| 62 |
tax_code: NotRequired[str] |
| 63 |
""" |
| 64 |
A [tax code](https://docs.stripe.com/tax/tax-categories) ID. |
| 65 |
""" |
| 66 |
type: NotRequired[Literal["good", "service"]] |
| 67 |
""" |
| 68 |
The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. |
| 69 |
""" |
| 70 |
unit_label: NotRequired[str] |
| 71 |
""" |
| 72 |
A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. |
| 73 |
""" |
| 74 |
url: NotRequired[str] |
| 75 |
""" |
| 76 |
A URL of a publicly-accessible webpage for this product. |
| 77 |
""" |
| 78 |
|
| 79 |
|
| 80 |
class ProductCreateParamsDefaultPriceData(TypedDict): |
| 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, "ProductCreateParamsDefaultPriceDataCurrencyOptions"] |
| 87 |
] |
| 88 |
""" |
| 89 |
Prices 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 |
custom_unit_amount: NotRequired[ |
| 92 |
"ProductCreateParamsDefaultPriceDataCustomUnitAmount" |
| 93 |
] |
| 94 |
""" |
| 95 |
When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. |
| 96 |
""" |
| 97 |
metadata: NotRequired[Dict[str, str]] |
| 98 |
""" |
| 99 |
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`. |
| 100 |
""" |
| 101 |
recurring: NotRequired["ProductCreateParamsDefaultPriceDataRecurring"] |
| 102 |
""" |
| 103 |
The recurring components of a price such as `interval` and `interval_count`. |
| 104 |
""" |
| 105 |
tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] |
| 106 |
""" |
| 107 |
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. |
| 108 |
""" |
| 109 |
unit_amount: NotRequired[int] |
| 110 |
""" |
| 111 |
A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required. |
| 112 |
""" |
| 113 |
unit_amount_decimal: NotRequired[str] |
| 114 |
""" |
| 115 |
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. |
| 116 |
""" |
| 117 |
|
| 118 |
|
| 119 |
class ProductCreateParamsDefaultPriceDataCurrencyOptions(TypedDict): |
| 120 |
custom_unit_amount: NotRequired[ |
| 121 |
"ProductCreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount" |
| 122 |
] |
| 123 |
""" |
| 124 |
When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. |
| 125 |
""" |
| 126 |
tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] |
| 127 |
""" |
| 128 |
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. |
| 129 |
""" |
| 130 |
tiers: NotRequired[ |
| 131 |
List["ProductCreateParamsDefaultPriceDataCurrencyOptionsTier"] |
| 132 |
] |
| 133 |
""" |
| 134 |
Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. |
| 135 |
""" |
| 136 |
unit_amount: NotRequired[int] |
| 137 |
""" |
| 138 |
A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. |
| 139 |
""" |
| 140 |
unit_amount_decimal: NotRequired[str] |
| 141 |
""" |
| 142 |
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. |
| 143 |
""" |
| 144 |
|
| 145 |
|
| 146 |
class ProductCreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount( |
| 147 |
TypedDict, |
| 148 |
): |
| 149 |
enabled: bool |
| 150 |
""" |
| 151 |
Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. |
| 152 |
""" |
| 153 |
maximum: NotRequired[int] |
| 154 |
""" |
| 155 |
The maximum unit amount the customer can specify for this item. |
| 156 |
""" |
| 157 |
minimum: NotRequired[int] |
| 158 |
""" |
| 159 |
The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. |
| 160 |
""" |
| 161 |
preset: NotRequired[int] |
| 162 |
""" |
| 163 |
The starting unit amount which can be updated by the customer. |
| 164 |
""" |
| 165 |
|
| 166 |
|
| 167 |
class ProductCreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): |
| 168 |
flat_amount: NotRequired[int] |
| 169 |
""" |
| 170 |
The flat billing amount for an entire tier, regardless of the number of units in the tier. |
| 171 |
""" |
| 172 |
flat_amount_decimal: NotRequired[str] |
| 173 |
""" |
| 174 |
Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. |
| 175 |
""" |
| 176 |
unit_amount: NotRequired[int] |
| 177 |
""" |
| 178 |
The per unit billing amount for each individual unit for which this tier applies. |
| 179 |
""" |
| 180 |
unit_amount_decimal: NotRequired[str] |
| 181 |
""" |
| 182 |
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. |
| 183 |
""" |
| 184 |
up_to: Union[Literal["inf"], int] |
| 185 |
""" |
| 186 |
Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. |
| 187 |
""" |
| 188 |
|
| 189 |
|
| 190 |
class ProductCreateParamsDefaultPriceDataCustomUnitAmount(TypedDict): |
| 191 |
enabled: bool |
| 192 |
""" |
| 193 |
Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. |
| 194 |
""" |
| 195 |
maximum: NotRequired[int] |
| 196 |
""" |
| 197 |
The maximum unit amount the customer can specify for this item. |
| 198 |
""" |
| 199 |
minimum: NotRequired[int] |
| 200 |
""" |
| 201 |
The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. |
| 202 |
""" |
| 203 |
preset: NotRequired[int] |
| 204 |
""" |
| 205 |
The starting unit amount which can be updated by the customer. |
| 206 |
""" |
| 207 |
|
| 208 |
|
| 209 |
class ProductCreateParamsDefaultPriceDataRecurring(TypedDict): |
| 210 |
interval: Literal["day", "month", "week", "year"] |
| 211 |
""" |
| 212 |
Specifies billing frequency. Either `day`, `week`, `month` or `year`. |
| 213 |
""" |
| 214 |
interval_count: NotRequired[int] |
| 215 |
""" |
| 216 |
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). |
| 217 |
""" |
| 218 |
|
| 219 |
|
| 220 |
class ProductCreateParamsMarketingFeature(TypedDict): |
| 221 |
name: str |
| 222 |
""" |
| 223 |
The marketing feature name. Up to 80 characters long. |
| 224 |
""" |
| 225 |
|
| 226 |
|
| 227 |
class ProductCreateParamsPackageDimensions(TypedDict): |
| 228 |
height: float |
| 229 |
""" |
| 230 |
Height, in inches. Maximum precision is 2 decimal places. |
| 231 |
""" |
| 232 |
length: float |
| 233 |
""" |
| 234 |
Length, in inches. Maximum precision is 2 decimal places. |
| 235 |
""" |
| 236 |
weight: float |
| 237 |
""" |
| 238 |
Weight, in ounces. Maximum precision is 2 decimal places. |
| 239 |
""" |
| 240 |
width: float |
| 241 |
""" |
| 242 |
Width, in inches. Maximum precision is 2 decimal places. |
| 243 |
""" |