Overview

Matching rules are used by Blnk to determine how to compare and match your ledger records with your external records. These rules define how fields like amount, date, and reference are compared, with flexibility for small discrepancies (called drifts).

In this guide, you’ll learn how to set matching rules and apply them when running reconciliation.


Creating a matching rule

To create a new matching rule, call the Create Matching Rule endpoint:

POST https://YOUR_BLNK_INSTANCE_URL/reconciliation/matching-rules
Sample request
{
    "name": "Default matcher",
    "description": "Amount with 1% drift matcher",
    "criteria": [
        {
            "field": "amount",
            "operator": "equals",
            "allowable_drift": 0.01
        },
        {
            "field": "currency",
            "operator": "equals"
        },
        {
            "field": "date",
            "operator": "equals",
            "allowable_drift": 1800
        },
        {
            "field": "reference",
            "operator": "contains"
        }
    ]
}

How Blnk matches transactions during reconciliation

Blnk ensures accurate reconciliation by comparing external records with your ledger records based on five key attributes:

AttributesOperatorsWhat it does
amountequals, greater_than, less_thanCompares transaction amounts.
currencyequalsEnsures both transactions use the same currency.
dateequals, after, beforeMatches transactions based on their timestamps.
referenceequals, containsChecks if the transaction reference matches or is partially included.
descriptionequals, containsMatches transactions based on their descriptions.

Understanding matching operators

Each attribute is matched using specific operators, which determine how strict the comparison is:

OperatorsDescription
equalsBoth records must match exactly.
containsParts of the external record match the internal record.
greater_thanThe external amount must be higher than the internal amount.
less_thanThe external amount must be lower than the internal amount.
afterThe external date must be later than the internal date.
beforeThe external date must be earlier than the internal date.

Example scenarios

Here’s how these rules work during reconciliation:

1

Matching amounts

External amountInternal amountOperator usedMatch?
$100.00$100.00equals✅ Yes
$105.00$100.00greater_than✅ Yes
$95.00$100.00greater_than❌ No
2

Matching dates

External dateInternal dateOperator usedMatch?
March 10, 2025March 10, 2025equals✅ Yes
March 12, 2025March 11, 2025after✅ Yes
March 10, 2025March 11, 2025after❌ No
3

Matching references

External amountInternal amountOperator usedMatch?
”REF-12345""12345”contains✅ Yes
”INV-56789""INV-56789”equals✅ Yes
”12345""REF-12345”contains❌ No

Why this matters

  1. Flexibility: Use operators like contains, greater_than, and before to account for processing delays, fees, and partial matches.

  2. Precision: Ensure transactions are matched accurately, reducing errors in reconciliation.

  3. Control: Customize your matching rules to fit your financial workflows.


Handling discrepancies with drifts

Small differences in amounts or dates—like fees or time zone shifts—can disrupt reconciliation.

The allowable_drift field sets a tolerance range for matches, used with the equals operator. Blnk supports two types:

  1. Amount drift: Tolerates value differences (e.g., 0.01 = 1% drift).

    A $100 internal record with 1% drift matches $99 – $101 external records.
  2. Date drift: Allows for time differences (e.g., 3600 = 1 hour).

    A 2:00 PM internal record with 1-hour drift matches 1:00–3:00 PM external timestamps.

When to use drifts

  1. Use amount drift when:

    • Your external data includes processing fees or minor exchange rate variations.
    • Your system rounds transactions differently from external sources.
  2. Use date drift when:

    • Your transactions involve cross-time-zone processing.
    • Payment settlements take hours or days to finalize.

Best practices

To ensure accurate and reliable financial reconciliation, follow these best practices when defining matching rules:

  1. Optimize for efficiency: Reduce manual effort by implementing automated matching rules.

  2. Use Drifts Strategically: Apply allowable drifts to handle small discrepancies without compromising accuracy.

  3. Ensure accuracy: Minimize human errors with consistent and precise rule application.

  4. Design for scalability: Use robust rules that can handle high transaction volumes and complex financial products.

  5. Maintain compliance: Align matching rules with regulatory requirements for transparency.

  6. Regularly review & optimize: Continuously assess and refine matching rules based on reconciliation performance and error patterns.

  7. Audit logs: Maintain detailed logs of matching decisions to support audits and troubleshooting.


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.

Love building with Blnk? We’d love to hear your feedback. Tell us here.