← HomeFleetPay / API

Attach tax documents (NF-e XML/PDF/ZIP or CT-e) to the request

Parameters, data structure and responses from the versioned contract.

POST/embarcador/solicitacoes-transporte/{id}/documentos
anexarDocumentosSolicitacaoTransporteEmbarcadorSandbox Base: https://api.fleetpay.site/v1

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

Attaches NF-e XML files, PDF/DANFE or ZIP archives (via multipart/form-data in arquivos[]) or access keys to the request.

  • From NF-e XML, extracts 44-digit key, number/series, declared value, weight, packages and origin/destination municipalities, filling missing fields without overwriting defined operational addresses and without faking confirmed contracting.
  • From PDF/DANFE, extracts identifiable fields and sets uncertainty_flags + requires_confirmation=true (fiscal_status: nfe_pending_confirmation) whenever weight, value or address cannot be extracted with certainty.

Authentication

Required Scope
operacao — Operations
Module
Direct Contracting (Shipper)
Target Profiles
Shipper · Transport Manager · Dedicated Fleet Contractor
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

idpath · stringRequired
Constraints
{
  "type": "string"
}

Request Body

Required

multipart/form-data

arquivosarrayOptional

application/json

documentosarrayOptional

Responses

200 HTTP Response

Documents attached and fiscal status updated

application/json

successbooleanOptional
commercial_resolutionobject | nullOptional
404 HTTP Response

Request not found

application/json

errorobjectOptional
422 HTTP Response

Invalid file or validation error

application/json

errorobjectOptional
Complete Operation Definition
{
  "tags": [
    "Solicitações e Contratação de Transporte (Embarcador)"
  ],
  "summary": "Anexar documentos fiscais (NF-e XML/PDF/ZIP ou CT-e) à solicitação",
  "description": "Anexa arquivos XML de NF-e, PDF/DANFE ou ZIP (via `multipart/form-data` em `arquivos[]`) ou chaves de acesso à solicitação.\n- Em **XML de NF-e**, extrai chave de 44 dígitos, número/série, valor declarado, peso, volumes e municípios de origem/destino, preenchendo campos ausentes sem sobrescrever endereços operacionais já definidos e sem fingir contratação confirmada.\n- Em **PDF/DANFE**, extrai os campos identificáveis e marca `uncertainty_flags` + `requires_confirmation=true` (`fiscal_status: nfe_pending_confirmation`) quando peso, valor ou endereço não puderem ser extraídos com certeza.\n",
  "operationId": "anexarDocumentosSolicitacaoTransporteEmbarcador",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "properties": {
            "arquivos": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      },
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "documentos": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "access_key": {
                    "type": "string",
                    "pattern": "^[0-9]{44}$"
                  },
                  "document_type": {
                    "type": "string",
                    "enum": [
                      "nfe",
                      "cte"
                    ]
                  },
                  "source_format": {
                    "type": "string",
                    "enum": [
                      "xml",
                      "pdf",
                      "manual_key",
                      "api"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Documentos anexados e estado fiscal atualizado",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SolicitacaoTransporteResponse"
          }
        }
      }
    },
    "404": {
      "description": "Solicitação não encontrada",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    },
    "422": {
      "description": "Arquivo inválido ou erro de validação",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    }
  },
  "x-fleetpay-scope": "operacao",
  "x-fleetpay-module": "contratacao-direta",
  "x-fleetpay-profiles": [
    "embarcador",
    "gestor",
    "agregado_empresarial"
  ],
  "method": "POST",
  "path": "/embarcador/solicitacoes-transporte/{id}/documentos"
}