Problem
A California organics recycler supplies compost and mulch to residents on behalf of cities and counties. Each jurisdiction funds material for its own residents, who order through the company's online storefront with a jurisdiction-specific program code. Every order therefore carries the same question: is this address inside the jurisdiction that is paying?
Neither the ZIP code nor the city a customer types answers it. The storefront could restrict an offer only by ZIP code, the usual e-commerce approach, but a ZIP code is a mail delivery route, not a jurisdiction. One ZIP code can span two cities, or a city and the unincorporated county around it, and postal city names cross municipal lines in the same way. County programs cover only the unincorporated part of a county. Eligibility could be settled only by placing the specific street address inside the tax-district boundaries that define each jurisdiction.
Before the platform, the storefront accepted every order. A team then sat together and checked each one by hand against the jurisdiction's own website, and accounts staff telephoned the customers whose orders could not be honored. Fulfilment was manual as well: staff read each order email, chose an instruction template by quantity, copied the program liaison, forwarded deliveries to scheduling, and compiled the weekly schedule by hand. Order history lived in email threads and a shared spreadsheet.
Provenance. The platform was built and is operated by Rick Wilson for the recycler, and is shown anonymized with its permission. It is an operating system inside that business, not a consulting engagement.
The platform had to decide eligibility at checkout from the address itself, route each order to the correct fulfilment path without staff handling, and leave a record that accountants can bill jurisdictions from.
Architecture
Three independently deployed services carry an order from checkout to the reporting record:
from the storefront
boundary data, apply rules
into a structured record
instructions sent
reports and exports
Eligibility at checkout
The storefront calls the validation service with the customer's address and program code. The service geocodes the address and locates the point inside California's published tax-district boundaries, which resolve city, county, and unincorporated status. A code must exist, be active, and be within its dates. A city code requires the address to fall inside that city. A county code is valid only in the unincorporated area of that county. A small set of codes carries no address restriction. The storefront receives an accepted or denied response with the reason. The storefront's own rules stop at the ZIP code, so this decision is made by a service the checkout calls while the customer waits.
Because it sits in the checkout path, this service is kept always on and is changed rarely. The boundary file is refreshed from the state's open-data service by a weekly job.
Order intake and routing
The storefront emails each order to a shared mailbox. A workflow trigger posts the message to the dispatch service, which parses customer, addresses, line items, shipping method, financial totals, and comments into one structured record. Routing then follows explicit rules:
| Path | Rule |
|---|---|
| Delivery | Shipping option reads as delivery. Customer receives delivery instructions; the scheduling team receives an alert and a row in the shared delivery log. |
| Self-load pickup | Pickup with every material under five cubic yards. |
| Crew-load pickup | Pickup with a single material at five cubic yards or more. |
| Special order | A large quantity of one material combined with other materials. Customer receives a review-in-progress notice. |
| Needs review | Shipping option is unrecognized, or a delivery fee appears on a pickup option. Staff are alerted and nothing is sent to the customer. |
Customer instructions go out from a dedicated system mailbox with the program liaison copied. The service also produces PDF manifests for delivery haulers. Every order is written to an event record with its routing decision and timestamp.
Reporting
A scheduled job sends a weekly activity report: the prior week, a trailing weekly series, program-to-date by jurisdiction, a monthly rollup, and a workbook with order-level detail. A separate read-only service lets accountants search by program code, jurisdiction, and date, open a single order, export to CSV or Excel, and roll up order count, cubic yards, and reimbursement value by jurisdiction.
The reporting record was backfilled from mailbox history to January 2025. By June 2026 it held about 1,455 orders across 11 jurisdictions.
Connected systems
| Component | Technology |
|---|---|
| Storefront | Commercial e-commerce platform; calls validation at checkout and emits order emails |
| Geocoding | ArcGIS |
| Boundary data | California CDTFA tax-district boundaries, bundled as a GeoPackage, refreshed weekly |
| Program rules | Code master workbook in Google Cloud Storage, cached in the service |
| Services | Three Python FastAPI services on Google Cloud Run |
| Event record | Firestore, with daily backups |
| Order intake | Microsoft 365 shared mailbox and Power Automate flows |
| Outbound mail | Microsoft Graph, with send rights restricted to one system mailbox |
| Delivery log | SharePoint Excel workbook, appended by the workflow |
| Scheduling | Cloud Scheduler for the weekly report |
| Secrets | Secret Manager; no service-account keys |
| Delivery pipeline | GitHub Actions with workload identity federation; lint on every push |
Why this architecture
The three services have different risk profiles, so they are deployed separately. Validation sits in the checkout path. Dispatch sits on the live order path, where a bad deploy reaches customers. Reporting is read-only, so reports and exports can change without touching either.
The platform boundary follows operational ownership. The company's Microsoft 365 tenant is administered by an outside IT provider, so the application runs on Google Cloud, where changes do not wait on a vendor ticket. The two platforms meet at three narrow interfaces: a mailbox trigger, a mail-send permission, and a spreadsheet append.
Eligibility and routing are deterministic rules covered by tests. No language model sits in the order path. A wrong answer here sends a customer to the wrong yard or bills the wrong jurisdiction, so each decision has to be explainable from the rule that produced it.
Evidence boundary: code and order counts come from platform records as of June 2026. The time comparison below comes from a process review before launch and is an estimate, not a measurement. Volume is modest, about ten orders a week at program peaks, with an expected peak under fifty. This case shows integration and control, not scale.
Operating change
Ineligible addresses are now declined before the order exists, which removed the review room and the follow-up calls it produced. Every order is recorded with its routing decision, where history once lived in email threads. The weekly activity report is generated on a schedule with order-level detail attached. Orders the rules cannot place still reach a person, by design.