Update invoice

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.

⚠️

Update restriction

Only invoices with SCHEDULED or ERROR status can be updated.

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.

CodeMeaningRequires referencedInvoiceAccessKeyList?
1Supply with later paymentNo
2Receipt of payment with supply already providedYes
3Supply with payment already madeYes
4Receipt of payment with later supplyNo
5Simultaneous supply and receipt of paymentNo

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).

federalServiceTaxCodeoperationIndicatorCoderealEstateInfo
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.01anynot allowed
any other020101, 020201 or 020301required
any otherany other valuenot 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 update

When updating an invoice, if operationTypeCode, referencedInvoiceAccessKeyList or realEstateInfo are not sent in the payload, the values already recorded on the invoice are kept.

Sending one of these fields, even with an empty or null value, changes or removes the currently recorded value. Therefore, send only the fields you want to modify.

⚠️

Automatic removal on update

If operationTypeCode is changed to a value that no longer requires referencedInvoiceAccessKeyList, the list of keys is automatically removed from the invoice. If operationIndicatorCode is changed to a value outside the real estate set, realEstateInfo is automatically removed from the invoice.

Related content

Guides

Webhooks

Path Params
string
required

Unique invoice identifier in Asaas

Body Params
string

Description of invoice services

string

Additional observations

string

Invoice identifier in your system

number

Total value

number

Deductions. Deductions do not change the total value of the invoice, but they do change the ISS calculation basis.

date

Invoice issuance date

boolean

Update the Payment amount with the invoice taxes already deducted.

taxes
object

Invoice taxes

Responses

404

Not found

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json