OPDC API error code

INSUFFICIENT_INVENTORY

HTTP status 422

An inventory allocation that would take more of a part out of a location than is available there. 422.

Checked when the allocation moves stock (held or shipped), summing every line that takes the same part out of the same location. The detail names each part and location with the quantity asked for and the quantity available, and nothing is written.

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

How errors work, and what to retryEvery error code