Rule matching – fields and operations
Less than to read
When creating rules, the transactions it will apply to are determined by the ruleConditions property. This is an array of objects that include the following properties to specify fields and operations. Multiple conditions can be captured in a rule and are applied in a logical manner and sequence.
Support transaction fields
These are the available fields on a transaction that a rule condition can apply to:
transactionNarrative
transactionAmount
datePosted
transactionType
checkNum
subAccount
currency
payee.payeeBankId
payee.payeeAccountId
Pseudo fields (these do not appear as part of the transaction object):
$baseType
: This takes the values credit or debit and will only accept the operator of ‘eq’. Credit matches all values greater than or equal to 0.
Transation narrative
The transactionNarrative field on a transaction is a concatenation of the following transaction fields:
- narrative1
- narrative2
- name
- referenceNumber
- extendedName
- payee.payeeId
- checkNum
Supported rule operations
The supported comparison operators for different field types are as follows:
Rule name | Types supported | Description |
---|---|---|
eq | String, Numeric, Date | Equals |
gt | Numeric, Date | Greater than |
ge | Numeric, Date | Greater than or equal to |
lt | Numeric, Date | Less than |
le | Numeric, Date | Less than or equal to |
contains | String | Contains |
containsWords | String | Contains the specified, consecutive, words. For example, ‘this exist’ in the string ‘does this exist anywhere’ would match |
notcontains | String | Does not contain |
Supported rule field combinations
Each rule field will only accept a subset of operations. The valid combinations are as follows:
Rule field | Valid ruleOperation Values |
---|---|
transactionNarrative | eq, contains, notcontains, containsWords |
transactionAmount | eq, gt, ge, lt, le |
datePosted | gt, ge, lt, le |
transactionType | eq |
checkNum | eq |
currency | eq |
payee.payeeBankId | eq |
payee.payeeAccountId | eq |
$baseType | eq |
Rule criteria
This is the value of the ruleField
which is used when matching transactions.
"ruleConditions": [{
"ruleField": "transactionAmount",
"ruleOperation": "eq",
"ruleCriteria": "5.00"
}]
Additional information
- It is possible that multiple rules match against the same transaction. To help provide control and remove uncertainty, a rule rank property can be applied to a rule. The rule with highest rank will be considered the match and have the rule actions applied.
- The rule processing discussed in this section is referred to as Client Rules. Another type of rules processing exists for accountants. This redirects transactions to an accountant for rules processing, before releasing them with verified accounts posting for actioning in the product. Currently this feature is not widely adopted.