### Consulting Received Notes by Period - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Queries notes received within a specified date range using the notasRecebidas method. It requires a Period object to define the start date, end date (optional, defaults to start date if omitted), and page number (optional, defaults to 1). Results are paginated at 50 notes per page. ```php $period = new Period(); $period->setDtInicio('2019-08-05'); $period->setDtFim('2019-08-10'); $period->setPagina(2); $response = $nfSP->notasRecebidas($period); ``` -------------------------------- ### Getting Basic Lot Info - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Executes the informacaoLote method. This method fetches basic information about a specific lot, primarily returning details such as the time the lot was sent to the API. ```php $response = $nfSP->informacaoLote(); ``` -------------------------------- ### Consulting Specific Lot - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Calls the consultarLote method to get detailed information about a specific lot using its lot number. This provides a comprehensive view of the processing status and contents of the specified lot. ```php $response = $nfSP->consultarLote(356); ``` -------------------------------- ### Getting Sent XML (Request) - Response Object (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Executes the getXmlInput method on the response object. This method returns the XML string that was sent as the request payload to the API for the operation, which is helpful for debugging and verification. ```php $response->getXmlInput(); ``` -------------------------------- ### Consulting Emitted Notes by Period - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Retrieves notes emitted within a specified date range using the notasEmitidas method. Similar to received notes, it uses a Period object for date range (start, optional end) and pagination (optional page number, default 1). Results are limited to 50 notes per page. ```php $period = new Period(); $period->setDtInicio('2019-08-05'); $period->setDtFim('2019-08-10'); $period->setPagina(2); $response = $nfSP->notasEmitidas($period); ``` -------------------------------- ### Getting API Response Array - Response Object (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Calls the getResponse method on the object returned by an API interaction method. This method provides the raw response data from the API as a PHP array, useful for detailed inspection of the result. ```php $response->getResponse(); ``` -------------------------------- ### Getting Received XML (Response) - Response Object (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Calls the getXmlOutput method on the response object. This method returns the raw XML string received back from the API as the response to the operation, useful for inspecting the exact data returned. ```php $response->getXmlOutput(); ``` -------------------------------- ### Getting CNPJ Base Info - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Calls the cnpjInfo method on the NotaFiscal instance. This method retrieves basic information related to the provided CNPJ, including the associated Municipal Registration number and a boolean indicating if the CNPJ is authorized to issue NFe. ```php $response = $nfSP->cnpjInfo(); ``` -------------------------------- ### Instantiating NotaFiscal Class (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Initializes the NotaFiscal class instance. Requires the CNPJ, the path to the issuer's certificate file (.pfx or .pem), and the certificate password. This sets up the necessary credentials for API interactions. ```php // Instanciando a Classe $nfSP = new NotaFiscal([ 'cnpj' => '00000000000000', 'certificate' => 'path/to/certificate.pfx', 'certificatePass' => '000000' ]); ``` -------------------------------- ### Sending Nota Fiscal (Emitting) - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Prepares and sends a Nota Fiscal (via an RPS - Recibo Provisório de Serviços) using the enviarNota method. This involves creating and populating an Rps object with all necessary details like service values, codes, aliquots, tomador information, and discrimination before passing it to the method. ```php $rps = new Rps(); $rps->setNumeroRps('00000000'); $rps->setTipoRps(RPSType::RECIBO_PROVENIENTE_DE_NOTA_CONJUGADA); $rps->setValorServicos(30.80); $rps->setCodigoServico(2881); $rps->setAliquotaServicos( 0.029); $rps->setCnpj('10000000000001'); $rps->setRazaoSocialTomador('RAZAO SOCIAL TOMADOR LTDA'); $rps->setTipoLogradouro('R'); $rps->setLogradouro('NOME DA RUA'); $rps->setNumeroEndereco(001); $rps->setBairro('VILA TESTE'); $rps->setCidade('3550308'); // São Paulo $rps->setUf('SP'); $rps->setCep('00000000'); $rps->setEmailTomador('teste@teste.com.br'); $rps->setDiscriminacao('Teste Emissão de Notas pela API'); $response = $nfSP->enviarNota($rps); ``` -------------------------------- ### Consulting Single/Multiple Notes - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Uses the consultarNota method to retrieve detailed information for one or more specific Notas Fiscais. The method accepts a note number or an array of numbers, with a limit of 50 notes per request. ```php $response = $nfSP->consultarNota('00056'); ``` -------------------------------- ### Checking Operation Success - Response Object (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Uses the getSuccess method on the response object to quickly determine if the API operation was successful. This method typically returns a boolean value indicating the outcome. ```php $response->getSuccess(); ``` -------------------------------- ### Canceling Single/Multiple Notes - NotaFiscal (PHP) Source: https://github.com/andersondanilo/nfe-nfts-sp/blob/master/README.md Uses the cancelarNota method to cancel one or more previously issued Notas Fiscais. The method accepts a note number or an array of numbers, with a limit of 50 notes that can be canceled in a single request. ```php $response = $nfSP->cancelarNota('00568'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.