Debian Codegraph @

stripe/params/billing_portal/_configuration_update_params.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from typing import Dict, List
4 from typing_extensions import Literal, NotRequired, TypedDict
5
6
7 class ConfigurationUpdateParams(TypedDict):
8 active: NotRequired[bool]
9 """
10 Whether the configuration is active and can be used to create portal sessions.
11 """
12 business_profile: NotRequired["ConfigurationUpdateParamsBusinessProfile"]
13 """
14 The business information shown to customers in the portal.
15 """
16 default_return_url: NotRequired["Literal['']|str"]
17 """
18 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.
19 """
20 expand: NotRequired[List[str]]
21 """
22 Specifies which fields in the response should be expanded.
23 """
24 features: NotRequired["ConfigurationUpdateParamsFeatures"]
25 """
26 Information about the features available in the portal.
27 """
28 login_page: NotRequired["ConfigurationUpdateParamsLoginPage"]
29 """
30 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).
31 """
32 metadata: NotRequired["Literal['']|Dict[str, str]"]
33 """
34 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`.
35 """
36 name: NotRequired["Literal['']|str"]
37 """
38 The name of the configuration.
39 """
40
41
42 class ConfigurationUpdateParamsBusinessProfile(TypedDict):
43 headline: NotRequired["Literal['']|str"]
44 """
45 The messaging shown to customers in the portal.
46 """
47 privacy_policy_url: NotRequired["Literal['']|str"]
48 """
49 A link to the business's publicly available privacy policy.
50 """
51 terms_of_service_url: NotRequired["Literal['']|str"]
52 """
53 A link to the business's publicly available terms of service.
54 """
55
56
57 class ConfigurationUpdateParamsFeatures(TypedDict):
58 customer_update: NotRequired[
59 "ConfigurationUpdateParamsFeaturesCustomerUpdate"
60 ]
61 """
62 Information about updating the customer details in the portal.
63 """
64 invoice_history: NotRequired[
65 "ConfigurationUpdateParamsFeaturesInvoiceHistory"
66 ]
67 """
68 Information about showing the billing history in the portal.
69 """
70 payment_method_update: NotRequired[
71 "ConfigurationUpdateParamsFeaturesPaymentMethodUpdate"
72 ]
73 """
74 Information about updating payment methods in the portal.
75 """
76 subscription_cancel: NotRequired[
77 "ConfigurationUpdateParamsFeaturesSubscriptionCancel"
78 ]
79 """
80 Information about canceling subscriptions in the portal.
81 """
82 subscription_update: NotRequired[
83 "ConfigurationUpdateParamsFeaturesSubscriptionUpdate"
84 ]
85 """
86 Information about updating subscriptions in the portal.
87 """
88
89
90 class ConfigurationUpdateParamsFeaturesCustomerUpdate(TypedDict):
91 allowed_updates: NotRequired[
92 "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]"
93 ]
94 """
95 The types of customer updates that are supported. When empty, customers are not updateable.
96 """
97 enabled: NotRequired[bool]
98 """
99 Whether the feature is enabled.
100 """
101
102
103 class ConfigurationUpdateParamsFeaturesInvoiceHistory(TypedDict):
104 enabled: bool
105 """
106 Whether the feature is enabled.
107 """
108
109
110 class ConfigurationUpdateParamsFeaturesPaymentMethodUpdate(TypedDict):
111 enabled: bool
112 """
113 Whether the feature is enabled.
114 """
115 payment_method_configuration: NotRequired["Literal['']|str"]
116 """
117 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.
118 """
119
120
121 class ConfigurationUpdateParamsFeaturesSubscriptionCancel(TypedDict):
122 cancellation_reason: NotRequired[
123 "ConfigurationUpdateParamsFeaturesSubscriptionCancelCancellationReason"
124 ]
125 """
126 Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer
127 """
128 enabled: NotRequired[bool]
129 """
130 Whether the feature is enabled.
131 """
132 mode: NotRequired[Literal["at_period_end", "immediately"]]
133 """
134 Whether to cancel subscriptions immediately or at the end of the billing period.
135 """
136 proration_behavior: NotRequired[
137 Literal["always_invoice", "create_prorations", "none"]
138 ]
139 """
140 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.
141 """
142
143
144 class ConfigurationUpdateParamsFeaturesSubscriptionCancelCancellationReason(
145 TypedDict,
146 ):
147 enabled: bool
148 """
149 Whether the feature is enabled.
150 """
151 options: NotRequired[
152 "Literal['']|List[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']]"
153 ]
154 """
155 Which cancellation reasons will be given as options to the customer.
156 """
157
158
159 class ConfigurationUpdateParamsFeaturesSubscriptionUpdate(TypedDict):
160 billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]]
161 """
162 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).
163 """
164 default_allowed_updates: NotRequired[
165 "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]"
166 ]
167 """
168 The types of subscription updates that are supported. When empty, subscriptions are not updateable.
169 """
170 enabled: NotRequired[bool]
171 """
172 Whether the feature is enabled.
173 """
174 products: NotRequired[
175 "Literal['']|List[ConfigurationUpdateParamsFeaturesSubscriptionUpdateProduct]"
176 ]
177 """
178 The list of up to 10 products that support subscription updates.
179 """
180 proration_behavior: NotRequired[
181 Literal["always_invoice", "create_prorations", "none"]
182 ]
183 """
184 Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
185 """
186 schedule_at_period_end: NotRequired[
187 "ConfigurationUpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd"
188 ]
189 """
190 Setting to control when an update should be scheduled at the end of the period instead of applying immediately.
191 """
192 trial_update_behavior: NotRequired[Literal["continue_trial", "end_trial"]]
193 """
194 The behavior when updating a subscription that is trialing.
195 """
196
197
198 class ConfigurationUpdateParamsFeaturesSubscriptionUpdateProduct(TypedDict):
199 adjustable_quantity: NotRequired[
200 "ConfigurationUpdateParamsFeaturesSubscriptionUpdateProductAdjustableQuantity"
201 ]
202 """
203 Control whether the quantity of the product can be adjusted.
204 """
205 prices: List[str]
206 """
207 The list of price IDs for the product that a subscription can be updated to.
208 """
209 product: str
210 """
211 The product id.
212 """
213
214
215 class ConfigurationUpdateParamsFeaturesSubscriptionUpdateProductAdjustableQuantity(
216 TypedDict,
217 ):
218 enabled: bool
219 """
220 Set to true if the quantity can be adjusted to any non-negative integer.
221 """
222 maximum: NotRequired[int]
223 """
224 The maximum quantity that can be set for the product.
225 """
226 minimum: NotRequired[int]
227 """
228 The minimum quantity that can be set for the product.
229 """
230
231
232 class ConfigurationUpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd(
233 TypedDict,
234 ):
235 conditions: NotRequired[
236 "Literal['']|List[ConfigurationUpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition]"
237 ]
238 """
239 List of conditions. When any condition is true, the update will be scheduled at the end of the current period.
240 """
241
242
243 class ConfigurationUpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition(
244 TypedDict,
245 ):
246 type: Literal["decreasing_item_amount", "shortening_interval"]
247 """
248 The type of condition.
249 """
250
251
252 class ConfigurationUpdateParamsLoginPage(TypedDict):
253 enabled: bool
254 """
255 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.
256
257 Set to `false` to deactivate the `login_page.url`.
258 """