Nuda Kit integrates Stripe Customer Portal to allow users to manage their subscriptions, payment methods, and billing information without you building custom UI.
The Customer Portal provides:
Subscription Management
Payment Methods
Billing History
Hosted by Stripe
User clicks "Manage Subscription"
│
▼
┌─────────────────────────┐
│ POST /billing/ │
│ create-portal │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Create Stripe Customer │ ◀── Only if not exists
│ (if needed) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Create Portal Session │ ◀── Stripe API
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Return Portal URL │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Redirect to Stripe │ ◀── User manages subscription
│ Customer Portal │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Return to App │ ◀── /settings/billing
└─────────────────────────┘
| Method | Endpoint | Description |
|---|---|---|
POST | /billing/create-portal | Creates a portal session |
Response:
{
"message": "portal created",
"data": {
"portalUrl": "https://billing.stripe.com/p/session/..."
}
}
/settings/billingWhen users access the Customer Portal, they can:
| Feature | Description |
|---|---|
| View Subscription | See current plan and billing cycle |
| Switch Plans | Upgrade or downgrade (if configured) |
| Cancel Subscription | End subscription with optional feedback |
| Update Payment | Add or change credit card |
| Download Invoices | Access billing history |
| Update Address | Change billing information |
Configure the Customer Portal in your Stripe Dashboard:
| Setting | Recommended |
|---|---|
| Allow customers to update subscriptions | ✅ Enable |
| Allow customers to cancel subscriptions | ✅ Enable |
| Allow customers to update payment methods | ✅ Enable |
| Allow customers to view invoice history | ✅ Enable |
| Feature | Description |
|---|---|
| User Isolation | Users can only access their own portal |
| Session Expiration | Portal sessions expire after ~5 minutes |
| PCI Compliance | All payment data handled by Stripe |
| No Sensitive Data | Only portal URL returned to frontend |
After users finish in the portal, they're automatically redirected back to:
/settings/billing
This can be customized in the StripeService configuration.
| Environment | Notes |
|---|---|
| Test Mode | Use test cards (4242 4242 4242 4242) |
| Stripe CLI | Forward webhooks during local testing |
| Portal Preview | Test in Stripe Dashboard before production |