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 client.Reconciliation.CreateMatchingRule to create a matching rule.
1

Call the method

client.Reconciliation.CreateMatchingRule
matchingRule, resp, err := 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.CriteriaArray of match criteria. Each entry sets how one field is compared.
Criteria[].Fieldblnkgo.CriteriaFieldField to match: CriteriaFieldAmount, CriteriaFieldCurrency, CriteriaFieldReference, CriteriaFieldDescription, or CriteriaFieldDate.
Criteria[].Operatorblnkgo.ReconciliationOperatorHow to compare the field: ReconciliationOperatorEquals or ReconciliationOperatorContains.
Criteria[].AllowableDriftfloat64Optional tolerance for amount (percentage) or date (seconds).
2

Save the rule ID

Use matchingRule.RuleID in MatchingRuleIDs when you start reconciliation.
3

Response

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"
}
FieldTypeDescription
rule_idstringUnique ID for the rule. Store it to apply during reconciliation runs.
namestringRule name you passed.
criteriaobject[]The match criteria stored for the rule.
created_atstringWhen the rule was created.
updated_atstringWhen 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.