PHP code example of alfreddagenais / zohobooksapi

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

    

alfreddagenais / zohobooksapi example snippets



$zohoBooks = new \Webleit\ZohoBooksApi\ZohoBooks('authtoken');

$zohoBooks = new \Webleit\ZohoBooksApi\ZohoBooks('authtoken', 'organization_id');

$zohoBooks->getAvailableModules();

$invoices = $zohoBooks->invoices->getList();

$contacts = $zohoBooks->contacts->getList();

$invoices = $zohoBooks->invoices->getList();

$invoices = $zohoBooks->invoices->getList(['status' => 'unpaid']);

$invoices = $zohoBooks->invoices->getList(['status' => 'unpaid', 'page' => 3, 'per_page' => 200]);

$invoices = $zohoBooks->invoices->getList();

$data = $invoices->toArray();
$json = $invoices->toJson();

// After fetch filtering in php
$filtered = $invoices->where('total', '>', 200);

// Grouping
$filtered = $invoices->groupBy('customer_id');


$invoice = $zohoBooks->invoices->get('idoftheinvoice');
$id = $invoice->getId();
$data = $invoice->toArray();
$total = $invoice->total;