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
- Cert approved → system builds invoice from SOW Lines
- Line Items — Each SOW Line becomes an invoice line: As-Built Quantity × Base Rate × Rate Multiplier
- Production Days — Auto-calculated from field data, added as PRD-DAY at $600/day
- Admin Fees — Emergency Service (400) when flagged
- Create in Stripe — API call with project metadata
- Payment Tracking — Stripe webhooks → status updates
Rate Calculation
| Factor | Rule |
|---|---|
| Base Rate | Per-unit (600) or flat rate from Products table |
| Post-Production Multiplier | 2× 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
| Field | Source |
|---|---|
| Stripe Customer ID | Stored on Accounts table |
| Stripe Product IDs | Stored on Products table (prod_XXX) |
| Stripe Invoice ID | Written back to Projects + Cert Packages |
| Payment Status | Updated via webhooks |
| Invoice Amount | Calculated 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:
| Script | Purpose |
|---|---|
| stripe-customer-import.js | Import customer records from Accounts into Stripe |
| stripe-product-setup.js | Create Stripe product and price entries from Products table |