ArchitectureHow we build it
Shopify webhooks (customers/create, orders/create, checkouts/create) into the HubSpot API v3. We match on the primary email to prevent duplicates, and write custom HubSpot properties for calculated LTV, last order and repeat status. For abandoned carts we use checkouts/create plus timeout logic: a checkout that isn't completed within X hours triggers recovery. GDPR compliant throughout — we only move data with explicit consent captured in Shopify.
flow.ts
webhook shopify.checkouts/create
→ queue.enqueue(jobId)
→ worker.handle() // idempotent, matched by email
→ hubspot.contacts.upsert() // retries with backoff
→ log.emit({ status: 'ok' })