Reconciliation

Update matching rule

Update a reconciliation matching rule with the TypeScript SDK.

PUT/reconciliation/matching-rules/{rule_id}

Use blnk.Reconciliation.updateMatchingRule to update a matching rule.

Call the method

const response = await blnk.Reconciliation.updateMatchingRule(
  'rule_890bdbc4-467f-4670-8424-5667e41daf29',
  {
    name: 'Amount match (updated)',
    description: 'Match by amount with 2% drift',
    criteria: [
      {
        field: 'amount',
        operator: 'equals',
        allowable_drift: 0.02
      },
      {
        field: 'currency',
        operator: 'equals'
      },
    ],
  },
);
FieldTypeDescription
ruleIdstringID of the matching rule to update.
namestringUpdated name for the rule.
descriptionstringUpdated description of what the rule does.
criteriaobject[]Full replacement array of match criteria.
criteria[].fieldstringField to match: amount, currency, reference, description, or date.
criteria[].operatorstringHow to compare the field: equals or contains.
criteria[].allowable_driftnumberOptional tolerance for amount (percentage) or date (seconds).

Verify the changes

Read response.data to confirm the updated criteria and description. The rule ID stays the same.

Response

{
  "rule_id": "rule_890bdbc4-467f-4670-8424-5667e41daf29",
  "name": "Amount match (updated)",
  "description": "Match by amount with 2% drift",
  "criteria": [
    {
      "field": "amount",
      "operator": "equals",
      "allowable_drift": 0.02
    }
  ],
  "created_at": "2024-11-26T08:36:36.238244338Z",
  "updated_at": "2024-12-01T10:15:00.000000000Z"
}
FieldTypeDescription
rule_idstringUnchanged ID of the rule.
namestringUpdated rule name.
criteriaobject[]The updated match criteria stored for the rule.
updated_atstringWhen the rule was last updated.