Stonebridge Treasury returned HTTP 200 for business-layer rejections, encoding the rejection only in a response body field. SDK-generated clients treated every 200 as success, silently skipping the body check and assuming transfers had been initiated.
What happened
Stonebridge Treasury’s transfer API returned HTTP 200 for nearly every request that reached the business layer. When a transfer was rejected—due to a closed account, an exceeded daily limit, or an ineligible account—the rejection was indicated only inside the JSON body with a field like "result": "REJECTED". This design was intended to simplify integration, since clients wouldn’t need to handle multiple status codes.
A corporate customer regenerated its treasury integration SDK from the published OpenAPI specification. The SDK, following HTTP semantics, treated HTTP 200 as success and didn’t inspect the body for a rejection flag. Transfer workflows completed from the SDK’s perspective, logged success, and moved on.
Dozens of transfers that had been rejected were never retried, escalated, or reported. Finance teams discovered the gap during a reconciliation cycle weeks later. The affected transfers had to be manually reviewed and resubmitted, some after payment deadlines had passed.
Root cause
HTTP status codes have defined semantics. Using 200 for a business failure violated those semantics in a way that SDK generators and integration frameworks couldn’t account for. The OpenAPI specification didn’t document the rejection pattern clearly, so generated clients had no way to know they needed to inspect the body for failures.
The fix
The API was updated to return appropriate HTTP status codes: 422 for business-rule rejections with a structured error body explaining the reason. The OpenAPI specification was updated with examples for each rejection type. Existing integrations were notified of the semantic change with a migration period.
Lesson learned
HTTP status codes exist to communicate outcome semantics to any client, including automated ones. Using 200 for failures forces every consumer to implement custom parsing that standard tooling won’t do automatically—and some won’t do at all.