Reconciliation

Create matching rule

Create a reconciliation matching rule with the Go SDK.

POST/reconciliation/matching-rules

Use 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,
		},
	},
})
FieldTypeDescription
NamestringName of the matching rule.
DescriptionstringShort 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: CriteriaField
Amount, CriteriaField
Currency, CriteriaField
Reference, CriteriaField
Description, or CriteriaField
Date.
Criteria.
[].Operator
blnkgo.
ReconciliationOperator
How to compare the field: ReconciliationOperator
Equals or ReconciliationOperator
Contains.
Criteria.
[].AllowableDrift
float64Optional 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)

FieldTypeDescription
RuleIDstringUnique ID for the rule. Store it to apply during reconciliation runs.
NamestringRule name you passed.
DescriptionstringShort description of what the rule does.
Criteria[]blnkgo.
Criteria
The match criteria stored for the rule.
CreatedAtstringWhen the rule was created.
UpdatedAtstringWhen the rule was last updated.