OPDC API error code

PERIOD_BEFORE_INVOICE

HTTP status 422

An AP payment or a cash receipt posts to a period before the period of an invoice it pays. 422.

A payment cannot reduce a balance before the period that created it. Post to the invoice's period or a later one. The detail names each invoice and its period. Nothing is written.

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

How errors work, and what to retryEvery error code