Complete technical documentation for the JB360 ServiceTitan integration — the system connecting HVAC dealers’ Field Service Management Systems (FSMs) — ServiceTitan, Workiz — to the JB Warranties platform.
Sources: static analysis of jbandassociates/st-integrationmain @ 1ce5b3e (“Terms of use, Renewal fixes and July stability release changes”), a live read-only verification of AWS account 660537473428, and a read-only inspection of the production database — July 2026, refreshed 2026-07-17. See analysis-process.md for method, trust boundaries, and the corrections log.
The mental model: what the system does, architecture diagram, the five end-to-end flows (onboarding, matching, agreement creation, per-tenant sync, claims), environments, cross-cutting concerns
The ServiceTitan contract: app registration (“JB-360” v5) + scopes, per-tenant OAuth model, full endpoint inventory, what gets written into ST, onboarding requirements, sync cadence, pitfalls
The Workiz contract: shared static API token, the endpoints in repo code, job→invoice pull and write-back push, onboarding via Account ID, the untemplated prod pull/push Lambdas, known gaps and bugs
Security/maintenance items discovered during documentation (details in the linked docs):
Hardcoded secrets — ST app key + JBW API token in jbw-sam/template.yaml & samconfig.toml; Workiz token in handler source; AES key in jbwui/src/utils/encryption.js; plaintext dev DB creds in extraction/src/main/resources/application.yml (03, 04, 02)
Template drift — CloudFormation untouched since May 2024; 40 prod Lambdas outside the template, ~12 with no source in the repo; a plain sam deploy would revert live changes (aws/lambda-inventory.md)
Auth attached out-of-band — the template deploys API Gateway open; jbwapiauthorizerupdate must run post-deploy (currently attached, verified) (03, aws/apis-auth-hosting.md)
String-interpolated SQL in jbw-sam handlers and extraction outbound updates (03, 02)