OPDC API error code

SAGE_FOREIGN_KEY_VIOLATION

HTTP status 422

A referenced record does not exist in Sage, or the write would orphan a child row: SQL Server Msg 547, a foreign key or reference constraint. 422.

Permanent. The identical request can never succeed, so unlike SAGE_ERROR this carries no retry hint. Correct the reference — the job, vendor, part or account the request names — and send it again.

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

How errors work, and what to retryEvery error code