Debian Codegraph @

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