PHP code example of multiverse / notazzsdk
1. Go to this page and download the library: Download multiverse/notazzsdk 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/ */
multiverse / notazzsdk example snippets
// Example NFE
use Multiverse\Notazz\DSL\NotaFiscalBuilder;
$notafiscal = new NotaFiscalBuilder();
$result =
$notafiscal
->key('123') // Notazz Api key
->destination()
->name('John Doe')
->taxid('00000000272')
->taxtype('F')
->street('NÃO INFORMADO')
->number('S/N')
->district('NÃO INFORMADO')
->city('São Paulo')
->uf('SP')
->zipcode('02102000')
->email('[email protected]')
->sendEmailList()
->add('[email protected]')
->add('[email protected]')
->end()
->phone(11955555555)
->document()
->nfe()
->basevalue(70.30)
->description('Descrição teste')
->issue_date('2019-07-05 18:11:30')
->products()
->add()
->cod(123)
->name('Escova de dente Cepacol')
->qtd(2)
->unitary_value(15.20)
->save()
->add()
->cod(124)
->name('Pano de prato para cozinha')
->qtd(1)
->unitary_value(55.10)
->save()
->shipping()
->value(100.00)
->mode(0)
->vehicles()
->placa('ZZZ1100')
->uf('MG')
->volumes()
->qtd(1)
->species('CAIXA')
->netWeight(10.500)
->grossWeight(12.000)
->carrier()
->name('Empresa Brasileira de Correios e Telégrafos')
->taxid('34028316002742')
->ie(12345678)
->street('Rua de teste')
->number(123)
->district('Centro')
->city('Belo Horizonte')
->uf('MG')
->save()
->make()
;
// Example NFSE
use Multiverse\Notazz\DSL\NotaFiscalBuilder;
$result = $this->notafiscal
->key('123')
->destination()
->name('Leonardo Tumadjian')
->taxid('00000000272')
->taxtype('F')
->street('NÃO INFORMADO')
->number('S/N')
->district('NÃO INFORMADO')
->city('São Paulo')
->uf('SP')
->zipcode('02102000')
->email('[email protected]')
->sendEmailList()
->add('[email protected]')
->add('[email protected]')
->end()
->phone(11955555555)
->document()
->nfse()
->basevalue(0.10)
->description('Descrição teste')
->issue_date('2019-07-05 18:11:30')
->service()
->description('Teste')
->listLc116(123)
->withheldIss(123)
->cityCode(123)
->aliquotas()
->cofins(1.0)
->csll(0.10)
->inss(2.01)
->ir(1.05)
->pis(0.5)
->iss(0.08)
->save()
->make()
;