Reconciliation
Create matching rule
Create a reconciliation matching rule with the Go SDK.
POST
/reconciliation/matching-rulesUse client.Reconciliation.CreateMatchingRule to create a matching rule.
Call the method
matchingRule, _, _ := client.Reconciliation.CreateMatchingRule(blnkgo.Matcher{
Name: "Amount match",
Description: "Match by amount with 1% drift",
Criteria: []blnkgo.Criteria{
{
Field: blnkgo.CriteriaFieldAmount,
Operator: blnkgo.ReconciliationOperatorEquals,
AllowableDrift: 0.01,
},
{
Field: blnkgo.CriteriaFieldCurrency,
Operator: blnkgo.ReconciliationOperatorEquals,
},
{
Field: blnkgo.CriteriaFieldReference,
Operator: blnkgo.ReconciliationOperatorContains,
},
},
})
| Field | Type | Description |
|---|---|---|
Name | string | Name of the matching rule. |
Description | string | Short description of what the rule does. |
Criteria | []blnkgo.Criteria | Array of match criteria. Each entry sets how one field is compared. |
Criteria.[].Field | blnkgo.CriteriaField | Field to match: CriteriaFieldAmount, CriteriaFieldCurrency, CriteriaFieldReference, CriteriaFieldDescription, or CriteriaFieldDate. |
Criteria.[].Operator | blnkgo.ReconciliationOperator | How to compare the field: ReconciliationOperatorEquals or ReconciliationOperatorContains. |
Criteria.[].AllowableDrift | float64 | Optional tolerance for amount (percentage) or date (seconds). |
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"
}Go response (*blnkgo.RunReconResp)
| Field | Type | Description |
|---|---|---|
RuleID | string | Unique ID for the rule. Store it to apply during reconciliation runs. |
Name | string | Rule name you passed. |
Description | string | Short description of what the rule does. |
Criteria | []blnkgo.Criteria | The match criteria stored for the rule. |
CreatedAt | string | When the rule was created. |
UpdatedAt | string | When the rule was last updated. |