Skip to main content

Customer Rules (Risk Factors)

A customer rule โ€” also called a risk factor โ€” is a configurable scoring rule that evaluates your customers' data and contributes to their overall risk score. Each rule looks at one or more conditions about a customer (such as their account type, country, or custom fields) and adds a numeric score when those conditions are met.

Together, all active risk factors produce a cumulative risk score for each customer. That score is used to classify customers as low, medium, or high risk โ€” and it feeds directly into transaction monitoring decisions.


How it worksโ€‹

Customer rules follow a three-level structure:

Rule (Risk Factor)
โ””โ”€โ”€ Group
โ””โ”€โ”€ Condition (field + operator + value)

Ruleโ€‹

The top-level risk factor. A rule has a name, a status, and one or more groups. You can configure whether the rule:

  • Takes only the highest-scoring group (takeMaxScore) โ€” useful when groups are mutually exclusive risk categories
  • Allows multiple groups to score simultaneously โ€” useful when a customer can match several risk indicators at once

Groupโ€‹

A group is a named scenario within a rule, with its own score. For example, a "High-risk countries" group might carry a score of 40, while a "Medium-risk countries" group carries 20.

A group can be scored in two ways:

Scoring modeHow it works
fixedThe group's score is applied as-is when the conditions are met
classifierThe score is calculated dynamically using a trained classifier model

Conditionโ€‹

A condition is the actual check: a customer field, an operator, and a target value. All conditions within a group must be satisfied for the group to trigger.

Example: accountTypeId equals 2 (i.e., the customer is a company).


Manual rulesโ€‹

Rules can also be set to manual mode. A manual rule has no automated conditions โ€” instead, your team assigns the score directly against a customer. This is useful for risk factors that cannot be derived from data alone, such as a compliance officer's assessment after an in-person review.


API referenceโ€‹

List rulesโ€‹

GET /api/v1/customer-rules

Query parametersโ€‹

ParameterTypeDescription
searchstringFilter by rule name
statusstringactive or disabled
skipnumberPagination offset. Default: 0
takenumberPage size. Default: 20

Responseโ€‹

{
"status": 200,
"message": "Customer rules fetched",
"data": {
"data": [
{
"id": 1,
"name": "High-risk country",
"status": "active",
"isManual": false,
"takeMaxScore": true,
"allowMultipleChoice": false,
"groups": [
{
"id": 10,
"name": "Tier 1 risk",
"score": 40,
"scoringMode": "fixed",
"_count": { "fieldOptions": 1 }
}
],
"_count": { "groups": 1 }
}
],
"total": 1
}
}

Get a ruleโ€‹

GET /api/v1/customer-rules/:id

Returns the full rule including all groups and their conditions.

Responseโ€‹

{
"status": 200,
"message": "Customer rule fetched",
"data": {
"id": 1,
"name": "High-risk country",
"status": "active",
"isManual": false,
"takeMaxScore": true,
"allowMultipleChoice": false,
"groups": [
{
"id": 10,
"name": "Tier 1 risk",
"score": 40,
"scoringMode": "fixed",
"fieldOptions": [
{
"id": 100,
"field": "country",
"operator": "in",
"value": "NG,GH,KE",
"functionKey": "field_check",
"classifier": null
}
]
}
]
}
}

Create a ruleโ€‹

POST /api/v1/customer-rules

Request bodyโ€‹

FieldTypeRequiredDescription
namestringโœ…Display name for the risk factor
statusstringโ€”active or disabled. Default: active
isManualbooleanโ€”true for manual scoring rules. Default: false
takeMaxScorebooleanโ€”Only apply the highest-scoring matching group. Default: false
allowMultipleChoicebooleanโ€”Allow multiple groups to score simultaneously. Default: false
groupsarrayโ€”Groups to create with the rule (see below)

Group fieldsโ€‹

FieldTypeRequiredDescription
namestringโœ…Group label
scorenumberโœ…Score applied when this group matches
scoringModestringโ€”fixed or classifier. Default: fixed
fieldOptionsarrayโ€”Conditions to evaluate (not allowed when isManual is true)

Condition fieldsโ€‹

FieldTypeRequiredDescription
functionKeystringโœ…The evaluation function to use
fieldstringโœ…The customer field to evaluate
operatorstringโœ…Comparison operator (e.g. equals, in, greaterThan)
valuestringโ€”Value to compare against
classifierIdnumberโ€”Classifier to use when scoringMode is classifier

Exampleโ€‹

{
"name": "High-risk country",
"takeMaxScore": true,
"groups": [
{
"name": "Tier 1 risk",
"score": 40,
"fieldOptions": [
{
"functionKey": "field_check",
"field": "country",
"operator": "in",
"value": "NG,GH,KE"
}
]
}
]
}

Update a ruleโ€‹

PUT /api/v1/customer-rules/:id

Updates the rule's top-level fields. To modify groups or conditions, use the group and condition endpoints below.

FieldTypeDescription
namestringNew display name
statusstringactive or disabled
isManualbooleanToggle manual scoring
takeMaxScoreboolean
allowMultipleChoiceboolean

Delete a ruleโ€‹

DELETE /api/v1/customer-rules/:id

Managing groupsโ€‹

Add a groupโ€‹

POST /api/v1/customer-rules/:id/groups

Body accepts the same fields as the groups array items in create.

Update a groupโ€‹

PUT /api/v1/customer-rules/:id/groups/:groupId
FieldTypeDescription
namestring
scorenumber
scoringModestringfixed or classifier

Remove a groupโ€‹

DELETE /api/v1/customer-rules/:id/groups/:groupId

Managing conditionsโ€‹

Add a conditionโ€‹

POST /api/v1/customer-rules/:id/groups/:groupId/options

Body accepts the same fields as condition items in create.

Update a conditionโ€‹

PUT /api/v1/customer-rules/:id/groups/:groupId/options/:optionId

All fields are optional โ€” only the provided fields are updated.

Remove a conditionโ€‹

DELETE /api/v1/customer-rules/:id/groups/:groupId/options/:optionId