flags[].code and, as
strings, in decision.reason. Program against these values, not against the engine’s internal
mechanism.
Each flags entry has four fields: code, category, severity (low /
medium / high), and description (English, the language of the contract). Several internal signals
can collapse into the same code when they tell the merchant the same story: in
flags there’s one entry per code.
decision.reason uses this same vocabulary, plus two forms when the decision was escalated by
something of yours: custom_rule:<id> and entity_block:<kind>:<value>. See
Response format.
Don’t confuse this catalog with the API’s error codes.
Codes
There are 25 codes. You can
switch on code with confidence: when a new signal
tells the same story, it’s added to an existing code.
An additional code may appear,
RISK_SIGNAL_OTHER (category other, severity
low, description Risk signal without a published code), as a fallback when a signal
doesn’t have its own public code yet. Don’t treat it as part of the stable catalog of 25
— it’s the fallback value. If you receive a code you don’t recognize, treat it as a generic signal
and act on decision.type, never on the reason alone.