AI for Invoice Issuing and Checking in Brazil: Review Before You Emit

AI for Invoice Issuing and Checking in Brazil: Review Before You Emit

How AI drafts and checks invoice data in Brazil, using fixed rules, human approval and a record of each decision before issuing. A guide for managers.

•

Want to apply this in your company?

Book a call with Juan →

Superintelligence, in the sense the term carries in technical debate, is not yet what issues invoices in a Brazilian company. What works today is an AI that reads the order, extracts the data, compares it with the company's records and flags what does not match, while a person checks it and authorizes the invoice in the tax system. In practice, the AI prepares and checks. The company remains responsible for every invoice, through the people it has authorized to issue them.

Key takeaways

  • The AI drafts the tax data from an order, quote or message, without issuing anything on its own.
  • The check matches each field against the customer and product records, and against rules that the company and its accountant define.
  • Mismatches go to a review queue with a clear reason, instead of being silently corrected by the model.
  • Issuing remains an act of an authorized person, with a record of who approved it and when.
  • The best starting point is one invoice type, one intake channel and one error metric measured before and after.

Why invoices do not accept improvisation

An invoice carries information that the customer, the federal tax authority (Receita Federal), the municipal tax office and the accountant will all use later. The most common errors appear in recipient data (CPF or CNPJ tax numbers, state registration, address), in the description and classification of the product or service, in the nature of the operation, and in the amounts. Once an error is issued, the way out is usually cancellation, a correction letter where the rules allow one, or rework with the accountant. All of that consumes the team's time and strains the customer relationship.

For that reason, the gain from AI at this step is not speed of issuing. It is reducing how many entries reach issuing with a typo, a missing field or a doubtful classification. An automation that speeds up the issuing of invoices with wrong data only spreads the problem faster.

What AI does well at this step

Orders arrive by WhatsApp as free text, by email, as a quote in PDF or in a spreadsheet. The AI reads these formats, identifies the customer, the items and the quantities requested, and organizes them into structured fields. It also normalizes what is ambiguous, such as an address written in two different ways, and suggests the match with the product catalog that the company has already approved.

Some tasks should not stay with the AI alone. Setting the tax treatment, choosing a tax code without a reference table, deciding how an operation is classified and issuing the invoice are decisions with their own rules. When the model is not certain, the correct response is to mark the doubt and route it to a person, not to fill the field with the most likely guess.

Designing the flow: the AI proposes, the rules validate, a person approves

Split the flow into three layers. The first is deterministic: format validation for CPF and CNPJ numbers, required fields, whether the product exists in the catalog, and the limits the company has set. These are common software rules, testable and predictable. The second is the AI, which interprets the free text and proposes the fields. The third is the authorized person, who sees the proposal, the source of each field and the mismatches, and then decides.

A minimal design usually follows this order:

  • Intake: the order arrives through a defined channel, with the original text stored.
  • Extraction: the AI returns the fields in a fixed format, with no free text in between.
  • Validation: the deterministic rules test each field and return what failed.
  • Review: a mismatch goes to a queue with its reason and suggestion, not to issuing.
  • Approval: a person with permission checks and releases it, or corrects it and releases it.
  • Record: the system keeps who approved, what changed and which rule was triggered.

Checklist before releasing issuing

This checklist is a starting point for discussion with the accountant and the team that issues invoices. Adjust the items to your operation before any pilot.

  • Recipient with a valid tax number and a complete address, checked against the customer record.
  • Each item found in the catalog, with a tax classification taken from a table approved by the accountant.
  • Nature of the operation stated and consistent with the type of sale or service.
  • Amounts recalculated by rule, not copied from the text the customer sent.
  • No field filled by an AI guess without a visible review mark.
  • Mismatches recorded with reason, owner and date.
  • Approval made by a person with permission, with that identity recorded.

Illustrative scenario: a parts order over WhatsApp

Illustrative scenario: a repair shop receives a WhatsApp message from a customer asking for parts and giving the tax number of the buying company. The agent extracts the items, quantities and document number, and checks them against the records. One of the parts has no tax classification on file, and the company's postal code differs from the one registered. Instead of completing the fields, the flow marks both points, sends the mismatch to the customer service agent and tells the customer that the order is under review. The agent corrects the part record with the accountant's guidance, confirms the address with the customer and only then does the person responsible for issuing release the invoice. The full history stays on record: the original message, the AI's proposal, the rules that fired and who approved.

How to pilot without putting invoicing at risk

The approach we follow is to map the current process, limit data and actions, pilot a real flow with records and a metric agreed in advance, and then decide whether to expand, adjust or stop. In practice, a pilot usually starts with one invoice type, one intake channel and a controlled group of customers. The metric must be agreed before starting, for example the number of invoices canceled or corrected because of data errors, compared with the previous period.

Before touching the live tax system, test with deliberate error cases: an invalid CNPJ, a product with no record, an order with odd instructions inside the text, and an incomplete address. Test tools with simulated data and an isolated environment let you reproduce these situations safely. The guide on mock tools and sandbox testing for AI agents helps organize this step.

Risks and controls

Text that arrives from a customer is not trustworthy. A message can contain instructions written to mislead the model, such as asking for a discount or telling it to ignore a rule. The OWASP project describes this kind of attack, called prompt injection, and recommends treating input as data, never as a command. In practice, the extraction agent should not have permission to issue, only to read and propose, and the output must pass through a fixed format before any next step.

The NIST AI Risk Management Framework organizes the risk conversation around govern, map, measure and manage. It helps bring the topic to the board in common language: who is responsible for each rule, how performance is measured and what happens when the system gets something wrong. The LGPD, Brazil's data protection law, also applies here, because customer names, tax numbers and addresses are personal data. Whoever decides on issuing should be able to explain the reason for each automated decision and have a path to human review, a topic covered in the article on automated decisions and Article 20 of the LGPD.

Frequently asked questions

Can superintelligence issue invoices on its own? For most companies, no, and the term often appears in exaggerated form in sales material. What gets implemented in practice are flows with limited scope: reading, extraction, checking and proposal, with issuing done by an authorized person in the tax system. If the question is the gap between what is advertised and what a language model actually does, read the article on ChatGPT and superintelligence.

Does AI replace the accountant or the tax team? No. The accountant defines the tax rules, the classification table and the nature of the operations, and the AI uses those rules as a reference without inventing them. When a case falls outside the standard, the flow should route it to the right person with the context organized, not resolve it alone. For accounting firms that handle this routine for their clients, the article on superintelligence in accounting firms covers the details.

Do I need to send customer data to an AI model? It depends on where the model runs, the contract in use and which fields are truly needed for the task. The LGPD requires a defined purpose and proportionality, so good practice is to send only what extraction requires and mask the rest. Before deciding, check the guidance published by the ANPD, Brazil's data protection authority, and record in the flow design which data leaves the company and for what purpose.

How long does it take to put a flow like this into operation? The timeline depends on invoice volume, the quality of the product and customer records, and the number of intake channels. A pilot usually starts with one type of operation and a small group, and only after measuring errors is the decision made to expand, adjust or stop. Estimating a timeline without knowing the process would be guesswork, which is why the initial diagnosis comes before any schedule promise.

Sources

AI for invoicingBrazilfiscal complianceAI operationsLGPD