ini_set('set_time_limit', '5');
ini_set('max_execution_time', '5');
$fields = array(
'compID'=>'Your_Company_Identifier',
'user'=>'user',
'pass'=>'pass',
'dateissued'=>'20090610',
'clientname'=>'אלביס פרסלי',
'client_street_number'=>'6',
'client_street'=>'החרצית',
'client_city'=>'תל אביב',
'client_country'=>'ישראל',
'client_zip'=>'12345',
'docType'=>'invrec',
'totalsum'=>'100',
'totalvat'=>'15.5',
'totalwithvat'=>'115.5',
'desc[0]'=>'תיאור שורה ראשונה',
'unitprice[0]'=>'45',
'quantity[0]'=>'1',
'desc[1]'=>'תיאור שורה שניה',
'unitprice[1]'=>'55',
'quantity[1]'=>'1',
'maampercent'=>'15.5',
'paid'=>'115.5',
'nicui'=>'0',
'totalpaid'=>'115.5',
'hwc'=>'הנה הערה ידנית',
//'sendCopy'=>'my@email.com',
//'sendOrig'=>'client@email.com',
'cash'=>'1',
'cashammount'=>'60',
'cheque'=>'1',
'autoinvoice'=>'1', // This means that invoices will be automatically issued for each postponed cheque upon the arrival of its date.
'chequeDateY[0]'=>'2009',
'chequeDateM[0]'=>'07',
'chequeDateD[0]'=>'01',
'chequeNumber[0]'=>'111',
'chequeSnif[0]'=>'118',
'chequeAcc[0]'=>'182777',
'chequeBank[0]'=>'11',
'chequeTotal[0]'=>'20',
'chequeDateY[1]'=>'2009',
'chequeDateM[1]'=>'08',
'chequeDateD[1]'=>'01',
'chequeNumber[1]'=>'112',
'chequeSnif[1]'=>'118',
'chequeAcc[1]'=>'182777',
'chequeBank[1]'=>'11',
'chequeTotal[1]'=>'35.5',
'show_response'=>'1',
//'debug'=>'yes' // only enable this if you want debug information in HTML... Otherwise - "show_response" should be enough
);
foreach($fields as $key=>$val) {
$string .= "$key=$val&";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.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;