[BR] Services Invoice (NFSe)

What is an NFSe?

An NFSe (Nota Fiscal de Serviço Eletrônica) is the electronic invoice for services in Brazil. It is authorized by the municipality (Prefeitura) where the supplier is established, or through the NFSe Nacional. Brinta sends it to the right authority automatically.

FieldValue
invoice_typedebit
document_typeservices invoice
e_invoicetrue
currencyBRL

When to issue an NFSe

SituationIssue?
Sale of services to a Brazilian business (CNPJ)✅ Yes
Sale of services to an individual (CPF)✅ Yes
Sale of services to a foreign buyer✅ Yes, it is issued as an export of services
Rental, lease or assignment of real estate✅ Yes, but follow Services Invoice for Rental
Sale of goods❌ No, use Goods Invoice (NFe)

Field by Field

Root Level

supplier_company_id

UUID of the issuing company in Brinta. The prestador (CNPJ, Inscrição Municipal, tax regime and address) is pulled from this record. The supplier's municipality must be supported.

invoice_date

Issuance date in YYYY-MM-DD. Also used as the data de competência.

additional_info

Free text appended to the service description (discriminação) on the NFSe. The full description is limited to 2000 characters.


buyer

The buyer is the tomador of the NFSe.

company.type

ValueWhen to useTax registration read
businessLegal entityCNPJ
personIndividual (pessoa física)CPF

company.legal_name

Razão social (business) or full name (person), as registered with Receita Federal.

tax_registrations[]

typeRequiredDescription
CNPJFor business14 digits. Dots, slash and dash are removed automatically.
CPFFor person11 digits.
IMOptionalInscrição Municipal of the tomador.

If no tax registration is sent, the NFSe is issued without a tomador.

company.address

FieldDescription
address_line_1Street with the number at the end ("Alameda Santos 2200"). Trailing digits are sent as the number. With no trailing digits, SN is sent.
address_line_2Complemento.
neighborhoodBairro.
cityMunicipality name ("São Paulo").
stateISO format (BR-SP).
postal_codeCEP.
countryCountry.

Most municipalities reject a tomador with an incomplete address, so send every field. Each one is limited to 40 characters.

Foreign buyers

Send the buyer's foreign tax ID in tax_registrations[].number and a non-BR address.country. The NFSe is issued with the foreign tomador fields and ISS exigibility set to export.


items[]

How items are combined

An NFSe carries one service. If you send several items:

  • amount of every item is summed into the service value.
  • discount of every item is summed into the deductions.
  • The description lists each item as name + description + amount.
  • Taxes, cst and most classification codes are read from the first item only (items[0]): cityServiceCode, nbs code, cClassTrib, operation indicator br and responsavel retencao.
  • The municipal fields are taken from the first item that carries them: Natureza operacao, tipo de tributação, codigo pais prestacao, pis cofins retido and tipo operacao.

If items need different codes, issue one NFSe per item. The safest practice is to put every category on items[0].

categories[]

listRequiredDescription
cityServiceCodeYesMunicipal service code, as defined by the supplier's Prefeitura (i.e. in São Paulo, the São Paulo service code).
nbs codeYesNBS code, 9 digits without dots (1.1801.22.00 → "118012200"). Code list
cClassTribRecommendedIBS/CBS tax classification. Default 000001. Code list
operation indicator brRecommendedIBS/CBS operation type (supply location). Default 100301. Code list
tipo de tributaçãoSão Paulo onlyOne-letter São Paulo taxation type. See São Paulo.
responsavel retencaoOptionalOnly used when ISS is withheld. 1 = withheld by the buyer (default), 2 = withheld by an intermediary.
Natureza operacaoOptional, some PrefeiturasNature-of-operation code, 1 to 6, see the table below. Any other value is rejected.
tipo operacaoOptional, some PrefeiturasNumeric operation type, when the Prefeitura requires one. Sent as is.

Natureza operacao values

CodeDescription
1Taxed in the municipality
2Taxed outside the municipality
3Exempt
4Immune
5Exigibility suspended by court decision
6Exigibility suspended by administrative proceeding

cst

FieldDescription
ibs_cbs3-digit CST for IBS/CBS. Default 000 (Tributação integral).
pis_cofinsOptional CST for PIS/COFINS. Invalid codes are not sent.
📘

Defaults for IBS/CBS

When the IBS/CBS fields are not sent, Brinta applies CST 000, cClassTrib 000001 and operation indicator 100301. Only rely on these defaults when they really describe your operation.

taxes[]

taxes[].name

ValueDescription
ISSImposto Sobre Serviços. Without withholding_type, ISS is due by the supplier. With withholding_type: "withholding", it is ISS retido.
PISPrograma de Integração Social
COFINSContribuição para o Financiamento da Seguridade Social
CSLLContribuição Social sobre o Lucro Líquido
IRRF (or IR)Imposto de Renda Retido na Fonte
INSSContribuição previdenciária
CPContribuição previdenciária (CP)

taxes[].rate

Decimal, never a percentage: 0.02 = 2%.

taxes[].withholding_type

Use withholding on every tax the tomador withholds. Omit it for taxes paid by the supplier.

taxes[].adds_to_final_amount

false for all NFSe taxes.


Municipality-specific rules

Each Prefeitura runs its own NFSe system, so a few fields change with the supplier's municipality (never the buyer's). The payload shape is the same everywhere; only the categories below change.

São Paulo

São Paulo authorizes the NFSe in real time: the response already carries the NFSe number and verification code.

CategoryWhat to send
cityServiceCodeThe São Paulo service code (5 digits).
tipo de tributaçãoOptional. When omitted, São Paulo applies T. Required with P for exports.

tipo de tributação values:

CodeDescription
TTaxed in São Paulo (default)
FTaxed outside São Paulo
ATaxed in São Paulo, exempt
BTaxed outside São Paulo, exempt
DTaxed in São Paulo with partial exemption
MTaxed in São Paulo, subjective immunity
NTaxed outside São Paulo, subjective immunity
RTaxed in São Paulo, objective immunity
STaxed outside São Paulo, objective immunity
XTaxed in São Paulo, exigibility suspended
VTaxed outside São Paulo, exigibility suspended
PExport of services

Export from São Paulo, categories on items[0]:

"categories": [
  { "code": "02800", "list": "cityServiceCode" },
  // São Paulo service code (example only)
  { "code": "118012200", "list": "nbs code" },
  { "code": "P", "list": "tipo de tributação" }
]

Barueri

Barueri processes the NFSe in batches: the invoice stays in process until the Prefeitura returns the batch, and the PDF can be published a while after approval. The XML Barueri returns does not contain the full NFSe data; use the PDF and the verification code as the reference.

CategoryWhat to send
cityServiceCodeThe 9-digit activity code registered for the supplier at the Prefeitura de Barueri. It is not the CNAE: check it in the supplier's municipal registration.
"categories": [
  { "code": "010701220", "list": "cityServiceCode" },
  // 9-digit activity code from the Prefeitura de Barueri (example only)
  { "code": "118012200", "list": "nbs code" },
  { "code": "000001", "list": "cClassTrib" },
  { "code": "100301", "list": "operation indicator br" }
]

Full Example Payload

{
  "supplier_company_id": "{{company_id}}",
  "invoice_type": "debit",
  "document_type": "services invoice",
  "invoice_date": "2026-10-01",
  "invoice_due_date": "2026-10-31",
  "currency": "BRL",
  "e_invoice": true,
  "invoice_external_id": "NFSE-100001",
  "additional_info": "Contrato 2026/015",
  "buyer": {
    "company": {
      "name": "CLIENT TECNOLOGIA LTDA.",
      "legal_name": "CLIENT TECNOLOGIA LTDA.",
      "type": "business",
      "email": "[email protected]",
      "tax_registrations": [
        { "number": "71175537000130", "type": "CNPJ", "level": "country", "location": "BR" },
        { "number": "12345678", "type": "IM", "level": "municipality", "location": "BR-SP" }
        // IM is optional
      ],
      "address": {
        "country": "BR",
        "address_line_1": "Alameda Santos 2200",
        // Street number at the end
        "address_line_2": "Conjunto 51",
        "neighborhood": "Cerqueira César",
        "city": "São Paulo",
        "state": "BR-SP",
        "postal_code": "01418200"
      }
    }
  },
  "items": [
    {
      "item_external_id": "SRV-001",
      "name": "Digital Services",
      "description": "Licença de software - outubro/2026",
      "amount": 2500,
      "categories": [
        { "code": "6491", "list": "cityServiceCode" },
        // Municipal service code from the Prefeitura
        { "code": "118012200", "list": "nbs code" },
        // NBS, 9 digits without dots
        { "code": "000001", "list": "cClassTrib" },
        { "code": "100301", "list": "operation indicator br" }
      ],
      "cst": {
        "ibs_cbs": "000"
      },
      "taxes": [
        { "name": "ISS", "rate": 0.02, "rate_type": "percentage", "amount": 50, "adds_to_final_amount": false },
        // ISS due by the supplier: no withholding_type
        { "name": "IRRF", "rate": 0.015, "rate_type": "percentage", "amount": 37.5, "adds_to_final_amount": false, "withholding_type": "withholding" },
        { "name": "PIS", "rate": 0.0065, "rate_type": "percentage", "amount": 16.25, "adds_to_final_amount": false, "withholding_type": "withholding" },
        { "name": "COFINS", "rate": 0.03, "rate_type": "percentage", "amount": 75, "adds_to_final_amount": false, "withholding_type": "withholding" },
        { "name": "CSLL", "rate": 0.01, "rate_type": "percentage", "amount": 25, "adds_to_final_amount": false, "withholding_type": "withholding" }
        // Taxes withheld by the tomador
      ]
    }
  ]
}

Common Mistakes

MistakeWhat happensFix
Codes sent on the second or later itemcityServiceCode, nbs code, cClassTrib, operation indicator br, responsavel retencao, cst and taxes are ignored there, and the defaults or the first item's values are usedPut all classification codes on items[0], or issue one NFSe per service
Natureza operacao outside 1 to 6Rejected by Brinta before issuingSend a code from the table above, or omit it
NBS sent with dots (1.1801.22.00)The authority rejects the codeSend the 9 digits without dots: "118012200"
Street number in address_line_2 or in the middle of address_line_1The number is sent as SNEnd address_line_1 with the number
Rate sent as a percentage (2)Tax is calculated as 200%Send decimals: 0.02
Withheld tax without withholding_typeTax is treated as due by the supplierAdd "withholding_type": "withholding"
Supplier municipality not supportedThe NFSe cannot be issuedCheck the Prefeituras list
Real-estate rental issued as a regular NFSeRejected for missing property dataFollow Services Invoice for Rental

Did this page help you?