diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ec25eb3028..eaf5acec6b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v211 \ No newline at end of file +v212 \ No newline at end of file diff --git a/types/BillingPortal/Sessions.d.ts b/types/BillingPortal/Sessions.d.ts index a0e9a767b0..b2f72d0170 100644 --- a/types/BillingPortal/Sessions.d.ts +++ b/types/BillingPortal/Sessions.d.ts @@ -45,6 +45,11 @@ declare module 'stripe' { */ 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. */ @@ -72,6 +77,66 @@ declare module 'stripe' { } 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' diff --git a/types/BillingPortal/SessionsResource.d.ts b/types/BillingPortal/SessionsResource.d.ts index 10b8bf8042..4fa9916d3f 100644 --- a/types/BillingPortal/SessionsResource.d.ts +++ b/types/BillingPortal/SessionsResource.d.ts @@ -19,6 +19,11 @@ declare module 'stripe' { */ expand?: Array; + /** + * Information about a specific flow for the customer to go through. + */ + flow_data?: SessionCreateParams.FlowData; + /** * 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. */ @@ -36,6 +41,69 @@ declare module 'stripe' { } namespace SessionCreateParams { + interface FlowData { + /** + * Behavior after the flow is completed. + */ + after_completion?: FlowData.AfterCompletion; + + /** + * Configuration when `flow_data.type=subscription_cancel`. + */ + subscription_cancel?: FlowData.SubscriptionCancel; + + /** + * Type of flow that the customer will go through. + */ + type: FlowData.Type; + } + + namespace FlowData { + interface AfterCompletion { + /** + * Configuration when `after_completion.type=hosted_confirmation`. + */ + hosted_confirmation?: AfterCompletion.HostedConfirmation; + + /** + * Configuration when `after_completion.type=redirect`. + */ + redirect?: AfterCompletion.Redirect; + + /** + * The specified 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; + } + + 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'