PHP code example of imbue / wefact-api-php

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

    

imbue / wefact-api-php example snippets


$client = new WeFact();
$client->setApiToken($yourApiToken);

$invoices = $client->invoices->list();

$invoice = $client->invoices->show([
    'InvoiceCode' => 'F0001',
]);

$invoice = $client->invoices->create([
    'DebtorCode' => 'DB10000',
    'InvoiceLines' => [
        [
            'Number' => 2,
            'ProductCode' => 'P0001'
        ],
        [
            'Description' => 'Reiskosten à € 0,19 per km',
            'PriceExcl' => 0.19
        ]
    ]
 ]);

$invoice = $client->invoices->edit([
    'Identifier' => 1,
    'Discount' => 10,
    'Term' => 30,
 ]);

$invoice = $client->invoices->delete([
    'Identifier' => 1,
 ]);

$invoices = $client->attachments->download([
    'ReferenceIdentifier' => '1',
    'Type' => 'pricequote',
    'Filename' => 'sample.pdf',
]);