Stripe & Invoicing

Source: Notion — Stripe & Invoicing


Key Rule

Invoice routing is handled in Stripe, not via email. Cert email routing and invoice routing are separate workflows. Cert/invoice PDFs upload via Google Apps Script (base64 POST → real PDF + Drive). Skip Zapier for all binary transfers.


Invoice Generation Flow

  1. Cert approved → system builds invoice from SOW Lines
  2. Line Items — Each SOW Line becomes an invoice line: As-Built Quantity × Base Rate × Rate Multiplier
  3. Production Days — Auto-calculated from field data, added as PRD-DAY at $600/day
  4. Admin Fees — Emergency Service (400) when flagged
  5. Create in Stripe — API call with project metadata
  6. Payment Tracking — Stripe webhooks → status updates

Rate Calculation

FactorRule
Base RatePer-unit (600) or flat rate from Products table
Post-Production Multiplier2× when inspection occurs after installation complete
Production Days$600/day for crew time on site
Emergency Service$400 flat when scheduled <24hr
Missed Appointment$400 flat when site not accessible

Invoice Statuses

Not Invoiced → Invoiced → Sent → Paid / Overdue / Partial

Stripe Integration Points

FieldSource
Stripe Customer IDStored on Accounts table
Stripe Product IDsStored on Products table (prod_XXX)
Stripe Invoice IDWritten back to Projects + Cert Packages
Payment StatusUpdated via webhooks
Invoice AmountCalculated from SOW Lines

Invoice Terms by Account

Configurable per Account: Due on Receipt / Net 15 / Net 30 / Net 45 / Net 60

Delivery Routing

  • Cert Email → Scheduler / Project Coordinator (or Account primary contact)
  • Invoice Email → AP / Accounts Payable (or billing email on Account)
  • Both sent via separate workflows (not combined)

Stripe Setup Scripts

Stored in ~UP Data Sets/~Claude/stripe-setup/ on Google Drive:

ScriptPurpose
stripe-customer-import.jsImport customer records from Accounts into Stripe
stripe-product-setup.jsCreate Stripe product and price entries from Products table