Reconciliation

Create matching rule

Create a reconciliation matching rule with the Java SDK.

POST/reconciliation/matching-rules

Use blnk.reconciliation().createMatchingRule for this operation.

Call the method

Criteria amountMatch = Criteria.create()
    .field("amount")
    .operator("equals")
    .allowableDrift(0.01);

ApiResponse<JsonNode> response = blnk.reconciliation().createMatchingRule(
    Matcher.create()
        .name("Amount match")
        .description("Match on amount")
        .criteria(List.of(amountMatch)));
FieldTypeDescription
nameStringName of the matching rule.
descriptionStringShort description of what the rule does.
criteriaList<Criteria>Match criteria built with Criteria.create().
criteria.
[].field
StringField to match: amount, currency, reference, description, or date.
criteria.
[].operator
StringHow to compare the field: equals or contains.
criteria.
[].allowable_drift
NumberOptional tolerance for amount (percentage) or date (seconds).

Save the rule ID

Use response.data().get("rule_id").asText() in matching_rule_ids when you start reconciliation.

Response

{
  "rule_id": "rule_890bdbc4-467f-4670-8424-5667e41daf29",
  "name": "Amount match",
  "description": "Match by amount with 1% drift",
  "criteria": [
    {
      "field": "amount",
      "operator": "equals",
      "allowable_drift": 0.01
    }
  ],
  "created_at": "2024-11-26T08:36:36.238244338Z",
  "updated_at": "2024-11-26T08:36:36.238244338Z"
}
FieldTypeDescription
rule_idStringUnique ID for the rule. Store it to apply during reconciliation runs.
nameStringRule name you passed.
criteriaJsonNodeJSON array of match criteria stored for the rule.
created_atStringWhen the rule was created.
updated_atStringWhen the rule was last updated.