Guide · Nexus
Bank reconciliation via API
Bank reconciliation is comparing what the bank recorded with what the ERP expects, record by record, to say what matches, what differs and what is missing. Through an API, that comparison stops being a monthly spreadsheet and runs on every piece of data that arrives.
What you need: two sources and a rule.
Every reconciliation has two sides. In Nexus, each side is a data source that feeds a dataset, and the rule that compares them is a rule set. To reconcile bank and ERP:
- Bank statement
- Open Finance transactions, or the file the bank delivers: CSV, XLSX or Francesinha (.fra).
- ERP
- A Postgres table with the entries, or JSON events sent to an inbound webhook.
Step by step, in four calls.
1Connect the sources
Create data sources of type webhook, file, Postgres, Open Finance or Openi.
2Model the fields
Datasets hold the records. Fields extract canonical keys, such as amount and doc, for the rules to use.
3Define the rules
A rule set matches two datasets with a JSONata expression and scoring parameters.
4Receive the matches
Each result arrives by webhook signed with HMAC-SHA-256, with configurable retries.
curl -X POST "https://nexus-api.openi.com.br/v1/data-sources" \
-H "x-api-key: $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "webhook",
"name": "transacoes_banco_x",
"config": {
"secret": "a-secret-with-at-least-16-chars",
"slug": "transacoes-banco-x"
}
}'How to read the result.
Every pair of records compared comes back with a score and a decision. The result arrives by webhook signed with HMAC-SHA-256, in the events match.created and reconciliation_job.completed.
- MATCH
- The two records agree under the rule. They need no review.
- POSSIBLE
- They are similar, but the score is not enough to confirm. This is what goes to the review queue.
- NO_MATCH
- The pair does not match. The record stays without a counterpart on the other side.
Not every payment is one to one. Nexus also reconciles 1:N, N:1, partial payments and installments: one deposit that settles several invoices, or one invoice paid in more than one transfer.
In production: NDD.
NDD uses Nexus to reconcile more than 100 million records. Data comes in by file, database or webhook, the rule set matches the two sides and each pair comes back with a decision and a score, with no manual queue for what checks out.
See also the Nexus page and the API reference.
