Reconciliation
Create matching rule
Create a reconciliation matching rule with the Python SDK.
POST
/reconciliation/matching-rulesUse blnk.reconciliation.create_matching_rule to create a matching rule.
Call the method
response = blnk.reconciliation.create_matching_rule({
"name": "Amount match",
"description": "Match by amount with 1% drift",
"criteria": [
{
"field": "amount",
"operator": "equals",
"allowable_drift": 0.01
},
{
"field": "currency",
"operator": "equals"
},
{
"field": "reference",
"operator": "contains"
},
],
})
| Field | Type | Description |
|---|---|---|
name | str | Name of the matching rule. |
description | str | Short description of what the rule does. |
criteria | list[dict] | Array of match criteria. Each entry sets how one field is compared. |
criteria.[].field | str | Field to match: amount, currency, reference, description, or date. |
criteria.[].operator | str | How to compare the field: equals or contains. |
criteria.[].allowable_drift | number | Optional tolerance for amount (percentage) or date (seconds). |
Save the rule ID
Use response.data["rule_id"] 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"
}
| Field | Type | Description |
|---|---|---|
rule_id | str | Unique ID for the rule. Store it to apply during reconciliation runs. |
name | str | Rule name you passed. |
criteria | list[dict] | The match criteria stored for the rule. |
created_at | str | When the rule was created. |
updated_at | str | When the rule was last updated. |