Application programming interface (API) - English

Connecting to the API

With this code it's possible to connect with the ClearBalance API. To accomplish this
the correct data need to be filled in.
The API username and password can be found under your system preferences.

	class UsernameToken
	{
		/**
		 * Username and password for authentication
		 * 
		 * @var string
		 */
		protected $_username;
		protected $_password;
	
		/**
		 * Constructor
		 * 
		 * @param string $username
		 * @param string $password
		 * @return void
		 */
		public function __construct($username, $password)
		{
			$this -> _username = $username;
			$this -> _password = $password;
		}
	}
	
	$xmlSoap = 'http://schemas.xmlsoap.org/ws/2002/07/utility/';   
	$usernameToken = new UsernameToken('username', 'password');
	$soapHeaders[] = new SoapHeader($xmlSoap, 'UsernameToken', $usernameToken);
	
	$client = new SoapClient('http://demo.clearbalance.nl/api/wsdl', array('trace' => true, 'exceptions' => true));
	$client -> __setSoapHeaders($soapHeaders);

Check if a debtor exists based upon the email address

By using this function it's possible to check if a already debtor exists. If not, the function will return 0.

	$client -> checkEmailExists('emailaddress');

Add a new debtor

By using this function a new debtor can be added. This function will automatically generate a recurring debtorCode

	$client -> insertDebtor(
		array(
			'debGender' 			=> 0, // 0 = dhr / 1 = mevr //required
			'debFirstname' 			=> 'Firstname', //required
			'debSurname' 			=> 'Surname', //required
			'debAddress' 			=> 'Address',
			'debZipcode' 			=> '1234AA',
			'debPlace' 			=> 'City',
			'debCountry' 			=> 'Netherlands',
			'debEmail' 			=> '
 Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.
 ', //required
			'debCompanyname' 		=> 'Company',
			'debLegal' 			=> 0, //private person
			'debKvknr' 			=> '0000',
			'debVatnr' 			=> '0000',
			'debPhonenr' 			=> '0000',
			'debFaxnr' 			=> '0000',
			'debMobnr' 			=> '0000',
			'debPaymentBillnr' 		=> '0000',
			'debPaymentTnv' 		=> 'Firstname Surname',
			'debPaymentBank' 		=> 'ING BANK',
			'debPaymentPlace' 		=> 'City Bank',
			'debPaymentIBANnr' 		=> '0000',
			'debPaymentBICnr' 		=> '0000',
			'debNote'			=> 'Notice',
			'debNoteView'			=> 0
		)
	);

Adding a new invoice

By using this function a new invoice will be generated. This function will also automatically generate a invoiceCode

	$client -> insertInvoice(
		array(
			'inv_debID' 			=> debtorId,
			'invExcl' 			=> 100, // calculate the price excl before adding
			'invIncl' 			=> 119, // calculate the price incl before adding
			'invVat' 			=> 19,
			'invPayment' 			=> 14, 
			'invDiscount' 			=> 0,
			'invSend' 			=> 0, 
			'invSendMethod' 		=> 0,
			'invStatus' 			=> 0,
			'invTemplate'			=> 0,
			// for each item, change 0 with 1 etc
			'invi_prodID0'			=> 0,
			'invi_subscriptionID0' 		=> 0,
			'inviCount0'			=> 1,
			'inviDesc0'			=> '',
			'inviExcl0'			=> 0,
			'inviVat0'			=> 0,
			'inviPeriodic0'			=> 0,
			'inviPeriod0'			=> 0
		)
	);

Adding a new Quote

By using this function a new invoice will be generated. This function will also automatically generate a QuoteCode.

	$client -> insertQuote(
		array(
			'quote_debID' 			=> debtorId,
			'quoteExcl' 			=> 100, // calculate the price excl before adding
			'quoteIncl' 			=> 119, // calculate the price incl before adding
			'quoteVat' 			=> 19,
			'quoteValidityQuote' 		=> 30, 
			'quoteDiscount' 		=> 0,
			'quoteSend' 			=> 0, 
			'quoteSendMethod' 		=> 0,
			'quoteStatus' 			=> 0,
			'quoteTemplate'		=> 0,
			'quotePaymentTerms'	=> '',
			// for each item, change 0 with 1 etc
			'quotei_prodID0'		=> 0,
			'quoteiCount0'			=> 1,
			'quoteiDesc0'			=> '',
			'quoteiExcl0'			=> 0,
			'quoteiVat0'			=> 0
		)
	);


Retrieve all invoices related to a debtor

By using this function all invoices related to a specified debtor will be retrieved.

	$client -> getInvoicesByDebtor(debtorId)

Retrtieve a product

By using this function all data of a specific product will be retrieved.

	$client -> getProduct(productId);

Retrieve all products

By using this function all data of all products will be retrieved.

	$client -> getProducts();

De plus van ClearBalance Software

  • Snel en makkelijk in gebruik
  • Krachtige- en complexe functies
  • API's (makkelijk te koppelen met andere CRM software)

Gebruiksvriendelijkheid & Veiligheid

  • Dagelijkse back-up
  • Overdracht van gegevens gaat via een SSL-Certificaat
  • Jij bepaalt wie, waar en wanneer toegang heeft