Endpoint
POST /reconciliation/matching-rules
Creates a matching rule that defines how external transactions should be matched with internal Blnk transactions during reconciliation. Rules can specify criteria for matching based on amount, reference, date, and other fields.
Request Body
A descriptive name for the matching rule
A detailed description of what this rule matches and when to use it
Array of matching criteria that define how to match transactions The field to match on. Supported values:
amount: Transaction amount
reference: Transaction reference
date: Transaction date
currency: Currency code
description: Transaction description
The comparison operator. Supported values:
eq: Exact match
contains: Field contains the value
starts_with: Field starts with the value
ends_with: Field ends with the value
within_range: For date/amount ranges
The value to match against (required for most operators)
A regex pattern for advanced matching
For amount matching, the acceptable difference between amounts (e.g., 0.01 for one cent difference)
Response
The unique identifier for the created matching rule
The name of the matching rule
The description of the matching rule
The array of matching criteria
Timestamp when the rule was created (ISO 8601 format)
Timestamp when the rule was last updated
Example Request
Exact Amount and Reference Match
{
"name" : "Stripe Payment Match" ,
"description" : "Matches Stripe payments by exact amount and reference" ,
"criteria" : [
{
"field" : "amount" ,
"operator" : "eq" ,
"allowable_drift" : 0.01
},
{
"field" : "reference" ,
"operator" : "eq"
}
]
}
Date Range with Amount Matching
{
"name" : "Bank Statement Match" ,
"description" : "Matches bank statement entries within a 2-day window" ,
"criteria" : [
{
"field" : "amount" ,
"operator" : "eq" ,
"allowable_drift" : 0.0
},
{
"field" : "date" ,
"operator" : "within_range" ,
"value" : "2d"
}
]
}
Pattern Matching on Description
{
"name" : "Invoice Payment Match" ,
"description" : "Matches payments with invoice references in description" ,
"criteria" : [
{
"field" : "description" ,
"operator" : "contains" ,
"value" : "INV-"
},
{
"field" : "amount" ,
"operator" : "eq" ,
"allowable_drift" : 0.0
}
]
}
Example Response
{
"rule_id" : "rule_xyz789" ,
"name" : "Stripe Payment Match" ,
"description" : "Matches Stripe payments by exact amount and reference" ,
"criteria" : [
{
"field" : "amount" ,
"operator" : "eq" ,
"allowable_drift" : 0.01
},
{
"field" : "reference" ,
"operator" : "eq"
}
],
"created_at" : "2024-03-04T12:00:00Z" ,
"updated_at" : "2024-03-04T12:00:00Z"
}
Error Responses
Error message describing what went wrong
Common Errors
400 Bad Request : Invalid request body or criteria
500 Internal Server Error : Failed to create matching rule
Best Practices
Start with strict rules : Begin with exact matches and gradually relax criteria if needed
Use allowable drift carefully : For amounts, account for rounding differences or fees
Combine multiple criteria : Use multiple matching criteria for more accurate matches
Test with dry runs : Use the dry run option when starting reconciliation to validate rules