דוגמה ליצירת חשבונית מס באמצעות ה API של iCount
ini_set("set_time_limit", "5");
ini_set("max_execution_time", "5");
$fields = array(
'compID' => 'your_company_identifier',
'user' => 'your_username',
'pass' => 'your_password',
'docType' => 'invoice',
'dateissued' => date("Ymd"),
'clientname' => 'ישראל ישראלי',
'client_street' => 'יסוד המעלה',
'client_street_number'=>'8',
'client_city' => 'תל אביב',
'client_zip' => '12345',
'totalsum' => '100',
'totalvat' => '16',
'maampercent' => '16',
'totalwithvat' => '116',
'desc[0]' => 'משקה איזוטוני',
'quantity[0]' => '2',
'unitprice[0]' => '50',
'hwc' => 'ניסוי - הערה ידנית',
'sendOrig' => 'foo@bar.com',
'show_response' => '1',
);
foreach($fields as $key=>$val) {
$string .= "$key=$val&";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.icount.co.il/api/create_doc.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$string);
echo "-------------------------------------\n";
curl_exec ($ch);
echo "-------------------------------------\n";
curl_close ($ch);
die;


