Test a value against categorisation rules
POST
https://app.speybooks.com/api/v1/categorisation-rules/testTests a transaction input against all active rules and returns the match result. This is read-only: no rules or transactions are changed. Use it to preview which account a transaction would be categorised to.
On a match the response carries the winning rule, the suggested
account, and an evidence object describing why that rule won:
the matched field, operator, and value, the normalised input, how
many rules were evaluated and matched, the source tier of the
winning rule (provenance, one of LOCAL, VERIFIED,
GLOBAL, or SYSTEM), and an opaque scoreVector string
used for tie-break diagnostics whose format is not part of the
stable contract. On no match, matched is false and
unknownReason explains why.
Body parameters
amountintegeroptionalTransaction amount to test, in pence (for greater_than/less_than operators).
contactNamestringoptionalContact name to test.
descriptionstringoptionalTransaction description to test against rules. Will be normalised before matching.
metadataobjectoptionalKey-value metadata to test against metadata.* field rules.
referencestringoptionalReference to test.
Response
200Best matching rule with score vector and evidence, or no match with reason.
Show response fields
evidenceobjectShow child attributes
matchCountintegermatchedFieldstringmatchedValuestringnormalisedInputstringoperatorstringprovenancestringruleCountintegerscoreVectorstringmatchedbooleanruleobjectShow child attributes
idintegernamestringsuggestionobjectShow child attributes
accountCodestringaccountIdstringaccountNamestringError codes
400Invalid test input.