Skip to main content
PUT
/
reconciliation
/
matching-rules
/
{id}
Update matching rule
curl --request PUT \
  --url http://localhost:5001/reconciliation/matching-rules/{id} \
  --header 'X-blnk-key: <api-key>'
Use client.Reconciliation.UpdateMatchingRule to update a matching rule.
1

Call the method

client.Reconciliation.UpdateMatchingRule
updatedRule, resp, err := client.Reconciliation.UpdateMatchingRule(
	"rule_890bdbc4-467f-4670",
	blnkgo.Matcher{
		Name: "Amount match (updated)",
		Description: "Match by amount with 2% drift",
		Criteria: []blnkgo.Criteria{
			{
				Field: blnkgo.CriteriaFieldAmount,
				Operator: blnkgo.ReconciliationOperatorEquals,
				AllowableDrift: 0.02,
			},
			{
				Field: blnkgo.CriteriaFieldCurrency,
				Operator: blnkgo.ReconciliationOperatorEquals,
			},
		},
	},
)
FieldTypeDescription
ruleIDstringID of the matching rule to update.
NamestringUpdated name for the rule.
DescriptionstringUpdated description of what the rule does.
Criteria[]blnkgo.CriteriaFull replacement array of match criteria.
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

Verify the changes

Read fields on the returned *blnkgo.RunReconResp to confirm the updated criteria and description. The rule ID stays the same.
3

Response

200 OK
{
  "rule_id": "rule_890bdbc4-467f-4670-8424-5667e41daf29",
  "name": "Amount match (updated)",
  "description": "Match by amount with 2% drift",
  "criteria": [
    {
      "field": "amount",
      "operator": "equals",
      "allowable_drift": 0.02
    }
  ],
  "created_at": "2024-11-26T08:36:36.238244338Z",
  "updated_at": "2024-12-01T10:15:00.000000000Z"
}
FieldTypeDescription
rule_idstringUnchanged ID of the rule.
namestringUpdated rule name.
criteriaobject[]The updated match criteria stored for the rule.
updated_atstringWhen the rule was last updated.

How reconciliation works

Criteria, operators, and drift behavior.

Update 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.