Reconciliation

Update matching rule

Update a reconciliation matching rule with the Python SDK.

PUT/reconciliation/matching-rules/{rule_id}

Use blnk.reconciliation.update_matching_rule to update a matching rule.

Call the method

response = blnk.reconciliation.update_matching_rule(
  "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
ruleIdstrID of the matching rule to update.
namestrUpdated name for the rule.
descriptionstrUpdated description of what the rule does.
criterialist[dict]Full replacement array of match criteria.
criteria.
[].field
strField to match: amount, currency, reference, description, or date.
criteria.
[].operator
strHow to compare the field: equals or contains.
criteria.
[].allowable_drift
numberOptional 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_idstrUnchanged ID of the rule.
namestrUpdated rule name.
criterialist[dict]The updated match criteria stored for the rule.
updated_atstrWhen the rule was last updated.