Guides · Integrations
How to scope an API integration before you write code
Writing the first request is the easy part. The expensive part is discovering, mid-build, that the two systems disagree about what a customer is, or that the "API" is a nightly file drop, or that someone still has to approve the write in another tool.
This is the order I use before anyone opens an editor. It is a method, not a case study, and it does not depend on a particular vendor.
The point
If you cannot describe the job, the system of record, the events, the writes and the go-live checks on one page, you are not ready to write code.
Why scope first
Integrations fail in the gaps: mismatched IDs, a field both sides can edit, a retry that creates a second invoice, an error that only shows up in a log no one reads. Those are scope problems. They are cheaper to catch when the document is still a page of notes.
1. Name the job, not the systems
Write one sentence in this shape: "When X happens, Y should be true in system B." If you cannot say that without naming a vendor, you are still talking about tools, not the job.
Examples of a job, not a tool list:
- When a quote is approved, the customer should have a matching order in the system of record.
- When a shipment is delivered, the invoice should be ready to send.
- When a new ticket arrives, the right team should already have the account context.
2. Find the system of record
For each important field — customer, price, inventory, status — write down which system is allowed to win. If two systems can both edit the same record, decide the rule before you sync, or you will spend the go-live week chasing flips.
Example conflict
A deal is approved in the CRM and pushed to the ERP. Later, a team member edits the price in the ERP because of a manual discount policy that only lives in email. The CRM now has the old price. Which one wins on the next sync?
The system of record is not always the newer tool. It is the one that knows the truth for that field.
3. Map the events and the data you care about
List every event that triggers the integration, what data comes with it, and whether the event is real-time, polling, or a webhook that might arrive twice.
For each event:
- Event name and trigger: "Order placed", "ticket updated", "shipment confirmed"
- Source system: which tool emits it
- Delivery: webhook, polling, file drop, manual export
- Payload: which fields you need and which ones are guaranteed to be there
- Duplicates: can the same event arrive more than once?
If the "API" is actually a nightly file on an SFTP server, write that down now, not after you have already built the webhook handler.
4. Write down the auth and failure plan
Authentication breaks in production. The token expires, the IP whitelist was never updated, or the test credentials were pasted into the prod config. Write down:
- Auth method: OAuth, API key, basic auth, cert, or "email Greg for the password"
- Who owns the credential: which team, which person, which 1Password vault
- Expiration and rotation: does it expire? Who gets the alert?
- Test vs prod: are they separate? How do you tell?
- Failure mode: if auth fails, do requests return 401, or do they silently succeed with partial data?
The worst integrations are the ones where a failure looks like success until someone audits last month's invoices.
5. Map the write path
For every write — creating a record, updating a field, deleting a resource — document:
- Target system and endpoint
- Required fields: what must be present for the write to succeed?
- Idempotency: if you send the same request twice, do you get two invoices or one?
- Approval or workflow: does a human have to click something before the write is real?
- Errors you can retry vs. errors that need a human
If you don't know whether a 500 error means "try again" or "the customer record is invalid and will never work," ask now.
6. Write the go-live checks
You know the integration is live when you can look at a screen and confirm the data moved. Write down, before you deploy:
- The test transaction: "Create order #TEST-001 in CRM"
- Where to look: "Open ERP → Sales Orders → filter for today"
- What you expect to see: "Order #TEST-001 with correct customer, line items, and total"
- Who verifies: which person on the customer's team will confirm it
- Rollback plan: if it's wrong, what gets turned off and in what order?
The go-live check is the sentence you will say on the kickoff call: "Let's create an order in the CRM and watch it appear in the ERP within 2 minutes."
A scope outline
Here's the one-page outline that comes out of this process. If you can't fill it in, you're not done scoping.
JOB: When [event], [system B] should [outcome].
SYSTEM OF RECORD:
- Customer: [System A]
- Price: [System B]
- Inventory: [System A]
- Order status: [System B]
EVENTS:
1. Order placed (System A)
- Delivery: Webhook, real-time
- Payload: customer_id, line_items[], total
- Duplicates: Possible (use idempotency key)
2. Shipment confirmed (System B)
- Delivery: Polling every 5 min
- Payload: order_id, tracking_number, carrier
- Duplicates: No
WRITES:
1. Create customer in System B
- Endpoint: POST /customers
- Required: name, email
- Idempotent: Yes (upsert by email)
- Approval: None
2. Create order in System B
- Endpoint: POST /orders
- Required: customer_id, line_items[]
- Idempotent: Yes (use external_id)
- Approval: Auto-approved under $10k, else manual
AUTH:
- Method: OAuth 2.0
- Owner: Ops team, 1Password vault "Integrations"
- Expiration: Token refreshes automatically
- Test/prod: Separate apps, different client_id
- Failure: Returns 401, no partial data
GO-LIVE CHECK:
1. Create order #TEST-001 in System A
2. Look: System B → Orders → Today
3. Expect: Order #TEST-001, correct customer, total
4. Verifier: Sarah (Ops lead)
5. Rollback: Disable webhook in System A admin
That's the doc. When you can fill in every line, you're ready to write code. If you can't, the missing answers are cheaper to find now than in the go-live Slack thread.
Want help with yours?
30 minutes on video. Bring your integration, agent idea, or career question. You'll leave with a next step.
Book a 30-min call →