---
title: "DANFE NFS-e (PDF)."
url: "https://devcenter.stone.com.br/apis/stone-tax/versions/206fd1c1-6382-4ada-8612-c67fdc65e050/paths/api-v1-Nfse-filtro--ObterDanfe/get"
---

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

# DANFE NFS-e (PDF).

`GET` `/api/v1/Nfse/{filtro}/ObterDanfe`

Recupera a representação gráfica da NFS-e, conhecida como <strong>DANFE (Documento Auxiliar da Nota Fiscal de Serviços Eletrônica)</strong>. 📄 **FORMATO DE SAÍDA**: O recurso retorna o arquivo em formato <strong>PDF</strong>, codificado em <strong>Base64</strong>. Para a visualização, o sistema consumidor deve realizar o decode da string e salvar o binário com a extensão `.pdf`. 🔍 **DISPONIBILIDADE**: O documento só poderá ser obtido para notas com status <strong>Autorizada</strong>, <strong>Em Cancelamento</strong> ou <strong>Substituída</strong>. 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.

## Responses

- `200` - OK
- `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}/ObterDanfe:
    get:
      tags:
        - Nfse
      summary: DANFE NFS-e (PDF).
      description: >-
        Recupera a representação gráfica da NFS-e, conhecida como <strong>DANFE
        (Documento Auxiliar da Nota Fiscal de Serviços Eletrônica)</strong>.
                    
        📄 **FORMATO DE SAÍDA**: O recurso retorna o arquivo em formato
        <strong>PDF</strong>, codificado em <strong>Base64</strong>. Para a
        visualização, o sistema consumidor deve realizar o decode da string e
        salvar o binário com a extensão `.pdf`.
                    
        🔍 **DISPONIBILIDADE**: O documento só poderá ser obtido para notas com
        status <strong>Autorizada</strong>, <strong>Em Cancelamento</strong> ou
        <strong>Substituída</strong>.
                    
        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
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: string
            application/json:
              schema:
                type: string
            text/json:
              schema:
                type: string
        "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:
    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
```
