Skip to content

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).

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" },
});
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" },
});
// stack.destroy() / resource removal sets active: false
const portal = yield* Stripe.BillingPortalConfiguration("customer-portal", {
features: { invoiceHistory: { enabled: true } },
});