Quick answer: you can issue a fiscal invoice and generate a boleto (Brazilian bank payment slip) from inside your own system, through an integration with services that talk to the city hall, the state Finance Department and the bank. There is no single path: the product invoice (NF-e, electronic invoice for goods) and the service invoice (NFS-e, electronic service invoice) follow different rules, and the boleto depends on a bank or payment provider. On billing, the integration value falls within Luna's range for a system with external integration, from $840 to $1,920 for the full system, in 3 to 6 weeks. How much issuing the invoice and the boleto actually costs depends on the issuer and the bank you choose, and you should check those amounts with them.

Which invoice your company needs to issue is decided by your accountant, not by the developer. The role of the system is to take the order data, send it to the issuer, store the result and show the status to whoever needs it. This guide explains the parts, the ways to integrate and the precautions so that issuing does not become a headache.

Product invoice and service invoice: what changes

The NF-e documents the movement of goods or the provision of services between the parties. The São Paulo State Finance Department, on its portal, describes the NF-e as "a document that exists only in digital form", issued and stored electronically, whose legal validity is guaranteed by the sender's digital signature and by the tax authority receiving the document before the taxable event.

For services, the federal government offers the NFS-e National Standard. The service page on gov.br states that issuing is available through the NFS-e Web Issuer, the NFS-e Mobile app and, for in-house systems, through an API, and that issuing by API requires prior accreditation in the Taxpayer Panel. The same page lists as eligible users the companies established in municipalities that have joined: if your municipality does not take part in the national standard, the way to issue may be different.

TypeWhat forWhat to check first
NF-eSale of goodsTax regime, registration with the state Finance Department and digital certificate
NFS-eProvision of servicesWhether the municipality has joined the national standard or uses its own system
Others (NFC-e and the rest)Specific casesYour accountant's guidance; the rules vary

Note: the digital certificate, tax regime and other requirements vary case by case. This guide does not state deadlines, fees or specific requirements beyond what the official pages cited say. Confirm everything with your accountant and with the body of your municipality and state.

Boleto: what the system does

The boleto is a charge registered with a bank. The system does not "create" the boleto on its own: it asks the bank, or a payment provider, to generate the charge with the amount, due date and customer data, and then receives the information that it was paid. Boleto fees, clearing times and registration rules vary by bank and provider, and we do not state amounts here. Before choosing, ask for the current fee schedule and the conditions in writing.

What the system should take care of: generating the charge from the order, showing the boleto to the customer, receiving the payment confirmation, writing it off automatically and flagging overdue payments. This reconciliation, knowing what was paid, what is overdue and what was cancelled, is where the integration saves the most manual work.

Three ways to integrate

  1. Issue outside and record inside. The invoice is issued through the government portal or your accountant's system, and you attach the file to the order. It is the simplest, but it still requires manual work.
  2. Integrate with an issuer or provider. Your system sends the data to a specialized service, which handles the communication with the tax authority and the boleto, and returns the result. This is usually the most common path for small businesses. The issuer's cost is set by the supplier; check their current plans.
  3. Integrate directly with the authority or the bank. For the NFS-e National Standard, this is the option of API for in-house systems, with prior accreditation. It gives more control, but requires more maintenance and monitoring of changes.

The choice depends on the volume of invoices, the type of invoice and how much control you want. A general explanation of the concepts of API and webhook is in systems integration: API, ERP, Pix and fiscal invoices.

How the day-to-day workflow looks

  1. The order is closed in the system, with the customer and item data.
  2. The system validates the record: document, address and tax treatment of the item.
  3. It sends the data to the issuer and stores the response: authorized, rejected or pending.
  4. With the invoice authorized, it generates the charge (boleto, Pix (Brazil's instant payment system) or card) and sends it to the customer by email or message. For messages, see integrating a system with WhatsApp.
  5. When the payment is confirmed, the system writes it off and updates finance.
  6. In case of an error, the person responsible is notified and corrects it, without losing the order.

What the system needs in place for this to work

  • Complete records of customers and products or services, with the data the invoice requires.
  • Visible status for each invoice and each charge.
  • Queue and retries: if the service on the other side is offline, the order waits and tries again.
  • A record of everything sent and received, for audit and support.
  • Storage of invoice files and receipts for as long as your accountant advises.
  • Access profiles: who can issue, cancel and see finance. See permissions by profile.

How much integrating costs

ItemAmountSource
Integration development in the systemSystem with external integration: $840 to $1,920, 3 to 6 weeksLuna's price list
Invoice issuer or payment providerDepends on the supplier and the volumeCheck with the supplier
Boleto fee at the bankDepends on the bankCheck with the bank
Accountant and digital certificateDepends on the caseCheck with your accountant

Luna's range refers to a system with external integration. If you do not have a system yet, the base cost is in how much a custom management system costs. To decide between a system that already issues invoices and a custom one, see custom system or ready-made ERP.

Common mistakes when integrating invoices and boletos

  • Starting with the code and leaving the accountant for later. First define which invoice to issue and how; then develop.
  • Incomplete records. Missing data on the customer or product is the most common cause of a rejected invoice.
  • Not handling rejections. The system needs to show the reason and allow correction and resubmission.
  • Issuing twice. Without control, a repeated click generates two invoices or two charges.
  • Forgetting reconciliation. Generating the boleto is the easy part; knowing what was paid and writing it off is what saves time.
  • Ignoring rule changes. Tax rules change; agree on who follows and updates them.
  • Handling customer data carelessly. Documents and addresses are personal data; see LGPD for small business systems.

Where to start

Start with a single integration and stabilize it before growing: for example, only the boleto or Pix billing, or only the service invoice. Then add the other one. It is the same logic as an MVP: validate with real use before expanding. To see how automation saves hours in billing, see how to automate business processes.

How Luna does it

At Luna Next-Gen, we treat each integration as part of the system, with a queue, retries and a record of everything sent. Before developing, we ask your accountant to confirm the type of invoice and the issuer. The payment method is agreed in the proposal, and there is a 6-month warranty for bug fixes. Request a quote and tell us which invoice you issue today and how you charge your customers.

Frequently asked questions

Can I issue a fiscal invoice (nota fiscal) from inside my system?

Yes. The system sends the order data to an issuer or to the responsible authority and stores the result. The type of invoice and the rules depend on your activity and on your municipality or state, and your accountant is the one who defines them.

What is the difference between NF-e and NFS-e?

The NF-e (electronic product invoice) documents the movement of goods or the provision of services between the parties, and it is digital. The NFS-e (electronic service invoice) is the service invoice; the federal government offers the National Standard, used by companies in municipalities that have joined it.

Does the National Standard NFS-e have an API?

According to gov.br, there is API integration for in-house systems, and it requires prior accreditation in the Taxpayer Panel. The page lists companies in municipalities that have joined as eligible users.

How much does it cost to integrate invoice and boleto?

An integration in a system with external integration costs between $840 and $1,920 at Luna, in 3 to 6 weeks. The cost of the issuer, the bank's fee and the digital certificate depends on each supplier, and you should check with them.

Does the system generate the boleto by itself?

It asks a bank or payment provider to issue the charge, shows the boleto (Brazilian bank payment slip) to the customer and receives the payment confirmation to write it off. Fees and deadlines vary by bank.

What happens if the invoice is rejected?

The system should show the reason, allow you to correct the data and resubmit without losing the order. Incomplete records are the most common cause.

Where should I start the integration?

With a single integration, for example the billing or the service invoice, stabilizing it before adding the next one. Confirm the type of invoice and the issuer with your accountant first.