New tenants are created with an empty stripe_customer_id in the identity onboarding path #2

Closed
opened 2026-04-11 08:15:42 +00:00 by userAdityaa · 0 comments
Contributor

Problem

Because billing and invoice ownership flows map Stripe invoice customer -> tenant via stripe_customer_id, this can break billing ownership resolution and produce ambiguous behavior.

Validation SQL Used

sqlite3 data/caravel.db "SELECT COUNT(*) AS total, SUM(CASE WHEN stripe_customer_id = '' THEN 1 ELSE 0 END) AS empty_customer_id FROM tenant; SELECT pubkey, stripe_customer_id FROM tenant LIMIT 10;"

Expected Behaviour

Each newly onboarded tenant should have a valid Stripe customer ID (for example cus_...) created at onboarding and persisted in DB.

Actual Behaviour

Tenant is created with empty stripe_customer_id, making invoice/webhook ownership mapping unreliable.

### Problem Because billing and invoice ownership flows map Stripe invoice customer -> tenant via stripe_customer_id, this can break billing ownership resolution and produce ambiguous behavior. ### Validation SQL Used ```sql sqlite3 data/caravel.db "SELECT COUNT(*) AS total, SUM(CASE WHEN stripe_customer_id = '' THEN 1 ELSE 0 END) AS empty_customer_id FROM tenant; SELECT pubkey, stripe_customer_id FROM tenant LIMIT 10;" ``` ### Expected Behaviour Each newly onboarded tenant should have a valid Stripe customer ID (for example cus_...) created at onboarding and persisted in DB. ### Actual Behaviour Tenant is created with empty `stripe_customer_id`, making invoice/webhook ownership mapping unreliable.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/caravel#2