/
Sessions.d.ts
191 lines (168 loc) · 5.6 KB
/
Sessions.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
namespace BillingPortal {
/**
* The Billing customer portal is a Stripe-hosted UI for subscription and
* billing management.
*
* A portal configuration describes the functionality and features that you
* want to provide to your customers through the portal.
*
* A portal session describes the instantiation of the customer portal for
* a particular customer. By visiting the session's URL, the customer
* can manage their subscriptions and billing details. For security reasons,
* sessions are short-lived and will expire if the customer does not visit the URL.
* Create sessions on-demand when customers intend to manage their subscriptions
* and billing details.
*
* Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal).
*/
interface Session {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing_portal.session';
/**
* The configuration used by this session, describing the features available.
*/
configuration: string | Stripe.BillingPortal.Configuration;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* The ID of the customer for this session.
*/
customer: string;
/**
* Information about a specific flow for the customer to go through.
*/
flow: Session.Flow | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used.
*/
locale: Session.Locale | null;
/**
* The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays.
*/
on_behalf_of: string | null;
/**
* The URL to redirect customers to when they click on the portal's link to return to your website.
*/
return_url: string | null;
/**
* The short-lived URL of the session that gives customers access to the customer portal.
*/
url: string;
}
namespace Session {
interface Flow {
after_completion: Flow.AfterCompletion;
/**
* Configuration when `flow.type=subscription_cancel`.
*/
subscription_cancel: Flow.SubscriptionCancel | null;
/**
* Type of flow that the customer will go through.
*/
type: Flow.Type;
}
namespace Flow {
interface AfterCompletion {
/**
* Configuration when `after_completion.type=hosted_confirmation`.
*/
hosted_confirmation: AfterCompletion.HostedConfirmation | null;
/**
* Configuration when `after_completion.type=redirect`.
*/
redirect: AfterCompletion.Redirect | null;
/**
* The specified type of behavior after the flow is completed.
*/
type: AfterCompletion.Type;
}
namespace AfterCompletion {
interface HostedConfirmation {
/**
* A custom message to display to the customer after the flow is completed.
*/
custom_message: string | null;
}
interface Redirect {
/**
* The URL the customer will be redirected to after the flow is completed.
*/
return_url: string;
}
type Type = 'hosted_confirmation' | 'portal_homepage' | 'redirect';
}
interface SubscriptionCancel {
/**
* The ID of the subscription to be canceled.
*/
subscription: string;
}
type Type = 'payment_method_update' | 'subscription_cancel';
}
type Locale =
| 'auto'
| 'bg'
| 'cs'
| 'da'
| 'de'
| 'el'
| 'en'
| 'en-AU'
| 'en-CA'
| 'en-GB'
| 'en-IE'
| 'en-IN'
| 'en-NZ'
| 'en-SG'
| 'es'
| 'es-419'
| 'et'
| 'fi'
| 'fil'
| 'fr'
| 'fr-CA'
| 'hr'
| 'hu'
| 'id'
| 'it'
| 'ja'
| 'ko'
| 'lt'
| 'lv'
| 'ms'
| 'mt'
| 'nb'
| 'nl'
| 'pl'
| 'pt'
| 'pt-BR'
| 'ro'
| 'ru'
| 'sk'
| 'sl'
| 'sv'
| 'th'
| 'tr'
| 'vi'
| 'zh'
| 'zh-HK'
| 'zh-TW';
}
}
}
}