drakakisgeo / billit
The php client for Billit.io API
Installs: 1 283
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- guzzlehttp/guzzle: ^6.3.1|^7.0.1
Requires (Dev)
- mockery/mockery: ^1.4
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-10-29 05:43:43 UTC
README
This PHP client can be used to connect with the billit.io API .
Note: Billit.io also has an integration with zapier.com, Contact us in order to give you access to our beta zapier app.
Install
Via Composer
$ composer require drakakisgeo/billit
Laravel Framework
If you use the Laravel Framework you need to provide your Billit API key and Base url, so add a key to your config/services.php file as:
'billit' => [ 'token' => env('BILLIT_API_TOKEN'), 'sandbox' => env('BILLIT_API_IS_SANDBOX'), 'version' => 'v1', 'timeout' => 2.0 ]
To initialize the client is just a call as this:
$client = resolve('billit');
You can of course also use the Billit Facade like so
Billit::myAccount();
Examples
List contacts
use Drakakisgeo\Billit\Billit; $client = new Billit('yourToken'); $client->contacts();
Get Account details
$client->myAccount();
Get Customers
$client->contacts();
Create contact
$client->contactCreate([ 'customerType' => 'company', 'company' => 'Awesome S.A.', 'inCharge' => 'Kalampakopoulos George', 'lang' => 'el', 'VatId'=>'075101010' ]);
Update contact
$client->contactUpdate([ 'customerType' => 'company', 'company' => 'Awesome S.A.', 'inCharge' => 'Kalampakopoulos George', 'lang' => 'el', 'VatId'=>'075101010' ]);
Get contact
$client->contactShow(1010);
Delete contact
$client->contactDelete(1010);
Create invoice
A full rather complicated example, MyData enabled
$client->invoiceCreate([ "customerId"=>694, "sendMail"=> false, "excludeMydata"=> true, "invoiceDate"=>"2021-04-15", "invoiceTypeId"=>349, "isPaid" => true, "mydataInvoiceType" => "2.1", "taxes"=> [ [ "taxId"=> 514 ], [ "taxId"=> 524, "taxVatShow"=> 1 ] ], "products"=> [ [ "productId"=> null, "details"=> "test", "measurementUnit"=> 1, "vatId" => 376, "price" => 123.32, "quantity"=> 1, "incomeClassificationCat"=>"category1_3", "incomeClassificationType"=>"E3_561_001" ] ], "tags" => ["billit","test-tag"], "mydataPayment"=>[ "paidAmount"=> 0.32, "paymentMethod"=> 3, "epiPistosi"=> 10 ] ] );
Check the rest of the methods to src/Billit.php and the official API regarding the options that can be used in each case.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The MIT License (MIT). Please see License File for more information.