Example domain: a shipping platform integrating several courier APIs, each with different auth, payload formats and status names.
Based on patterns I've built in production (details under NDA). The example domain below is illustrative.
TL;DR
Illustrative note: one internal interface and a registry of adapters for providers that differ in auth, payloads, and status names.
live trace · Inbound callback through an adapterfrom the original diagram
01
Third-party API → Callback handlerPOST /callbacks/:account
02
Handler → Adapterparse and verify signature
03
Adapter → Handlernormalised event, final or pending
04
Handler → Core serviceingest; pending means no state change
05
Handler → Third-party APIprovider-specific ack
…
01
The problem
+
Every provider signs requests differently, names statuses differently, and some report an intermediate
processing state before the final result.
02
How it works
+
A single internal interface (create, query, parse callback) and a registry. Adding a provider means one
adapter plus one registration.
On boot, each active account is loaded with its credentials; a broken account is skipped and reported
instead of crashing the service, and credentials are never logged.
Each adapter verifies the callback signature and maps provider statuses to internal ones, including an
explicit pending flag.
Pending events are acknowledged but do not change state; only final events do.
Every outbound call is written to an audit log on a best-effort basis, so logging failures never change
the business result.
Test tenants short-circuit to mock responses and never call the real API.