PHP code example of codsit / factura

1. Go to this page and download the library: Download codsit/factura 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/ */

    

codsit / factura example snippets




use Codsit\Codsit;

try {
    cion
    $API_KEY = "aF9ON5CiUTxx9ra9JJtCREC465Ss91JedVXh7qOKFlc";  // Api_key (https://fac.codsit.com)
    $codsit = new Codsit(array('api_key' => $API_KEY));

    // Creando Nueva Factura
    $factura = $codsit->Api->factura('//--JSON-VENTA-[ARRAY]--//');
    
    $
    // Respuesta
    echo json_encode("result".$factura);

} catch (Exception $e) {
    echo json_encode($e->getMessage());
}

    $API_KEY = "aF9ON5CiUTxx9ra9JJtCREC465Ss91JedVXh7qOKFlc"; 
    $codsit = new Codsit(array('api_key' => $API_KEY));
    $res = $codsit->Services->Dni('88888888');
    json_encode($res);

    $API_KEY = "aF9ON5CiUTxx9ra9JJtCREC465Ss91JedVXh7qOKFlc"; 
    $codsit = new Codsit(array('api_key' => $API_KEY));
    $res = $codsit->Services->Ruc('20124512123');
    json_encode($res);