> For the complete documentation index, see [llms.txt](https://ajuda.consistem.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.consistem.com.br/consistem-api/consistem-erp-api/comercial/comercial-v1.0/mdf-e.md).

# MDF E

mdfe

## GET /mdfe

> Obtem Listagem de MDF-e

```json
{"openapi":"3.0.1","info":{"title":"Comercial","version":"1.0"},"tags":[{"name":"MDF-e","description":"mdfe"}],"servers":[{"url":"https://localhost/comercial/v10"},{"url":"http://localhost/comercial/v10"}],"security":[{"csw_auth":[]}],"components":{"securitySchemes":{"csw_auth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"ListaMDFe":{"type":"object","properties":{"continuationToken":{"type":"string","description":"Identificador da Paginação da Consulta"},"listaMDFe":{"type":"array","items":{"$ref":"#/components/schemas/MDFe"}}}},"MDFe":{"type":"object","properties":{"numeroMDFe":{"type":"string","description":"Número do MDF-e"},"ufFinal":{"type":"string","description":"UF Final"},"chaveMDFe":{"type":"string","description":"Chave MDF-e"},"numeroProtocolo":{"type":"string","description":"Número do Protocolo"},"situcao":{"type":"integer","description":"Situação do MDF-e"},"dataEmissao":{"type":"string","format":"date","description":"Data de Emissão do MDF-e (YYYY-MM-DD)"},"horaEmissao":{"type":"string","description":"Hora de Emissão do MDF-e (HH:MM:SS)"},"valorTotalCarga":{"multipleOf":0.01,"type":"number","description":"Valor Total da Carga"},"placaVeiculos":{"type":"string","description":"Placa dos Veículos"}}},"Erro":{"type":"object","properties":{"mensagem":{"type":"string"}}}}},"paths":{"/mdfe":{"get":{"summary":"Obtem Listagem de MDF-e","operationId":"ObterListaMDFe","tags":["MDF-e"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListaMDFe"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Erro"}}}}},"429":{"description":"Too Many Requests"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}},"parameters":[{"name":"empresa","in":"header","required":true,"description":"Código da Empresa","schema":{"type":"string"}},{"name":"dataEmissaoInicio","in":"query","required":false,"description":"Data de Emissão Inicial (YYYY-MM-DD)","schema":{"type":"string","format":"date","nullable":true}},{"name":"dataEmissaoFim","in":"query","required":false,"description":"Data de Emissão Fim (YYYY-MM-DD)","schema":{"type":"string","format":"date","nullable":true}},{"name":"situacao","in":"query","required":false,"description":"Lista de Situação de MDF-e  (0 - Em Digitação, 1 - Com Pendência, 2 - Autorizado, 3 - Cancelado, 4 - Encerrado, 5 - Contingência, 99 - Todos)","schema":{"type":"array","nullable":true,"items":{"type":"integer","enum":[0,1,2,3,4,5,99]}}},{"name":"paginacao","in":"query","required":false,"description":"Quantidade de MDF-e na Paginação de Retorno","schema":{"type":"integer","nullable":true}},{"name":"continuationToken","in":"query","required":false,"description":"Identificador de Paginação da Consulta","schema":{"type":"string","nullable":true}}]}}}}
```

## GET /mdfeCidade

> Obtem Listagem de Cidades do MDF-e

```json
{"openapi":"3.0.1","info":{"title":"Comercial","version":"1.0"},"tags":[{"name":"MDF-e","description":"mdfe"}],"servers":[{"url":"https://localhost/comercial/v10"},{"url":"http://localhost/comercial/v10"}],"security":[{"csw_auth":[]}],"components":{"securitySchemes":{"csw_auth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"ListaMDFeCidadesGet":{"type":"object","properties":{"cidadesMDFe":{"type":"array","items":{"$ref":"#/components/schemas/CidadeMDFeGet"}}}},"CidadeMDFeGet":{"type":"object","properties":{"ibgeCidade":{"type":"string","description":"Nome da Cidade"}}},"Erro":{"type":"object","properties":{"mensagem":{"type":"string"}}}}},"paths":{"/mdfeCidade":{"get":{"summary":"Obtem Listagem de Cidades do MDF-e","operationId":"ObterListaMDFeCidades","tags":["MDF-e"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListaMDFeCidadesGet"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Erro"}}}}},"429":{"description":"Too Many Requests"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}},"parameters":[{"name":"empresa","in":"header","required":true,"description":"Código da Empresa","schema":{"type":"string"}},{"name":"numeroMDFe","in":"query","required":true,"description":"Número do MDF-e","schema":{"type":"integer","nullable":true}}]}}}}
```

## POST /mdfe/encerrar

> Encerramento de MDF-e

```json
{"openapi":"3.0.1","info":{"title":"Comercial","version":"1.0"},"tags":[{"name":"MDF-e","description":"mdfe"}],"servers":[{"url":"https://localhost/comercial/v10"},{"url":"http://localhost/comercial/v10"}],"security":[{"csw_auth":[]}],"components":{"securitySchemes":{"csw_auth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Erro":{"type":"object","properties":{"mensagem":{"type":"string"}}},"MDFeEncerraPost":{"type":"object","required":["numeroMDFe","chaveMDFe"],"properties":{"numeroMDFe":{"type":"integer","maximum":999999999,"description":"Número do MDF-e"},"ibgeCidade":{"type":"string","maxLength":100,"description":"Nome da Cidade (conforme cidades do MDF-e)"}}}}},"paths":{"/mdfe/encerrar":{"post":{"summary":"Encerramento de MDF-e","operationId":"EncerrarMDFe","tags":["MDF-e"],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Erro"}}}}},"429":{"description":"Too Many Requests"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}},"parameters":[{"name":"empresa","in":"header","required":true,"description":"Código da empresa","schema":{"type":"string"}}],"requestBody":{"description":"Dados do MDF-e","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MDFeEncerraPost"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.consistem.com.br/consistem-api/consistem-erp-api/comercial/comercial-v1.0/mdf-e.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
