Test a value against categorisation rules

POST https://app.speybooks.com/api/v1/categorisation-rules/test

Tests a transaction input against all active rules and returns the match result. Evaluates local, verified, and global rules using the full lattice scoring engine.

This is a read-only operation — no rules or transactions are modified. Use this to preview what account a transaction would be categorised to, and to inspect the evidence and score vector for debugging.

Body parameters

amount number optional
Transaction amount to test (for greater_than/less_than operators).
contactName string optional
Contact name to test.
description string optional
Transaction description to test against rules. Will be normalised before matching.
metadata object optional
Key-value metadata to test against metadata.* field rules.
reference string optional
Reference to test.

Response

200 Best matching rule with score vector and evidence, or no match with reason.
Show response fields
evidence object
Show child attributes
matchedField string
matchedValue string
operator string
provenance string
scoreVector string
matched boolean
rule object
Show child attributes
id integer
name string
suggestion object
Show child attributes
accountCode string
accountId string
accountName string

Error codes

400 Invalid test input.