Summary
Comped accounts (oak/evergreen with no Stripe customer) get a BILLING-040 error when redirected to the BillingHub portal or cancel pages. The portal page (billing.grove.place/portal) calls proxyToBillingApi("/portal") which fails because there's no Stripe customer record to create a portal session for.
Steps to Reproduce
- Be a comped account (e.g., admin/dev with Evergreen plan, no Stripe subscription)
- Go to
/arbor/account
- Click the settings cog on GardenStatus → redirects to
billing.grove.place/portal
- See: 502 error with code BILLING-040 "Could not open the billing portal"
Same for clicking Cancel Membership → billing.grove.place/cancel.
Expected Behavior
BillingHub should detect comped accounts and show a friendly message like "Your account is complimentary — no billing to manage" instead of crashing.
Current Workaround
Cancel/Resume buttons are hidden for comped accounts on the Account page (bb4481f07). But the settings cog and nurture CTA still redirect to BillingHub which errors.
Files to Investigate
apps/billing/src/routes/portal/+page.server.ts — portal session creation (line 42-57)
apps/billing/src/routes/cancel/+page.svelte — cancel flow
apps/billing/src/lib/billing-proxy.ts — API proxy
Acceptance Criteria
Summary
Comped accounts (oak/evergreen with no Stripe customer) get a BILLING-040 error when redirected to the BillingHub portal or cancel pages. The portal page (
billing.grove.place/portal) callsproxyToBillingApi("/portal")which fails because there's no Stripe customer record to create a portal session for.Steps to Reproduce
/arbor/accountbilling.grove.place/portalSame for clicking Cancel Membership →
billing.grove.place/cancel.Expected Behavior
BillingHub should detect comped accounts and show a friendly message like "Your account is complimentary — no billing to manage" instead of crashing.
Current Workaround
Cancel/Resume buttons are hidden for comped accounts on the Account page (
bb4481f07). But the settings cog and nurture CTA still redirect to BillingHub which errors.Files to Investigate
apps/billing/src/routes/portal/+page.server.ts— portal session creation (line 42-57)apps/billing/src/routes/cancel/+page.svelte— cancel flowapps/billing/src/lib/billing-proxy.ts— API proxyAcceptance Criteria