Course B · Module B1 Production · Lesson 3 of 18
Pull in and sync data from the other systems your business already runs on — so nothing lives in a silo.
Your new app doesn't live in isolation. Your business already runs on a CRM, a payment processor, a spreadsheet, an email platform — and your customers expect everything to stay in sync. Manually copying data between systems is how errors creep in and hours disappear. Your single win today: by the end you'll understand the three main ways data moves between apps, and know which one to reach for at each stage of your build.
In Course A you met the idea of an API — the "waiter" that carries requests between your app and another service. Let's make it concrete.
Every serious software service — Stripe, HubSpot, Google Sheets, Mailchimp — has a set of doors in its back wall. Each door is labeled: "get all customers," "create an invoice," "update a contact." You knock on a door by sending an HTTP request with the right address and a key that proves you're allowed in. The service opens the door and hands you back data (or confirms it did the thing).
Those doors, taken together, are the API. You don't need to know how the service works inside — just which door to knock on and what it will hand you back.
When your app calls Stripe to charge a card, it's knocking on Stripe's "create charge" door. When it calls your CRM to log a new contact, it's knocking on a "create contact" door. The AI can write all of this code for you — you just need to know which service you want to talk to and what you want it to do.
Start with CSV import when you're just moving a one-off dataset. Move to scheduled sync when you need regular freshness. Use webhooks when you need to react immediately — a payment confirmation, a signup, a cancellation.
Before building any integration, decide the direction of truth:
Data flows in one direction only. Your CRM is the source of truth; your app reads from it but never writes back. Simple, predictable, easy to debug. Start here whenever possible.
Both systems can change the data and must stay in agreement. Powerful but far harder: what happens when both sides change the same record at the same time? That's a conflict, and you need a rule to resolve it. Only build this when the business genuinely needs it.
Two things go wrong most often in integrations: data goes stale (the sync breaks silently and nobody notices) and records get duplicated (the sync runs twice and writes the same row twice).
Answer before opening — recalling it is what makes it stick.
Webhook. "The moment it happens" is the definition of event-driven. A scheduled sync would introduce a delay (up to an hour if the sync runs hourly). A webhook fires in real time — Stripe calls your app immediately when the payment completes.
An upsert check — checking whether the record's unique ID already exists before writing. Without this, each sync run creates new rows instead of updating existing ones. The fix: before inserting, look up the order's Stripe ID; if it's already there, update the row instead of adding a new one.
Conflicts — two systems changing the same record simultaneously with no agreed rule for which one wins. One-way sync has a single source of truth, so the direction of authority is always clear. Two-way syncs require a conflict-resolution strategy and are significantly harder to debug.
Read this next (primary source)
An Overview of HTTP — MDN Web Docs. The plain-English primer on how data moves across the web — the foundation that every API call, webhook, and sync relies on. ~12 min. See RESOURCES.md for more.
New terms from this lesson — API, webhook, sync, upsert — are in the course glossary. Keep it open as you go.