1. Connect Stripe
Link your existing Stripe account to BillStack by providing your API keys
What Happens When You Connect
When you connect a Stripe account to your BillStack team:
- Your Stripe secret key, publishable key, and webhook secret are encrypted with AES-256-GCM and stored in the database
- BillStack creates an isolated PostgreSQL schema for your team (
stripe_team_{teamId}) - The stripe-sync-engine runs migrations inside that schema to hold synced Stripe data
- BillStack verifies the keys are valid by calling
stripe.accounts.retrieve()
Option A: Dashboard UI
- Log in to your BillStack dashboard
- Navigate to Team Settings > Stripe Connection
- Paste your Secret Key (
sk_live_...orsk_test_...) - Paste your Publishable Key (
pk_live_...orpk_test_...) - Paste your Webhook Secret (
whsec_...) — you'll update this in Step 5 - Click Connect
Option B: API
curl -X POST https://your-billstack.com/api/billstack/teams/{teamId}/stripe/connect \
-H "Content-Type: application/json" \
-H "Cookie: <session-cookie>" \
-d '{
"secretKey": "sk_test_...",
"publishableKey": "pk_test_...",
"webhookSecret": "whsec_..."
}'Response:
{
"success": true,
"webhookUrl": "https://your-billstack.com/api/webhooks/stripe/{teamId}",
"syncStatus": "pending"
}Verify the Connection
After connecting, check the status:
curl https://your-billstack.com/api/billstack/teams/{teamId}/stripe/status \
-H "Cookie: <session-cookie>"Response:
{
"connected": true,
"isActive": true,
"syncStatus": "ready",
"schemaExists": true,
"accountName": "My SaaS Inc.",
"keyValid": true
}Getting Your Stripe Keys
If you don't have your keys handy:
| Key | Where to Find |
|---|---|
| Secret Key | Stripe Dashboard > Developers > API keys |
| Publishable Key | Same page as above |
| Webhook Secret | You'll create this in Step 5: Update Webhooks |
For initial setup, you can use a placeholder webhook secret and update it later when you configure the webhook endpoint in Stripe.
Test vs Live Mode
Use test mode keys (sk_test_...) during migration to avoid affecting real customers. Switch to live keys once you've verified everything works:
- Connect with test keys first
- Complete all migration steps
- Disconnect:
DELETE /api/billstack/teams/{teamId}/stripe/disconnect - Reconnect with live keys
Warning: Disconnecting drops the team's synced data schema. This is safe because BillStack will re-sync everything from Stripe when you reconnect and backfill.
Next Step
Once connected, create API keys so your SaaS applications can authenticate with BillStack.