OPDC API error code

SAGE_RULE_VIOLATION

HTTP status 422

Sage's own enforcement refused the write. 422, and permanent.

Sage installs enforce several rules in database triggers rather than in declared constraints — record-number reservation, ledger-record uniqueness and sub-account consistency among them — and this is what a caller receives when one of those refuses. The detail carries Sage's own wording where it is safe to show; where it is not, quote correlationId.

The API answers with a problem document (RFC 9457) whose type is https://twinn.engineering/errors/sage-rule-violation, and with X-Error-Code: SAGE_RULE_VIOLATION. Branch on the code, never on the detail text.

How errors work, and what to retryEvery error code