PHP code example of akamstar / freemecef

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

    

akamstar / freemecef example snippets


//set a valide jwt token
$token = "eyJhbGciOiJ...";

emecef = (new \Freemecef\Emecef($token))->setClient("Papa na Venza")->setInvoiceType(InvoiceTypes::VENTE)
    ->setOperator("Tonton")
    ->addPaymentType(PaymentTypes::ESPECES, 100) // you can add multiple payment types
    ->addProduct('Article 2',50, 1); // you can add multiple products

$invoice = $emecef->invoice()->json();

$data = $emecef->execute($invoice['uid'])->json())->json();