---
title: "Cancelar NFS-e."
url: "https://devcenter.stone.com.br/apis/stone-tax/versions/206fd1c1-6382-4ada-8612-c67fdc65e050/paths/api-v1-Nfse-filtro--Cancelar/post"
---

> Full API specification: https://devcenter.stone.com.br/apis/stone-tax/versions/206fd1c1-6382-4ada-8612-c67fdc65e050.md

# Cancelar NFS-e.

`POST` `/api/v1/Nfse/{filtro}/Cancelar`

Inicia o processo de <strong>cancelamento</strong> de uma Nota Fiscal de Serviços Eletrônica (NFS-e) junto ao ADN. ⚠️ **RESTRIÇÕES**: Somente NFS-e com status <strong>Autorizada</strong> podem ser canceladas. O campo `filtro` aceita **ChaveNfse** ou **Código ERP**.

## Path parameters

- `filtro` (string, required) - ChaveNfse ou Código ERP.

## Header parameters

- `DocumentoEmissor` (string, required) - Documento do emissor.

## Request body

Content types: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json`

## Responses

- `204` - No Content
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `500` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.4
info:
  title: Stone Tax API
  version: 1.0.0
servers:
  - url: https://stone-tax-sdx.stone.com.br
    description: Ambiente de Desenvolvimento
  - url: https://stone-tax.stone.com.br
    description: Ambiente de Produção
paths:
  /api/v1/Nfse/{filtro}/Cancelar:
    post:
      tags:
        - Nfse
      summary: Cancelar NFS-e.
      description: >-
        Inicia o processo de <strong>cancelamento</strong> de uma Nota Fiscal de
        Serviços Eletrônica (NFS-e) junto ao ADN.
                    
        ⚠️ **RESTRIÇÕES**: Somente NFS-e com status <strong>Autorizada</strong>
        podem ser canceladas.
                    
        O campo `filtro` aceita **ChaveNfse** ou **Código ERP**.
      parameters:
        - name: filtro
          in: path
          description: ChaveNfse ou Código ERP.
          required: true
          schema:
            type: string
        - name: DocumentoEmissor
          in: header
          description: Documento do emissor.
          required: true
          schema:
            type: string
      requestBody:
        description: Dados para o cancelamento da nota fiscal de serviço.
        content:
          application/json-patch+json:
            schema:
              $ref: "#/components/schemas/CancelarNotaFiscalInputModel"
          application/json:
            schema:
              $ref: "#/components/schemas/CancelarNotaFiscalInputModel"
          text/json:
            schema:
              $ref: "#/components/schemas/CancelarNotaFiscalInputModel"
          application/*+json:
            schema:
              $ref: "#/components/schemas/CancelarNotaFiscalInputModel"
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseErrorResult"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseErrorResult"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseErrorResult"
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseErrorResult"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseErrorResult"
      security:
        - BearerAuth: []
security:
  - BearerAuth: []
components:
  schemas:
    CancelarNotaFiscalInputModel:
      required:
        - justificativa
      type: object
      properties:
        justificativa:
          maxLength: 255
          minLength: 15
          type: string
          description: Justificativa do cancelamento. (Mínimo de 15 caracteres)
      additionalProperties: false
      description: Dados para cancelamento de nota fiscal (NFe ou NFCe).
    ResponseErrorResult:
      type: object
      properties:
        status:
          type: integer
          format: int32
        titulo:
          type: string
          nullable: true
        erros:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      description: Autenticação via token JWT. Obtenha o token através do endpoint
        /Autenticacao/ObterToken usando Basic Auth. O token expira em 1 hora.
      scheme: bearer
      bearerFormat: JWT
```
