Skip to content

BillingHub: handle comped accounts gracefully #1542

@AutumnsGrove

Description

@AutumnsGrove

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

  1. Be a comped account (e.g., admin/dev with Evergreen plan, no Stripe subscription)
  2. Go to /arbor/account
  3. Click the settings cog on GardenStatus → redirects to billing.grove.place/portal
  4. 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

  • Portal page shows a helpful message for comped accounts instead of 502
  • Cancel page handles comped accounts (no subscription to cancel)
  • Resume page handles comped accounts similarly

Metadata

Metadata

Assignees

No one assigned

    Labels

    arborBackend API and admin servicesbugSomething isn't workingplantPricing, billing, and storefront

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions