Skip to main content

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:

  1. Tenant selects a plan during registration or from the billing settings page
  2. PROIGN creates a Stripe Customer and Subscription via the API
  3. Payment is collected through Stripe Elements embedded in the registration flow
  4. Stripe sends webhooks for payment success, failure, and subscription changes
  5. PROIGN updates the tenant's active modules and plan tier accordingly

Subscription Plans

PlanBillingFeatures
Starter$25/mo or $270/yr1 module, single user, email support
Professional$75/mo or $810/yr4 modules, 10 users, priority support, custom domain
EnterpriseCustomAll modules, unlimited users, SLA, dedicated support

Webhook Events

PROIGN listens for these Stripe webhook events:

EventAction
checkout.session.completedActivate tenant subscription
invoice.payment_succeededRecord payment, extend billing period
invoice.payment_failedNotify tenant, enter grace period
customer.subscription.updatedUpdate plan tier and enabled modules
customer.subscription.deletedDeactivate 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:

ModuleMeterRate
Shipping CheckAPI calls per monthIncluded in plan allowance, then per-call
CampaignEmails/SMS sentBased on plan tier limits
QRQR codes generatedBased 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:

  1. Day 0 — Payment fails, Stripe retries automatically (up to 3 attempts over 2 weeks)
  2. Day 1 — Tenant owner receives email notification with a link to update payment
  3. Day 7 — Second reminder email sent
  4. Day 14 — Final warning — tenant will be deactivated if payment is not resolved
  5. 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)

Related