BillingPortalConfiguration
Source:
src/Stripe/BillingPortalConfiguration.ts
A Stripe Customer Portal configuration — the features, branding, and
return URL used when creating portal sessions. features is required
on create. Name, metadata, business profile, login page, return URL,
features, and active update in place. Stripe does not hard-delete
portal configurations; destroying this resource deactivates it
(active: false).
Creating a Configuration
Section titled “Creating a Configuration”Invoice history only
const portal = yield* Stripe.BillingPortalConfiguration("customer-portal", { name: "Customer portal", features: { invoiceHistory: { enabled: true }, },});Customer updates and payment methods
const portal = yield* Stripe.BillingPortalConfiguration("customer-portal", { name: "Customer portal", defaultReturnUrl: "https://example.com/account", features: { invoiceHistory: { enabled: true }, customerUpdate: { enabled: true, allowedUpdates: ["email", "address"], }, paymentMethodUpdate: { enabled: true }, }, metadata: { env: "prod" },});Updating a Configuration
Section titled “Updating a Configuration”const portal = yield* Stripe.BillingPortalConfiguration("customer-portal", { name: "Customer portal (updated)", features: { invoiceHistory: { enabled: true }, subscriptionCancel: { enabled: true, mode: "at_period_end" }, }, metadata: { env: "prod", revision: "2" },});Deactivating a Configuration
Section titled “Deactivating a Configuration”// stack.destroy() / resource removal sets active: falseconst portal = yield* Stripe.BillingPortalConfiguration("customer-portal", { features: { invoiceHistory: { enabled: true } },});