Wasup v3 Control Plane

Organizations, isolated workers, regional proxies, and fleet health.
DocsDashboard
Paid provisioning docs

Sell WhatsApp instances, then provision only what was paid for.

The control plane uses Stripe as the billing source of truth, Supabase as the entitlement cache, Clerk for user and organization identity, and Azure workers for isolated WhatsApp runtime.

Billing gate is implementedProvisioning now requires an active paid entitlement with free instance capacity.

How The Flow Works

From payment to Azure worker desired state.

1
Customer pays

Clerk identifies the org, then Stripe Checkout sells instance seats and optional recurring message credits.

2
Stripe syncs

Stripe webhooks update Supabase billing_entitlements with subscription status, slot limit, period, and credits.

3
Provision request arrives

The API atomically reserves one available paid instance slot before creating a desired instance row.

4
Proxy is allocated

Provisioner uses provider API or imported pool, then stores proxy secrets in Azure Key Vault.

5
Worker deploys

Azure AKS or Container Apps worker owns the WhatsApp socket, pairing, webhook config, and runtime events.

6
Usage is metered

Workers report sent/received/seen/webhook events with idempotency keys, and message credits are debited.

What I Need From You

These are the concrete inputs needed before real deployment.

SupabaseProject URL, service-role key, database password access for migrations, and confirmation that this control plane can own the Wasup v3 schema.
ClerkPublishable key, secret key, org/user setup decision, webhook signing secret later, and which Clerk org role maps to owner/admin/operator/viewer.
StripeSecret key, webhook secret, live vs test mode, currency, per-instance monthly price, credit pack size/price, and business billing details.
AzureSubscription ID, tenant ID, resource group, AKS or Container Apps choice, Key Vault name, region list, and service principal credentials.
Proxy ProviderProvider name, whether they have an API, region coverage, auth method, pricing/limits, or an uploaded CSV/TXT proxy pool if manual.
Product RulesHow many message credits each sent/received/seen event costs, whether trials are allowed, overage behavior, and suspension grace period.

Recommended Stripe Catalog

Simple pricing model that maps cleanly to entitlement checks.

Wasup WhatsApp Instance Seat: 1 recurring seat = 1 provisionable instanceWasup Message Credits: recurring pack, e.g. 1,000 credits per quantityMetadata: wasupEntitlement=instance | message_creditsRun: STRIPE_SECRET_KEY=... npm run stripe:products

API Surface

The endpoints currently implemented for billing, provisioning, and metering.

MethodPathPurpose
POST/api/v3/billing/checkoutCreates a Stripe Checkout session for instance seats and optional message credits.
GET/api/v3/billing/entitlementsReturns paid slots, active instances, billing status, and credit balance.
POST/api/v3/provision/instancesReserves one paid slot and creates desired worker state. Returns 402 if unpaid or full.
POST/api/webhooks/stripeReceives subscription events and syncs entitlement state from Stripe.
POST/api/internal/usage-eventsWorkers report sent, received, seen, and webhook usage with idempotency keys.

Proxy Decision

Best path depends on the provider.

Provider APIBest if available. The provisioner leases a region-specific sticky proxy per paid instance.
Imported PoolWorks now. Upload proxies to Supabase/Key Vault, then assign free rows from proxy_allocations.
HybridUse provider API first, then fall back to manual uploaded stock when the provider has no capacity.

Still To Build

The entitlement gate exists; these are the next production pieces.

Azure provisionerReconciles desired instances into AKS/Container Apps workers and writes status back.
Clerk sync webhooksKeeps organizations and members mirrored into Supabase for strict tenant isolation.
Customer UI formsCheckout, instance wizard, webhook settings, QR/pairing, billing state, and usage charts.