When Old APIs Stay Live: Designing Secure and Efficient Banking Middleware
How stale APIs accumulate in banking, why they raise security and operational risk, and how to design middleware that can be controlled, scaled and safely retired.
Perspectives · Inside the Banking Backbone
The new mobile app calls the bank’s latest payment API. The old version no longer appears in the developer portal. But a reconciliation job still calls its status operation, and the disaster recovery environment still has a route to its payment submission operation. The API looks retired from one vantage point and remains operational from another.
This is how stale APIs develop. A version survives a migration, a pilot becomes a permanent dependency, or a compatibility route outlives the team that created it. Age is not the problem. The risk is a reachable interface whose consumers, controls or operating purpose are no longer understood.
How stale APIs accumulate
Each temporary exception may be reasonable: preserve a partner integration during migration, keep an adapter until the core is replaced, or retain a fallback until a recovery drill succeeds. The trouble starts when the exception has no owner, expiry or evidence required for closure. Delivery teams move on while routes, credentials and support obligations remain.
Distinguish supported legacy APIs, deprecated APIs, undocumented shadow routes and supposedly retired routes that still answer. Each needs a different response. OWASP identifies incomplete inventories, outdated versions and exposed endpoints as API security risks. [1]
What the bank inherits when old routes remain
| Exposure | Banking consequence | Evidence to inspect |
|---|---|---|
| Uneven controls | An older version may accept broader privileges, expose more data or miss a control introduced on the replacement route. | Compare object and action permissions, response fields, credentials and risk controls across versions. |
| Different business meanings | The same status may mean accepted in one version and posted in another. A channel can report completion too early. | Trace each state to an authoritative record and its documented meaning. |
| Duplicate financial effects | Old and new write routes may recognise duplicates separately, letting one business instruction be submitted twice. | Test the same reference across versions, adapters, retries and failover. |
| Resource contention | Inactive routes cost little at runtime, but active legacy traffic, polling and retries can consume shared workers, connections and core capacity. | Measure traffic, tail latency, queue age and resource usage by route and consumer. |
| Hidden continuity dependency | A partner, month-end job or recovery script can fail after a route is removed. | Review business calendars, caller identities, scheduled jobs and recovery exercises. |
| Operational drag | Teams must patch, test and support more contracts, trust chains and routing policies. | Track owners, exceptions, support effort and overdue sunsets. |
Design middleware around clear responsibilities
Use the gateway to manage the entry boundary: authenticate callers, enforce agreed access and traffic policies, and route requests. Use an integration layer where protocol mediation, transformation or orchestration is needed. Keep financial decisions and authoritative writes in the designated business services and systems of record. A gateway token check alone does not establish authority over a specific account or transaction.
Prefer a simple path for simple operations. An API does not need to traverse every middleware component just because those components exist. Keep product rules out of generic mapping scripts; put rules where ownership, changes and tests are clear. Where adapters translate legacy contracts, document fields, units, currency precision and statuses that do not map cleanly.
An operational data store can offload suitable reads from the core. The ODS is query-only and populated through replication. It cannot execute a transaction or fix a source record. Expose data freshness where it matters; a missing replicated record is not proof that the source transaction failed.
Build security into the contract and the runtime
Give each workload or partner a distinct identity where feasible. Use short-lived, appropriately scoped credentials and enforce authorisation for the requested action and object. Where OAuth is used, apply current security guidance and choose stronger client authentication or sender-constrained tokens where warranted. TLS protects the transport; mutual TLS can authenticate peers, but neither replaces business authorisation. [4]
Validate requests against the contract, bound payload sizes and return only fields needed for the purpose. Keep secrets out of code and logs. Track where TLS terminates and how each onward connection is protected. Test certificate and key rotation across both sites; a recovery route that cannot authenticate under the current trust chain is not dependable.
Apply equivalent safeguards to public, partner, internal and recovery paths according to their risk. Review direct backend access as well as the gateway. Maintain traceable change approvals, versioned policies and a controlled emergency procedure. Keep audit evidence useful without recording sensitive payloads by default.
Protect capacity and preserve financial outcomes
Set a deadline for the full journey, then allocate time to its dependencies. Bound connection pools, concurrency and queue sizes. Separate critical transaction processing from heavy reads, batch traffic and replay where shared resources could otherwise allow one workload to starve another. Use circuit breaking, load shedding and back-pressure where appropriate, with explicit behaviour when the service cannot proceed.
Give retries a clear owner, budget and stopping condition. Three attempts at each of three layers can produce up to 27 downstream attempts for one request. Use backoff with jitter for permitted transient retries, and avoid repeating malformed or unauthorised requests. The Google SRE guidance explains how retry amplification can turn local saturation into a cascading failure. [5]
For financial writes, bind duplicate handling to the business instruction and enforce it where the financial effect is applied. Define the key’s scope, lifetime and behaviour when the same key carries different material details. A gateway request ID is useful for tracing but is not sufficient to prevent a second posting.
Treat an uncertain response as a state to resolve. Look up the original instruction through the authoritative path and reconcile before taking a further action. In asynchronous flows, define acceptance versus completion, handle duplicate messages and restrict replay from dead-letter queues. A replay is a controlled operation, especially when earlier attempts may already have moved money.
Retire an API through evidence, not a calendar date
| Stage | What the bank does |
|---|---|
| Discover | Reconcile catalogues with gateway routes, service configuration, network access, credentials and runtime telemetry. Include DR, callbacks, batch and partner traffic. |
| Classify and contain | Assign a business and technical owner. Assess transaction authority and data exposure. Restrict unneeded access and give retained exceptions a dated review. |
| Deprecate | Stop new adoption, identify a supported replacement and contact consumers. Publish migration guidance and an expected sunset where known. |
| Prove migration | Test normal behaviour, errors, reconciliation, duplicate handling and recovery. Check usage over relevant business cycles and obtain owner evidence for infrequent callers. |
| Disable and observe | Use an approved, reversible withdrawal where safe. Monitor rejected calls and business outcomes. Define what would justify rollback without reintroducing uncontrolled access. |
| Remove and verify | Remove routes, deployments and grants no longer needed, accounting for shared dependencies. Verify blocked access in both sites and retain required records separately. |
HTTP can advertise deprecation and expected unavailability using the Deprecation and Sunset headers. These are signals to consumers. They do not remove a route or establish that migration succeeded. Pair them with direct communication, an agreed transition plan and evidence of closure. [2] [3]
A practical example: the quiet endpoint that still matters
Fictional scenario: the bank sees no calls to a v1 payment endpoint in a week of gateway logs. During a month-end rehearsal, it discovers that a settlement job still queries v1 status. The DR runbook also contains a v1 submission route that uses an older credential.
Treat the read and write paths separately. Move the settlement job to the supported status contract and verify that its reconciliation outcomes match. Assess and restrict the obsolete write path under the bank’s approved procedure, then update and exercise the DR runbook. If a write previously timed out, reconcile the original instruction before retrying through v2. Restoring a route does not undo a financial effect.
After the change, verify route and credential removal where applicable, check the relevant business cycle and confirm that status queries still work. One retirement record should show the consumer, the replacement, the approval and the evidence from both environments.
What an architecture review should ask for
Ask for an inventory tied to runtime evidence, a contract defining authority and completion, and a tested capacity and recovery plan. Track ownership coverage, versions beyond approved sunset, calls to disabled routes, unresolved transactions and tail latency under peak and failover. Define who acts when a measure breaches its threshold.
The bank owns risk acceptance, financial authority and approval of retirement. An MSI can coordinate discovery, migration, testing and evidence within the agreed scope. Application and partner owners validate their dependencies. A decision to leave a route active should have the same clarity of ownership as a decision to remove it.
Our perspective
An API lifecycle ends when the bank can prove the old route is no longer required and no longer reachable as an active service. Until then, its controls and dependencies remain part of the operating landscape. The best middleware design makes each path explainable, limits the work it can impose and makes its eventual removal a planned change.
Continue with Learning
The old API is quiet. Can the bank switch it off? Practise separating retirement evidence, recovery dependencies and uncertain financial outcomes.
Sources & further reading
- OWASP — Improper Inventory Management
- RFC 9745 — Deprecation HTTP response header
- RFC 8594 — Sunset HTTP header
- RFC 9700 — OAuth 2.0 Security Best Current Practice
- Google SRE — Addressing Cascading Failures
Put this perspective into practice.
Explore the concepts, make a decision and test what changes when the situation changes.
Topics: API Architecture, Banking Architecture, Inside the Banking Backbone, Operational Resilience, Perspective