Debian Codegraph @

stripe/params/billing_portal/_configuration_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, Union
5 from typing_extensions import Literal, NotRequired, TypedDict
6
7
8 class ConfigurationCreateParams(RequestOptions):
9 business_profile: NotRequired["ConfigurationCreateParamsBusinessProfile"]
10 """
11 The business information shown to customers in the portal.
12 """
13 default_return_url: NotRequired["Literal['']|str"]
14 """
15 The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
16 """
17 expand: NotRequired[List[str]]
18 """
19 Specifies which fields in the response should be expanded.
20 """
21 features: "ConfigurationCreateParamsFeatures"
22 """
23 Information about the features available in the portal.
24 """
25 login_page: NotRequired["ConfigurationCreateParamsLoginPage"]
26 """
27 The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share).
28 """
29 metadata: NotRequired[Dict[str, str]]
30 """
31 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`.
32 """
33 name: NotRequired["Literal['']|str"]
34 """
35 The name of the configuration.
36 """
37
38
39 class ConfigurationCreateParamsBusinessProfile(TypedDict):
40 headline: NotRequired["Literal['']|str"]
41 """
42 The messaging shown to customers in the portal.
43 """
44 privacy_policy_url: NotRequired[str]
45 """
46 A link to the business's publicly available privacy policy.
47 """
48 terms_of_service_url: NotRequired[str]
49 """
50 A link to the business's publicly available terms of service.
51 """
52
53
54 class ConfigurationCreateParamsFeatures(TypedDict):
55 customer_update: NotRequired[
56 "ConfigurationCreateParamsFeaturesCustomerUpdate"
57 ]
58 """
59 Information about updating the customer details in the portal.
60 """
61 invoice_history: NotRequired[
62 "ConfigurationCreateParamsFeaturesInvoiceHistory"
63 ]
64 """
65 Information about showing the billing history in the portal.
66 """
67 payment_method_update: NotRequired[
68 "ConfigurationCreateParamsFeaturesPaymentMethodUpdate"
69 ]
70 """
71 Information about updating payment methods in the portal.
72 """
73 subscription_cancel: NotRequired[
74 "ConfigurationCreateParamsFeaturesSubscriptionCancel"
75 ]
76 """
77 Information about canceling subscriptions in the portal.
78 """
79 subscription_update: NotRequired[
80 "ConfigurationCreateParamsFeaturesSubscriptionUpdate"
81 ]
82 """
83 Information about updating subscriptions in the portal.
84 """
85
86
87 class ConfigurationCreateParamsFeaturesCustomerUpdate(TypedDict):
88 allowed_updates: NotRequired[
89 "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]"
90 ]
91 """
92 The types of customer updates that are supported. When empty, customers are not updateable.
93 """
94 enabled: bool
95 """
96 Whether the feature is enabled.
97 """
98
99
100 class ConfigurationCreateParamsFeaturesInvoiceHistory(TypedDict):
101 enabled: bool
102 """
103 Whether the feature is enabled.
104 """
105
106
107 class ConfigurationCreateParamsFeaturesPaymentMethodUpdate(TypedDict):
108 enabled: bool
109 """
110 Whether the feature is enabled.
111 """
112 payment_method_configuration: NotRequired["Literal['']|str"]
113 """
114 The [Payment Method Configuration](https://docs.stripe.com/api/payment_method_configurations) to use for this portal session. When specified, customers will be able to update their payment method to one of the options specified by the payment method configuration. If not set or set to an empty string, the default payment method configuration is used.
115 """
116
117
118 class ConfigurationCreateParamsFeaturesSubscriptionCancel(TypedDict):
119 cancellation_reason: NotRequired[
120 "ConfigurationCreateParamsFeaturesSubscriptionCancelCancellationReason"
121 ]
122 """
123 Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer
124 """
125 enabled: bool
126 """
127 Whether the feature is enabled.
128 """
129 mode: NotRequired[Literal["at_period_end", "immediately"]]
130 """
131 Whether to cancel subscriptions immediately or at the end of the billing period.
132 """
133 proration_behavior: NotRequired[
134 Literal["always_invoice", "create_prorations", "none"]
135 ]
136 """
137 Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period.
138 """
139
140
141 class ConfigurationCreateParamsFeaturesSubscriptionCancelCancellationReason(
142 TypedDict,
143 ):
144 enabled: bool
145 """
146 Whether the feature is enabled.
147 """
148 options: Union[
149 Literal[""],
150 List[
151 Literal[
152 "customer_service",
153 "low_quality",
154 "missing_features",
155 "other",
156 "switched_service",
157 "too_complex",
158 "too_expensive",
159 "unused",
160 ]
161 ],
162 ]
163 """
164 Which cancellation reasons will be given as options to the customer.
165 """
166
167
168 class ConfigurationCreateParamsFeaturesSubscriptionUpdate(TypedDict):
169 billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]]
170 """
171 Determines the value to use for the billing cycle anchor on subscription updates. Valid values are `now` or `unchanged`, and the default value is `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle).
172 """
173 default_allowed_updates: NotRequired[
174 "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]"
175 ]
176 """
177 The types of subscription updates that are supported. When empty, subscriptions are not updateable.
178 """
179 enabled: bool
180 """
181 Whether the feature is enabled.
182 """
183 products: NotRequired[
184 "Literal['']|List[ConfigurationCreateParamsFeaturesSubscriptionUpdateProduct]"
185 ]
186 """
187 The list of up to 10 products that support subscription updates.
188 """
189 proration_behavior: NotRequired[
190 Literal["always_invoice", "create_prorations", "none"]
191 ]
192 """
193 Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
194 """
195 schedule_at_period_end: NotRequired[
196 "ConfigurationCreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd"
197 ]
198 """
199 Setting to control when an update should be scheduled at the end of the period instead of applying immediately.
200 """
201 trial_update_behavior: NotRequired[Literal["continue_trial", "end_trial"]]
202 """
203 The behavior when updating a subscription that is trialing.
204 """
205
206
207 class ConfigurationCreateParamsFeaturesSubscriptionUpdateProduct(TypedDict):
208 adjustable_quantity: NotRequired[
209 "ConfigurationCreateParamsFeaturesSubscriptionUpdateProductAdjustableQuantity"
210 ]
211 """
212 Control whether the quantity of the product can be adjusted.
213 """
214 prices: List[str]
215 """
216 The list of price IDs for the product that a subscription can be updated to.
217 """
218 product: str
219 """
220 The product id.
221 """
222
223
224 class ConfigurationCreateParamsFeaturesSubscriptionUpdateProductAdjustableQuantity(
225 TypedDict,
226 ):
227 enabled: bool
228 """
229 Set to true if the quantity can be adjusted to any non-negative integer.
230 """
231 maximum: NotRequired[int]
232 """
233 The maximum quantity that can be set for the product.
234 """
235 minimum: NotRequired[int]
236 """
237 The minimum quantity that can be set for the product.
238 """
239
240
241 class ConfigurationCreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd(
242 TypedDict,
243 ):
244 conditions: NotRequired[
245 List[
246 "ConfigurationCreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition"
247 ]
248 ]
249 """
250 List of conditions. When any condition is true, the update will be scheduled at the end of the current period.
251 """
252
253
254 class ConfigurationCreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition(
255 TypedDict,
256 ):
257 type: Literal["decreasing_item_amount", "shortening_interval"]
258 """
259 The type of condition.
260 """
261
262
263 class ConfigurationCreateParamsLoginPage(TypedDict):
264 enabled: bool
265 """
266 Set to `true` to generate a shareable URL [`login_page.url`](https://docs.stripe.com/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal.
267 """