The Payouts API uses the same error envelope as the rest of the Clevis API:
Use the code field for programmatic branching — never the HTTP status,
which can be shared by several codes (e.g. 409 covers two distinct error
codes below).
Error code reference
Don’t confuse these
A few distinctions worth calling out:
REJECTED status vs. 422 VALIDATION_ERROR. A REJECTED payout was
accepted by the API (the request is well-formed) and then turned away by
the provider/bank. Bad input (e.g. malformed CLABE, missing beneficiary
field) is rejected with 422 before a payout is created.
EXTERNAL_ID_CONFLICT vs. IDEMPOTENCY_KEY_REUSED. Both are 409s.
The first means you reused an external_id for a different payout. The
second means you reused an Idempotency-Key for the same logical create,
but the body changed — usually a caller bug.
PAYOUT_NOT_FOUND vs. PAYOUT_COUNTRY_NOT_SUPPORTED. Both are 404s.
The first means “this id doesn’t exist for you”; the second means “this
country isn’t a payout destination yet”.
Handling errors in code
See also