Lembre-se de acessar a central de ajudas através do seu sistema e-Login para ter acesso completo ao conteúdo.

[XML Protegido] Repositório NFe Recebidas – Método eDoc_Envio_Documentos

Este método tem por objetivo baixar os documentos XML ou DANFE do repositório NF-es recebidas.

Os parâmetros Header necessários para realizar a chamada a este web service são:


Authorization : vai conter a codificação do usuário e senha utilizados para autenticar o Rest. Estes dados devem ser obtidos junto a equipe Datamex.

Após obter o usuário e senha é preciso enviar um Header codificando o usuário e senha no padrão base64_encode. Segue o exemplo

Usuario:teste

Senha:teste

Gerando base64_encode utilizando php: base64_encode(“teste:teste”) ficaria: dGVzdGU6dGVzdGU=

Deste modo enviaríamos o Header abaixo:
Authorization: Basic dGVzdGU6dGVzdGU=

Os parâmetros do Body necessários para realizar a chamada ao web service são:

p: Ambiente -> indica o projeto que vai executar o Rest.

f: executarHub -> essa é a função padrão do projeto Ambiente que faz a chamada ao Hub indicado.

hub: nome interno do parâmetro do Hub criado pela equipe de suporte/implantação da Datamex. (Esse nome tem que ser solicitado junto a equipe Datamex)

chaveNFe : enviar a chave da nota a ser consultada, exemplo:
43171205503548000178550010012347701248318832 .

integradas : receberá os valores S|N|A -> Caso informe ‘S’ será considerado na consulta as somente as notas que já foram informadas como integradas no hub eDoc_InformaDocumentosIntegrados, caso seja informado o valor ‘N’ as notas já integradas não serão consideradas na consulta e caso seja informado o valor ‘A’ será considerado tanto as integradas como as não integradas. Por padrão as já integradas não são consideradas nas consultas.

pdfOuXml: receberá o valor X|P -> Caso informado valor ‘P’ vai devolver um o base64 encode da DANFE das NF-e consutadas, caso informar valor X irá devolver o XML da NF-e. Por padrão sempre é enviado o XML.

periodoInicio: informar uma data de emissão, exemplo: 2019-01-01 -> está data irá filtrar notas com a data de emissão maior ou igual a data informada.

periodoFim: informar uma data de emissão, exemplo: 2019-01-01 -> está data irá filtrar notas com a data de emissão menor ou igual a data informada.

empresaCNPJ: informar um cnpj sem formatação, exemplo:
11484819000156. Este filtro irá buscar por notas de uma empresa que correspondam ao cnpj informado.

denegadasCanceladas: informar os valores S|N|A -> este filtro caso informado o valor ‘S’ irá considerar nas consultas as notas que estão canceladas/denegadas, caso informado o valor ‘N’ as notas canceladas/denegadas não serão consideradas e caso o valor enviado seja ‘A’ será considerado na consulta tanto notas que estejam canceladas/denegadas quanto as que não estão.

Segue um exemplo de Requisição Rest via PHP utilizando a biblioteca cURL:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://dominioclientedatamex/ws/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "p=Ambiente&f=executaHub&hub=testeAndrei2&chaveNFe=43171205503548000178550010012347701248318832&integradas=A&pdfOuXml=X&periodoInicio=2012-01-01&periodoFim=2019-01-12&empresaCNPJ=11482819240459&denegadasCanceladas=S",
  CURLOPT_HTTPHEADER => array(
    "Accept: */*",
    "Accept-Encoding: gzip, deflate",
    "Authorization: Basic am9hbzoxMjM0NQ==,Basic YW5kcmVpOkBzcGlyaW5hMg==",
    "Cache-Control: no-cache",
    "Connection: keep-alive",
    "Content-Length: 145",
    "Content-Type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}


O retorno deste Rest será um json contendo o XML ou DANFE das notas consultadas junto com um id que corresponderá ao id da nota no repositório NF-e da Datamex ou em caso de algum erro retornará uma mensagem informando os erros ocorridos.
Segue alguns exemplos de retorno:

{"sucesso":true,"msg":[{"docs":[{"id":"47","xml":"
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<nfeProc versao=\"3.10\" xmlns=\"http://www.portalfiscal.inf.br/nfe\"> <NFe
	xmlns=\"http://www.portalfiscal.inf.br/nfe\"> <infNFe Id=\"NFe43171205503548000178550010012347701248318832\"
	versao=\"3.10\">
	<ide>
		<cUF>43</cUF>
		<cNF>24831883</cNF>
		<natOp>OP RETORNO TESTE NOVA FLAG</natOp>
		<indPag>0</indPag>
		<mod>55</mod>
		<serie>1</serie>
		<nNF>1234770</nNF>
		<dhEmi>2017-12-08T10:33:00-02:00</dhEmi>
		<dhSaiEnt>2017-12-08T10:33:00-02:00</dhSaiEnt>
		<tpNF>1</tpNF>
		<idDest>1</idDest>
		<cMunFG>4315602</cMunFG>
		<tpImp>1</tpImp>
		<tpEmis>1</tpEmis>
		<cDV>2</cDV>
		<tpAmb>2</tpAmb>
		<finNFe>1</finNFe>
		<indFinal>1</indFinal>
		<indPres>9</indPres>
		<procEmi>0</procEmi>
		<verProc>e-Login 1.3,5.0</verProc>
	</ide>
	<emit>
		<CNPJ>01303548001173</CNPJ>
		<xNome>UNITRANS TRANSPORTE DE CARGAS LTDA</xNome>
		<xFant>UNITRANS</xFant>
		<enderEmit>
			<xLgr>AV FERNANDO OSORIO asudhshsduas asduhasudhas asduhdusa777777</xLgr>
			<nro>5838</nro>
			<xCpl>Sala E</xCpl>
			<xBairro>CENTRO</xBairro>
			<cMun>4314407</cMun>
			<xMun>Pelotas</xMun>
			<UF>RS</UF>
			<CEP>96070000</CEP>
			<cPais>1058</cPais>
			<xPais>BRASIL</xPais>
		</enderEmit>
		<IE>111111</IE>
		<CRT>3</CRT>
	</emit>
	<dest>
		<CNPJ>11232323</CNPJ>
		<xNome>NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xNome>
		<enderDest>
			<xLgr>PERNAMBUCO</xLgr>
			<nro>746</nro>
			<xCpl>Salas 304/305</xCpl>
			<xBairro>NAVEGANTES</xBairro>
			<cMun>4314902</cMun>
			<xMun>Porto Alegre</xMun>
			<UF>RS</UF>
			<CEP>90240000</CEP>
			<cPais>1058</cPais>
			<xPais>BRASIL</xPais>
		</enderDest>
		<indIEDest>2</indIEDest>
	</dest>
	<det nItem=\"1\">
		<prod>
			<cProd>[RAI]PARTICIONAR1</cProd>
			<cEAN />
			<xProd>PRODUTO PARA PARTICIONAR O LOTE - Lt:121212.</xProd>
			<NCM>01012100</NCM>
			<CFOP>5906</CFOP>
			<uCom>UN</uCom>
			<qCom>30.0000</qCom>
			<vUnCom>10.000000000</vUnCom>
			<vProd>300.00</vProd>
			<cEANTrib />
			<uTrib>UN</uTrib>
			<qTrib>30.0000</qTrib>
			<vUnTrib>10.000000000</vUnTrib>
			<indTot>1</indTot>
		</prod>
		<imposto>
			<ICMS>
				<ICMS40>
					<orig>0</orig>
					<CST>41</CST>
				</ICMS40>
			</ICMS>
			<IPI>
				<cEnq>999</cEnq>
				<IPINT>
					<CST>53</CST>
				</IPINT>
			</IPI>
			<PIS>
				<PISNT>
					<CST>07</CST>
				</PISNT>
			</PIS>
			<COFINS>
				<COFINSNT>
					<CST>07</CST>
				</COFINSNT>
			</COFINS>
		</imposto>
	</det>
	<total>
		<ICMSTot>
			<vBC>0.00</vBC>
			<vICMS>0.00</vICMS>
			<vICMSDeson>0.00</vICMSDeson>
			<vFCPUFDest>0.00</vFCPUFDest>
			<vICMSUFDest>0.00</vICMSUFDest>
			<vICMSUFRemet>0.00</vICMSUFRemet>
			<vBCST>0.00</vBCST>
			<vST>0.00</vST>
			<vProd>300.00</vProd>
			<vFrete>0.00</vFrete>
			<vSeg>0.00</vSeg>
			<vDesc>0</vDesc>
			<vII>0.00</vII>
			<vIPI>0.00</vIPI>
			<vPIS>0.00</vPIS>
			<vCOFINS>0.00</vCOFINS>
			<vOutro>0.00</vOutro>
			<vNF>300.00</vNF>
		</ICMSTot>
	</total>
	<transp>
		<modFrete>0</modFrete>
		<vol>
			<qVol>30</qVol>
			<pesoL>0.000</pesoL>
			<pesoB>0.000</pesoB>
		</vol>
	</transp>
	</infNFe>
	</NFe>
</nfeProc>"}]}]}

O exemplo de retorno acima mostra o json contendo a nota com o ID do repositório NF-e Datamex junto com o XML.

{"sucesso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v4dT0GwvLZQsM0KuqgYxx0rTpERUUKgCqOgFLQedJpybQUUUUEhRRRQAGkYAjkZoooATYv90flTgABxRRQAdqKKKBBRRRQMKKKKACiiigAooooAKKKKACiiigD//ZCmVuZHN0cmVhbQplbmRvYmoKMiAwIG9iago8PAovUHJvY1NldCBbL1BERiAvVGV4dCAvSW1hZ2VCIC9JbWFnZUMgL0ltYWdlSV0KL0ZvbnQgPDwKL0YxIDUgMCBSCi9GMiA2IDAgUgo+PgovWE9iamVjdCA8PAovSTEgNyAwIFIKL0kyIDkgMCBSCj4+Cj4+CmVuZG9iagoxMCAwIG9iago8PAovUHJvZHVjZXIgKEZQREYgMS42KQovQ3JlYXRpb25EYXRlIChEOjIwMTkxMTEyMTQ1NTM5KQo+PgplbmRvYmoKMTEgMCBvYmoKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDEgMCBSCi9PcGVuQWN0aW9uIFszIDAgUiAvRml0SCBudWxsXQovUGFnZUxheW91dCAvT25lQ29sdW1uCj4+CmVuZG9iagp4cmVmCjAgMTIKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAyOTk5IDAwMDAwIG4gCjAwMDAwMTA3MDEgMDAwMDAgbiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDg3IDAwMDAwIG4gCjAwMDAwMDMwODYgMDAwMDAgbiAKMDAwMDAwMzE4MiAwMDAwMCBuIAowMDAwMDAzMjgzIDAwMDAwIG4gCjAwMDAwMDgyODUgMDAwMDAgbiAKMDAwMDAwODQ3NyAwMDAwMCBuIAowMDAwMDEwODM1IDAwMDAwIG4gCjAwMDAwMTA5MTEgMDAwMDAgbiAKdHJhaWxlcgo8PAovU2l6ZSAxMgovUm9vdCAxMSAwIFIKL0luZm8gMTAgMCBSCj4+CnN0YXJ0eHJlZgoxMTAxNQolJUVPRgo="}]}]}

O exemplo de retorno acima mostra a mesma consulta do exemplo anterior porém agora retornando o DANFE da nota. O retorno do DANFE é um base64 encode do conteúdo do PDF, o mesmo precisa ser decodificado e salvo no formato PDF para ser visualizado.

 {"sucesso":false,"erro":["Nenhum conteúdo encontrado."]} 

O exemplo acima mostra uma consulta que não retornou nenhuma nota.

FICOU COM DÚVIDA? Encaminhe e-mail para: suporte@datamex.com.br
Se preferir falar conosco:
Porto Alegre / RS 051 4063 8343
Rio Grande / RS 053 3036 2525
Caxias do Sul / RS 054 4062 9320
Rio de Janeiro / RJ 021 4063 8395
Itajaí / SC 047 4054 9320
Paranaguá / PR 041 4064 9110
Belo Horizonte / MG 031 4063 8310
São Paulo / SP 011 4063 8395


AINDA NÃO É CLIENTE DATAMEX? Não perca tempo, conheça a solução Datamex para a Gestão de Transportadoras, Armazéns Gerais e Empresas de Logística: Emissor de CTe, MDFe, CIOT e EDI