API Design for Web and Commerce Builds in 2026

API Design for Web and Commerce Builds

Wiring third-party APIs reactively, one incident at a time, is a habit, not a plan. This guide gives one upfront integration discipline and where a website and an official shopping mall diverge.

Wiring third-party APIs reactively — one integration at a time, whenever an incident or a feature request forces it — is a habit, not a plan. That habit compounds into inconsistent auth, no shared error model, and brittle webhooks that fail at launch. The fix is one upfront discipline applied before the build starts: a single auth and contract model, an explicit integration inventory, and a decision tree run once per integration. This guide gives you that discipline and a website-versus-commerce comparison so you can scope a corporate site or an official shopping mall without retrofitting it later.

Why integrations must be designed before the build

One failure mode shows up on a corporate website and an official shopping mall alike: integrations get bolted on reactively. For example, the maps widget goes in when marketing asks for a store locator. The payment gateway gets wired right before launch. A webhook handler appears after an order goes missing in production. Each one is solved locally, by whoever was on call, in whatever style that day allowed.

Reactive wiring can spread beyond the one integration it was meant to fix. By the third or fourth integration you can end up with three different auth patterns, no shared way to represent a failed call, no retry policy worth the name, and webhooks that nobody verifies. There may be no single place to ask "what does this site talk to, and what happens when one of those things is down." The api integration architecture can end up existing only as tribal knowledge spread across commits and Slack threads.

The cost can land at the worst possible moment: the launch itself, a payment outage, or a vendor shipping a breaking change on short notice. That is when the absence of a shared error model and a rollback path becomes a production incident instead of a design review comment. Designing the integration layer once, before the build, is not free, but it is meant to avoid paying, retrofit by retrofit, the cost of discovering each gap in production.

The shared discipline (website and shopping mall alike)

There is one discipline here, not two. A corporate website and an official shopping mall need the same spine; only the inventory and the risk tier change. That spine carries much of the design work, and it is worth writing down before any integration code exists.

The spine has a small number of decisions you make once and apply everywhere. There is one auth and secret-rotation model: how credentials are issued, stored, rotated, and revoked, with sandbox and production secrets strictly separated so that a test key is not used against a live endpoint by mistake. There is one contract source of truth — an OpenAPI document (or an equivalent machine-readable spec) per integration, versioned in the repository, rather than a shape that lives in someone's memory. There is one error taxonomy: a shared, structured way to represent failures, for which RFC 9457 Problem Details for HTTP APIs is a sensible default so every caller and every log line speaks the same dialect. And there is one idempotency policy, which matters most the moment money or stateful writes are involved.

Resilience defaults are part of the spine, not per-integration improvisation: explicit timeouts, bounded retries with backoff, and circuit breakers to limit how much of your request pool one slow vendor can exhaust. The microservice architecture pattern catalog describes the last of these as its Circuit Breaker pattern: invoking a remote service "via a proxy that fails immediately when the failure rate of the remote call exceeds a threshold." Observability hooks belong here too — every external call emits a trace and a metric, so a failing integration is visible before a customer reports it. Vendor SLA and rate limits are design inputs, not runtime surprises: a published rate ceiling and a documented uptime target change how you queue, cache, and fail over, and RFC 6585's 429 Too Many Requests is part of the contract you design around, not an error you discover under load. Webhook signature verification and sandbox-to-production credential separation are non-negotiable defaults. As a shared list of API security risks to review each integration against, the OWASP API Security Top 10 (2023 edition, the latest on the project site as of Nov 2026) is a useful reference. The spine closes with a go-live gate: a defined checklist that an integration passes before it touches production traffic.

Where the official website and the shopping mall diverge

The divergence is real, but it is in the inventory and the risk tier — not in the discipline. The clearest way to see it is side by side.

DimensionOfficial websiteOfficial shopping mall
Typical integrationsMaps, contact and lead forms, CMS, SSO, site search, analytics, consentPayment, shipping and logistics, inventory, tax calculation, order management, fraud screening
Failure blast radiusA degraded page or a missing widget; an SSO or consent failure can block sign-in or consent handlingLost order, double charge, oversold stock
Idempotency requirementLow to moderateMandatory on every money or stateful write
ReconciliationLimited (for example, lead hand-off to a CRM)Required for payments, orders, and stock
Latency postureMarketing pages tolerate async loadingThe checkout path is latency-critical
SEO and AI-crawl postureMarketing pages must render for crawlersCatalog pages need crawlable, stable URLs
Dominant riskAvailability and user experienceMoney movement and data integrity

The risk-tier difference in the table drives everything that follows. A shopping mall moves money, so idempotency, reconciliation, and fraud raise the resilience bar above what a marketing site needs. A duplicated form submission is a nuisance; a duplicated charge can become a chargeback and a trust problem. Latency and crawl posture differ in kind, not degree — a catalog page that must stay crawlable and fast under load is a different engineering target than a campaign landing page. None of that changes the spine. You still have one auth model, one contract source of truth, one error taxonomy. The shopping mall simply exercises more of the spine, harder.

The pre-build decision tree

Run the same short decision tree once per integration, before any code, and the reactive habit has nowhere to hide. For each external dependency you answer a fixed set of questions. Is the interaction synchronous or asynchronous — does the user wait for it, or does it complete out of band? Is it push or pull — does the vendor call you (a webhook) or do you call the vendor (polling or request-response)? Is it direct or mediated — does your application talk to the vendor directly, or through a gateway, queue, or integration layer that gives you a place to retry and observe? Is the capability first-party or vendor — something you own and can change, or something you depend on and must design around?

The branch points are where website and commerce answers genuinely differ. A contact form is usually synchronous, pull, direct, and degradable. A payment authorization is synchronous on the critical path. Its settlement and reconciliation are asynchronous and can mix push and pull: a vendor can send a webhook when new reporting data is available, and you then pull the reports. That side is direct only behind an idempotent boundary, and it is not a candidate for degradation. The tree is the same; the leaves are not.

Two outputs are mandatory for every integration before code is written: a named owner and a runbook owner. The owner decides the integration's contract and lifecycle; the runbook owner is who gets paged and what they do when it fails. An integration without a runbook owner is an incident waiting for a volunteer. This guide stays at decision altitude on purpose — the mechanics of auth flows, retry math, webhook replay, and contract testing are deep enough that they each deserve focused treatment elsewhere on this topic. Here, the goal is to make the decision, deliberately, once.

The integration inventory you write down first

An inventory is the single artifact that turns reactive wiring into a plan. It is not a diagram; it is a list, and it should be short enough to fit on one page. For every external API, write three things: what it is, its criticality, and its failure blast radius. Criticality is binary at first — launch-blocking or degradable. The site cannot open without payment authorization; it can open with a temporarily empty store-locator map. Knowing which is which before the build tells you where resilience effort has to go.

For each entry, also capture the design inputs you will otherwise discover at the worst time: the auth model, the published rate limits, whether a usable sandbox exists, and the data-residency posture of the vendor. A vendor with no sandbox is a different integration plan than one with a faithful test environment, and you want to know that during scoping, not during launch rehearsal. Mark the critical path explicitly — the set of integrations that must work on day one — and treat everything on it as launch-blocking until proven otherwise. The inventory is also the artifact you hand to the next engineer, the auditor, and your future self; it is the difference between an api integration architecture you can reason about and one you can only excavate.

The country layer, at a glance

The same integration category does not behave the same in every market. A payment integration, a maps integration, or an identity integration can present a different API shape, a different sandbox story, a different auth model, and different data-residency rules depending on whether you are launching in Korea, China, Japan and Southeast Asia, the European Union, the United States, or the Middle East and North Africa. What changes is not only which vendor you pick — it is the integration-layer engineering itself: the auth dance, the residency boundary, the latency profile, and whether a sandbox even exists.

This guide names that layer and stops there. A dedicated treatment on this topic owns the regional API-layer detail. It is worth being precise about the boundary, because a neighboring concern looks similar and is not the same job: choosing which provider serves which market — the maps provider in one region, the messaging channel in another — is a localization decision handled by a different body of work entirely. This topic owns the API design and resilience engineering underneath whatever provider you choose; it does not duplicate the provider-selection question.

How to read the rest of this topic

This guide is the decision-altitude map. The rest of this topic turns the map into a plan and then into mechanics, and it is structured so you can move from scoping to launch without backtracking.

A readiness checklist and a set of decision treatments take the spine and make it actionable for a specific build. Two inventory treatments cover the surfaces in detail — one for the official shopping mall's money-moving integrations, one for the corporate website's marketing and content integrations — so the comparison table above expands into two concrete worksheets. The mechanics live in focused treatments on auth and secret rotation, resilience and failure handling, webhook architecture, contract and versioning discipline, and observability and SLA monitoring; each one goes as deep as the topic needs without re-explaining the spine. A country treatment owns the regional API-layer detail, and a pre-launch go-live checklist closes the loop before any of it reaches production. One more boundary is worth stating plainly: how a content management system actually exchanges data with commerce, ERP, or CRM systems is its own body of work; this topic owns the API design and resilience discipline that sits underneath that data flow, not the CMS data model itself.

Diagnostic checklist for the next planning cycle

  • List every external API the site or shopping mall will call, on one page, before any integration code is written
  • Mark each entry launch-blocking or degradable, and circle the day-one critical path
  • Decide one auth and secret-rotation model and enforce sandbox-to-production credential separation
  • Choose a single error taxonomy (RFC 9457 is a safe default) and a single idempotency policy for every money or stateful write
  • Record each vendor's rate limit, SLA, and sandbox availability as a design input in the inventory
  • Assign a named owner and a runbook owner to every integration — no integration ships without both
  • Define the go-live gate an integration must pass before it touches production traffic
Project Inquiry