Skip to main content
POST
/
reconciliation
/
matching-rules
Create matching rule
curl --request POST \
  --url http://localhost:5001/reconciliation/matching-rules \
  --header 'X-blnk-key: <api-key>'
Use blnk.Reconciliation.createMatchingRule to create a matching rule.
blnk.Reconciliation.createMatchingRule
const response = await blnk.Reconciliation.createMatchingRule({
  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' },
  ],
});
FieldDescription
nameName of the matching rule.
descriptionShort description of what the rule does.
criteriaArray of match criteria. Each entry sets how one field is compared.
criteria[].fieldField to match: amount, currency, reference, description, or date.
criteria[].operatorHow to compare the field: equals or contains.
criteria[].allowable_driftOptional tolerance for amount (percentage) or date (seconds).

Response shape

201 Created
{
  "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"
}
FieldDescription
rule_idUnique ID for the rule. Store it to apply during reconciliation runs.
nameRule name you passed.
criteriaThe match criteria stored for the rule.
created_atWhen the rule was created.
updated_atWhen the rule was last updated.

How reconciliation works

Criteria, operators, and drift behavior.

Create matching rule

HTTP request and response schema.

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.