Rana Maninder Singh
Lesson 1 of 12API & Integration Development

Introduction to APIs and Enterprise Integration

Lesson opener

In one line: An API is a contract one system uses to ask another system for a defined operation and receive a structured reply.

Why it matters: Northline Trading's webshop and its ERP disagree about whether a customer may place an order. A person copies the credit status by hand. The copy is late, and one order ships to a blocked account. An integration removes the retyping only when the request, the reply, and the system of record are named.

Before this lesson: None.

Northline distributes industrial supplies. The ERP holds the customer account. The webshop takes the order. Analytics reads a nightly extract. Today a clerk exports a spreadsheet at 16:00. The webshop still uses yesterday's file at 09:00. Figures in this course are illustrative. They are not a benchmark and not a vendor's product limit.

What you will be able to do

Prerequisites

No programming qualification. You need one place at work where two systems hold the same fact and a person copies it.

What an API is

An API (application programming interface) is the set of operations one program is allowed to call on another. For web APIs in this course, that call is an HTTP request and the reply is an HTTP response. The official meaning of those messages is in RFC 9110 (https://www.rfc-editor.org/rfc/rfc9110).

A request has four parts:

A response has three parts:

Enterprise integration is the work of making two or more business systems exchange those messages so a person does not retype the fact. Typical neighbours are an ERP (orders, stock, suppliers), a CRM (relationships and pipeline), and an analytics store (reports). The API does not decide which system is right. The business names a system of record: the one place allowed to define that fact. Other systems hold a copy.

Teacher walkthrough: credit status before an order

All figures are illustrative.

Northline's ERP is the system of record for "may this account order." The webshop must not invent a second meaning.

  1. The webshop builds a request: GET the account C-1044.
  2. The ERP API replies with status 200 and a body that includes "order_block": true.
  3. The webshop refuses the checkout.
  4. Validation: a second person reads the same account in the ERP screen and sees the same block. If the screen and the API disagree, the API is not yet a faithful copy of the system of record.

The nightly spreadsheet is a copy with a time lag. It is not the system of record.

A second workplace case

A CRM holds the salesperson's note "customer asked for net 45." The ERP payment term is still net 30. The invoice uses the ERP. The API that "syncs customers" copied the name and not the term, because the term was never in the contract. The integration is not broken. The contract never included the field the business now treats as shared.

Failure example: a file drop called an API

Symptom: A project plan says "we integrated the webshop" because a scheduled job drops a CSV on a file share. Monday's blocked account still orders, because the file was built on Friday.

Diagnosis: A file drop can be an integration. It is not, by itself, a request the webshop makes at checkout. The root cause is an undefined moment of exchange. Nobody named when the webshop is allowed to trust the copy.

Correction: Name the operation (read order block), the caller (webshop), the system of record (ERP), and the moment (at checkout, not the next morning). Keep the file only as a backup extract if someone still needs it.

Validation: Place a test order for a blocked account. The webshop refuses it without a person opening the ERP. A file that exists on disk is not that test.

Guided practice: name the contract

Scenario: The warehouse system shows 80 units of fastener FX-100. The webshop shows 120. Purchasing is about to buy. Figures are illustrative.

Hints:

Complete solution:

The blocked decision is whether the webshop may promise 120 units. The warehouse system is the system of record for on-hand quantity, because that is where goods are counted. A fitting contract is: the webshop sends a request that names SKU FX-100, and the warehouse API replies with the on-hand quantity and the time of that count. The webshop does not average 80 and 120. Validation is one SKU: the number on the warehouse screen matches the number in the response body.

Independent practice

Pick one fact that two systems at your work both store.

Acceptance criteria:

Common mistakes

  • Calling any export an API. An API here is a request and a response with a status code.
  • Letting every system be the system of record for the same field.
  • Treating a successful file transfer as proof the checkout saw the new value.
  • Buying an integration product before naming the operation and the moment it must run.

Quick check

  1. What are the four parts of a request in this lesson?
  2. What does a status code tell you?
  3. Northline's ERP says account C-1044 is blocked and the Friday file says it is open. Which one may the webshop trust at checkout, and why?
  4. What is a system of record?
  5. Why is averaging the warehouse's 80 and the webshop's 120 the wrong fix?

Answers:

  1. Method, URL, headers, and an optional body.
  2. How the operation finished, before you read the body as success.
  3. The ERP, because it is the system of record and the file is a stale copy.
  4. The one system allowed to define that fact. Others hold copies.
  5. Averaging invents a third quantity nobody counted.

Lesson summary

An API is how one system asks another for a defined operation and gets a status and a body back. Enterprise integration connects ERP, CRM, and analytics only after the business names the system of record and the moment the copy must be true.

Bridge to the next lesson

The next lesson is the HTTP message itself: GET, POST, PUT, PATCH, DELETE, headers, status codes, and how an error is different from an empty success. Bring Northline's "read the order block" request with you.