skip to content

API - Get Client History

URL: getClientHistory_JSON.php

Required Fields:

ClientID (the client_id unique to this business, not globally)

Optional Fields:

StartDate - format YYYY-MM-DD (if specified, only transactions from this date (included) will be returned)
EndDate - format YYYY-MM-DD (if specified, only transactions to this date (included) will be returned
Order - ASC or DESC (default)


JSON encoded array of client transaction history in the following format:

//Invoices, Credit Notes, Pro Forma Invoices, Payouts, Payments
$array[client_id][doc_type][doc_number][total] = total; //total of the document
$array[client_id][doc_type][doc_number]= link; //link to generate the document, no login required
$array[client_id][doc_type][doc_number][details][i][doc_field_item_name] = doc_field_item_value;//General
$array[client_id][balance] = balance;
$array[client_id][opening_balance] = opening_balance;

Example PHP code

$param['username'] = '';
$param['password'] = '';

foreach ($param as $key => $val) {
  $request.= $key . '=' . urlencode($val);
  $request.= '&';
$request = substr($request, 0, -1); //remove trailing &

$url = '';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //set the url
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //return as a variable
curl_setopt($ch, CURLOPT_POST, 1); //set POST method
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request); //set the POST variables
$response = curl_exec($ch); //run the whole process and return the response


Updated: Thu, 27 August 2015