PHP code example of uspdev / nfe-ws-consumer

1. Go to this page and download the library: Download uspdev/nfe-ws-consumer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uspdev / nfe-ws-consumer example snippets



spdev\Nfe\NfeWsConsumer;

$srv = 'http://servidor.eesc.usp.br/nfe-ws/api/';
$xml = file_get_contents('nfe.xml');

$sefaz = new NfeWsConsumer($srv, 'usr', 'pwd');
$ret = $sefaz->consultaXML($xml);

print_r($ret);