> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stchat.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Client invoices

> Connect NFE.io, set up the service and the tax, and issue the invoice (NFS-e) for paid statements.

## What it is for

This is where the agency issues service invoices (NFS-e) for its clients. Invoices are issued in your agency's name, through your own NFE.io account. STChat only asks NFE.io to issue the invoice using your key and does not keep the invoice on your behalf.

## Who can do it

Only the Owner sets up invoices. Issuing and canceling stay with the Admin.

## Where to click

In the portal, open **Invoices (NFS-e)** (`/notas`). The **Configure** button takes you to **Set up invoices** (`/notas/configurar`).

## Step by step: set up

**1. Connect the NFE.io account**

Under **NFE.io account**, paste the **API key** (in NFE.io, under Account, Access keys) and the **Company ID at NFE.io**. Click **Test connection**.

**2. Enter the service and the tax**

Fill in **Service code (LC 116)**, **ISS rate (%)** (from 0 to 5), the **Invoice description** and, if it applies, **ISS withheld by the client**.

**3. Choose when to issue**

**Automatic on payment**: the invoice is issued when Stripe confirms the payment of the statement. **Manual**: you issue it in Invoices, with the **Issue invoice** button.

**4. Copy the notification address**

Under **NFE.io notification address**, copy the address and paste it in the NFE.io dashboard. This way the city's response comes back to STChat.

**5. Save**

Click **Save and turn on invoices**. After that, the button becomes **Save**.

## Step by step: issue and follow up

**1. Click Issue invoice**

Under **Choose the client**, select the month's statements. The statement must be paid.

**2. Follow the status**

Use the filters **All**, **Issued**, **Processing**, **With error**, and **Cancelled**. Each invoice has a **PDF** and an **XML**.

**3. Fix an invoice with an error**

If the city rejects it, fix the document in the organization's record (**Open organization**) and click **Issue again**.

To undo an invoice, use **Cancel invoice**. The cancellation is requested from NFE.io and the city confirms it in a few moments.

## What happens next

The invoice goes from **Processing** to **Issued**. If you disconnect NFE.io, new invoices stop being issued, and the ones already issued stay at NFE.io.

## Common errors

* "This statement cannot generate an invoice yet (it must be paid)."
* "Paste the NFE.io API key."
* "Enter the company, the service code and an ISS from 0 to 5%."
* "NFE.io did not accept this key."
* "We did not find this company in your NFE.io account."
* "The company exists in NFE.io, but it has no municipal registration (inscrição municipal) for NFS-e."
* "NFE.io did not respond. Try again shortly."

## Next step

* [Client statements](https://docs.stchat.app/en/agencias/extratos.md)
* [Getting paid by clients through Stripe](https://docs.stchat.app/en/agencias/receber-dos-clientes-pela-stripe.md)
* [Organizations](https://docs.stchat.app/en/agencias/organizacoes.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.