Updates the data of a Service Invoice (NFS-e) that has not yet been issued.
Use this operation to change an invoice with SCHEDULED or ERROR status. After issuing, the invoice data can no longer be modified through this endpoint.
Updating the data does not mean the NFS-e is issued. To track the subsequent processing steps, use the Webhooks for invoices.
Real estate operations and the Tax Reform
For rental, assignment, leasing, management, or brokerage services involving real estate, the Tax Reform requires additional fields to be filled in within taxes: operationTypeCode, referencedInvoiceAccessKeyList and realEstateInfo. These fields only apply to services with a real estate-related National Tax Code (federalServiceTaxCode); do not provide them for other services.
Operation type (taxes.operationTypeCode)
Can only be provided when the service used on the invoice is configured with a federalServiceTaxCode that starts with 25.05, 15.09, 17.12 or 10.05. For any other code, the field is not accepted.
| Code | Meaning | Requires referencedInvoiceAccessKeyList? |
|---|---|---|
| 1 | Supply with later payment | No |
| 2 | Receipt of payment with supply already provided | Yes |
| 3 | Supply with payment already made | Yes |
| 4 | Receipt of payment with later supply | No |
| 5 | Simultaneous supply and receipt of payment | No |
If the service requires the field and it is not provided, the API returns "Código do tipo de operação deve ser informado para este código de tributação nacional.". If it is provided for a service that does not allow it, the API returns "Código do tipo de operação não pode ser informado para este código de tributação nacional.". Outside the range of 1 to 5, the API returns "Código do tipo de operação inválido. Deve ser um valor entre 1 e 5.".
Referenced NFS-e key (taxes.referencedInvoiceAccessKeyList)
Required when operationTypeCode is 2 or 3, so that the city hall or the National Portal can link the invoice to the already issued NFS-e related to the same operation. Each key must contain exactly 50 numeric characters, with a minimum of 1 and a maximum of 99 keys per invoice.
If required and missing, the API returns "A chave da NFS-e referenciada deve ser informada para o tipo de operação selecionado.". An invalid format in any item returns "Chave da NFS-e referenciada inválida. Deve conter 50 caracteres numéricos.". Above 99 keys, the API returns "Quantidade de chaves de NFS-e referenciadas excede o limite permitido.".
Real estate data (taxes.realEstateInfo)
Depends on two other fields of the service used on the invoice: the National Tax Code (federalServiceTaxCode) and the operation indicator (taxes.operationIndicatorCode).
federalServiceTaxCode | operationIndicatorCode | realEstateInfo |
|---|---|---|
one of the codes 07.02.01, 07.02.02, 07.04.01, 07.05.01, 07.05.02, 07.06.01, 07.06.02, 07.07.01, 07.08.01, 07.17.01, 07.19.01 | any | not allowed |
| any other | 020101, 020201 or 020301 | required |
| any other | any other value | not allowed |
If required and missing, the API returns "As informações do imóvel devem ser informadas para o indicador de operação informado.". If not allowed and provided, the API returns "As informações do imóvel não podem ser informadas para este serviço ou indicador de operação.".
Fields not sent in the updateWhen updating an invoice, if
operationTypeCode,referencedInvoiceAccessKeyListorrealEstateInfoare not sent in the payload, the values already recorded on the invoice are kept.Sending one of these fields, even with an empty or
nullvalue, changes or removes the currently recorded value. Therefore, send only the fields you want to modify.
Automatic removal on updateIf
operationTypeCodeis changed to a value that no longer requiresreferencedInvoiceAccessKeyList, the list of keys is automatically removed from the invoice. IfoperationIndicatorCodeis changed to a value outside the real estate set,realEstateInfois automatically removed from the invoice.
Related content
Guides
- PIS/COFINS withholding and tax situation settings
- Invoices
- Adapting your integration to the Tax Reform
Webhooks
404Not found
