Brazil Invoice Reconciliation: NF-e/NFS-e XML vs ERP

    by Diego Godoi

    1

    This skill does it in one run and explains each divergence.

    Free

    Security scanned

    Works with the AI Agents you already use

    Brazil Invoice Reconciliation: NF-e/NFS-e XML vs ERP

    Example session with this skill installed

    Here are the 412 purchase XMLs for November and the export of our ERP entries (lancamentos_nov.csv). Reconcile everything and tell me what I need to fix before closing the month.

    • Read your context and instructions
    • Compiled the brazil invoice reconciliation
    • Generated the data export

    Exemplo com dados fictícios.

    Conciliação fiscal — novembro/2026

    • XMLs lidos: 412 (+3 eventos de cancelamento, 2 arquivos ignorados)
    • Lançamentos no ERP: 409
    • Total dos XMLs válidos: R$ 1.284.937,40 · Total no ERP: R$ 1.279.512,15 · Diferença: R$ 5.425,25
    DivergênciaQtd.
    SEM_LANCAMENTO4
    VALOR_DIVERGENTE3
    LANCADA_CANCELADA1
    SEM_XML2
    LANCAMENTO_DUPLICADO1
    FORA_DO_PERIODO5

    O que corrigir antes de fechar

    1. Nota 18.442 (Fornecedor Alfa) cancelada e lançada — estornar R$ 2.310,00 e o crédito de ICMS.
    2. 4 notas sem lançamento (R$ 3.880,10): três de frete e uma de material de escritório.
    3. Valor divergente na nota 9.115: XML R$ 1.465,00 × ERP R$ 1.415,00 — o lançamento ignorou o IPI.
    4. Lançamento duplicado da chave ...0147 (linhas 88 e 203).
    5. 2 lançamentos sem XML: pedir os arquivos aos fornecedores (rascunho de e-mail abaixo).

    Planilha completa: conciliacao_nov_divergencias.csv (abre direto no Excel).

    conciliacao_nov_divergencias.csv

    CSV · data export

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Close the month without fiscal surprises

    Accountants and finance teams in Brazil spend hours matching invoice XMLs against what was booked in the ERP. This skill does it in one run and explains each divergence.

    What it checks

    DivergenceWhy it matters
    XML not bookedmissing expense or revenue, lost tax credit
    Booked without XMLno fiscal support for the entry
    Wrong amounttyping errors, discounts, freight left out
    Cancelled invoice bookedimproper credit, must be reversed
    XML without SEFAZ authorizationnot a valid invoice yet
    Duplicated bookingdouble credit risk
    Outside the periodwrong accrual month

    How it works

    1. Point the agent to a folder of XMLs and a CSV export of your ERP (key, or CNPJ + number, and amount).
    2. A tested Python script reads NF-e/NFC-e (models 55/65), NFS-e Padrão Nacional and NF-e cancellation events, matches by access key (or CNPJ + number) and applies a rounding tolerance.
    3. You get an Excel-ready divergence sheet (semicolon, decimal comma), a summary with totals XML × ERP, and the agent explains causes and fixes, drafts supplier requests and groups results as you need.

    Runs locally with the Python standard library: your fiscal data never leaves your machine.

    Reads NF-e/NFC-e (models 55/65), NFS-e Padrão Nacional and NF-e cancellation events; CT-e and municipal NFS-e layouts are not read. Does not query SEFAZ: include cancellation XMLs to detect cancelled invoices. The ERP export must be CSV.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 9 days ago

    • Free with an Agensi account

    Software
    Python 3.8+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed9 days ago

    What's inside

    Frequently Asked Questions

    Any ERP or accounting system that exports CSV. The agent maps your column names (key, CNPJ, number, amount) before running.

    No. It checks the files you provide. Include cancellation event XMLs to detect cancelled invoices, or check doubtful keys on the SEFAZ portal.

    Yes, the national standard (Padrão Nacional). Municipal layouts that differ from it are not read.

    The script runs locally with the Python standard library and makes no network calls. Your agent reads the results to explain them.

    Thousands per run; it reads the folder recursively and skips files that are not invoices, listing them separately.

    Yes. It answers in the language you write in; report column names stay in Portuguese, as accountants in Brazil expect.

    New in Finance & Accounting

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Finance & Accounting.

    Free