← HomeFleetPay / API

Download NF-e source file (XML or PDF)

Parameters, data structure and responses from the versioned contract.

GET/fiscal/nfe/{access_key}/arquivo
downloadNfeSourceSandbox Base: https://api.fleetpay.site/v1

Technical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.

Downloads the exact source file (authorized XML or PDF DANFE) that generated the NF-e for this company. The file is streamed with a Content-Disposition header.

Authentication

Required Scope
fiscal — Tax & Fiscal
Module
Tax, CT-e, MDF-e & CIOT
Target Profiles
Transport Manager · Dedicated Fleet Contractor · Fleet Carrier
Schemes
OAuth2 client_credentials (POST /oauth/token) or API Key via Authorization: Bearer / X-Api-Key
[
  {
    "oauth2": []
  },
  {
    "chaveApi": []
  }
]
Availability depends on the environment, enabled scopes and provider. This reference does not execute requests or collect credentials.

Parameters

access_keypath · stringRequired

NF-e access key, with 44 digits.

Constraints
{
  "type": "string",
  "pattern": "^\\d{44}$"
}

Responses

200 HTTP Response

The NF-e file (XML or PDF).

application/xml

application/pdf

Headers

Content-Disposition
Content-Type
401 HTTP Response

FleetPay API key missing or invalid.

application/json

Headers

X-Request-Id

Call correlation identifier.

403 HTTP Response

Fiscal scope disabled for the key, or no active carrier associated with the key.

application/json

Headers

X-Request-Id

Call correlation identifier.

404 HTTP Response

NF-e not found (nfe_nao_encontrada) or source file unavailable (arquivo_nfe_nao_encontrado).

application/json

503 HTTP Response

File temporarily unavailable in storage (arquivo_nfe_indisponivel).

application/json

Complete Operation Definition
{
  "tags": [
    "NF-e"
  ],
  "summary": "Baixar arquivo de origem da NF-e (XML ou PDF)",
  "description": "Faz o download do arquivo de origem exato (XML autorizado ou DANFE em PDF) que gerou a\nNF-e nesta empresa. O arquivo é devolvido em stream com cabeçalho `Content-Disposition`.\n",
  "operationId": "downloadNfeSource",
  "responses": {
    "200": {
      "description": "O arquivo da NF-e (XML ou PDF).",
      "headers": {
        "Content-Disposition": {
          "schema": {
            "type": "string"
          }
        },
        "Content-Type": {
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/xml": {
          "schema": {
            "type": "string",
            "format": "binary"
          }
        },
        "application/pdf": {
          "schema": {
            "type": "string",
            "format": "binary"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "description": "NF-e não encontrada (`nfe_nao_encontrada`) ou arquivo de origem não disponível (`arquivo_nfe_nao_encontrado`).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        }
      }
    },
    "503": {
      "description": "Arquivo temporariamente indisponível no storage (`arquivo_nfe_indisponivel`).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        }
      }
    }
  },
  "x-fleetpay-scope": "fiscal",
  "x-fleetpay-module": "fiscal-ciot",
  "x-fleetpay-profiles": [
    "gestor",
    "agregado_empresarial",
    "transportador_frotista"
  ],
  "method": "GET",
  "path": "/fiscal/nfe/{access_key}/arquivo",
  "parameters": [
    {
      "$ref": "#/components/parameters/NfeAccessKey"
    }
  ]
}