PHP code example of leventcz / parasut-php

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

    

leventcz / parasut-php example snippets


$credentials = [
    'client_id' => 'YOUR_CLIENT_ID',
    'client_secret' => 'YOUR_CLIENT_SECRET',
    'company_id' => 'YOUR_COMPANY_ID',
    'username' => 'YOUR_USERNAME',
    'password' => 'YOUR_PASSWORD'
];

$client = Parasut::client($credentials);

// paginate through sales invoices
$salesInvoices = $client
    ->salesInvoice()
    ->index(['page' => ['size' => 10, 'number' => 4]]);

$salesInvoices['data']; // array of sales invoices   
$salesInvoices['meta']; // pagination meta

// retrieve the specified sales invoice with its payments
$salesInvoice = $client
    ->salesInvoice()
    ->show($id, ['

// POST | https://api.parasut.com/v4/{company_id}/contacts/{id}/contact_debit_transactions
$client
    ->contact()
    ->contactDebitTransactions($id, $query, $body)

// PATCH | https://api.parasut.com/v4/{company_id}/employees/{id}/archive
$client
    ->employee()
    ->archive($id, $query)
bash
composer