Stripe Integration
Handle subscription billing, payment processing, and usage-based metering for your PROIGN tenants through Stripe.
Overview
Stripe powers all billing and payment operations in PROIGN:
- Subscription Management — Monthly/annual plan billing for Starter, Professional, and Enterprise tiers
- Usage-Based Billing — Metered billing for modules like Shipping Check that charge per API call
- Payment Processing — Credit card and ACH payment collection via Stripe Elements
- Rewards Payouts — Dealer reward redemption processing through Stripe Connect (where applicable)
How It Works
Stripe is configured at the platform level — tenants interact with billing through PROIGN's UI, never directly with Stripe:
- Tenant selects a plan during registration or from the billing settings page
- PROIGN creates a Stripe Customer and Subscription via the API
- Payment is collected through Stripe Elements embedded in the registration flow
- Stripe sends webhooks for payment success, failure, and subscription changes
- PROIGN updates the tenant's active modules and plan tier accordingly
Subscription Plans
| Plan | Billing | Features |
|---|---|---|
| Starter | $25/mo or $270/yr | 1 module, single user, email support |
| Professional | $75/mo or $810/yr | 4 modules, 10 users, priority support, custom domain |
| Enterprise | Custom | All modules, unlimited users, SLA, dedicated support |
Webhook Events
PROIGN listens for these Stripe webhook events:
| Event | Action |
|---|---|
checkout.session.completed | Activate tenant subscription |
invoice.payment_succeeded | Record payment, extend billing period |
invoice.payment_failed | Notify tenant, enter grace period |
customer.subscription.updated | Update plan tier and enabled modules |
customer.subscription.deleted | Deactivate tenant after grace period |
Usage-Based Billing
Some modules use metered billing in addition to the base subscription. Usage is reported to Stripe and billed at the end of each billing period:
| Module | Meter | Rate |
|---|---|---|
| Shipping Check | API calls per month | Included in plan allowance, then per-call |
| Campaign | Emails/SMS sent | Based on plan tier limits |
| QR | QR codes generated | Based on plan tier limits |
Usage is tracked internally and reported to Stripe via meter events at the end of each billing cycle. Tenants can view current usage from their billing settings page.
Customer Portal
Tenants can manage their subscription through the Stripe Customer Portal:
- Update Payment Method — Change credit card or switch to ACH
- View Invoices — Download past invoices and receipts
- Change Plan — Upgrade or downgrade subscription tier
- Cancel Subscription — Self-service cancellation with confirmation
The portal is accessed via POST /api/billing/portal-session which creates a temporary Stripe portal URL and redirects the tenant.
Grace Period & Dunning
When a payment fails, PROIGN handles recovery automatically:
- Day 0 — Payment fails, Stripe retries automatically (up to 3 attempts over 2 weeks)
- Day 1 — Tenant owner receives email notification with a link to update payment
- Day 7 — Second reminder email sent
- Day 14 — Final warning — tenant will be deactivated if payment is not resolved
- Day 21 — Subscription canceled, tenant modules disabled (data preserved for 90 days)
Security
- All Stripe webhook payloads are verified using the webhook signing secret
- No credit card numbers are stored in PROIGN — all payment data stays in Stripe
- API keys are stored as Cloudflare Worker secrets, never in source code
- Stripe Elements handles PCI compliance for payment collection
- Customer portal sessions are temporary (expires after 5 minutes of inactivity)