PHP code example of elitan / billecta-api-php-client

1. Go to this page and download the library: Download elitan/billecta-api-php-client 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/ */

    

elitan / billecta-api-php-client example snippets




_uri = 'https://apitest.billecta.com';
$api_secret = 'api secret';

$billecta = new \Billecta\Billecta($base_uri, $api_secret);

// get all companies
$companies = $billecta->getCreditors();

var_dump($companies);

// set what company we are working with
$billecta->setCreditorPublicId('creditor_public_id');

// create debtor (customer)
$debtor = Array(
	'Name' => 'Joe Doe'
);
$customer = $billecta->createDebtor($debtor);

var_dump($customer);