סקירה כללית של המערכת
paramenters
description
CredentialsToken
Obtained from the GetToken API jsonString.
toSign – 1/0
toMail – 1/0
RandomClientMail
Holds email for random client if used, otherwise ignored
ClientIdentifier

Unique alphanumeric string up to 40 char, compulsory, used for API call identification

IsItemPriceWithTax

Relevant for documents type 100, 10100, 300, 10301, 305, 320, 330, otherwise set to 0.

paramenters
description
xxxx + "," + doc num + "," + PDF doc url + "," + html preview url
for success
xxxx + "," + negative error codes string
for failure, one or more, separated by commas
Where xxxx is a positive request number. In case of API being busy only the error code -2000 is sent. In case of invalid credentials only the error code -100 is sent.

Document class

למעלה ▲
} public class Doc300VO
public int
public int
public short
public short
public int
public string
public string
public string
public string
public string
public decimal
public decimal
public decimal
public decimal
EsekNum
ClientNumber
TypeCode
PrintLanguage
DocNumber
ClientName
ClientAddress
ClientCityZip
ClientOsekNum
ProducedDateString
SumBeforeDiscount
DiscountAmount
DiscountPercentage
TotalBeforeMaam
public decimal
public decimal
public decimal
public string
public string
public byte
public decimal
public string
public string
public string
public string
public string
public byte
public byte
DocMaamAmount
DocTotalDue
DocNikuyBamakorSum
DocUserFullName
DocDetail
DocNotMaam
MaamRate
GeneralRemark
DocTypeRemark
DocProductsXML
DocChargesXML
DocClosureXML
DocIsSourceProduced
DocSigned
{

Fields description

למעלה ▲
paramenters
description
EsekNum
system registration number of document issuer business. Compulsory
ClientNumber
system client number under issuer the document is being issued to. Compulsory
TypeCode

System document type code, Compulsory.
Possible values are as follows:
* 100 - הזמנה
* 10100 - הצעת מחיר
* 300- חשבונית עסקה
* 10301- חשבון עסקה
* 305 - חשבונית מס
* 320 - חשבונית מס קבלה
* 330 - חשבונית מס זיכוי
* 400 - קבלה
* 405 - קבלה על תרומות

Allowed document types for each business type:
"Osek Murshe" - 100,10100,10301,305,320,330,400
"Osek Patur" - 100,10100,300,10301,400
"Amuta" or "Malcar" - 100,10100,300,10301,400,405

DocNumber

document number in the accounting number. This field is not used as the numer is issued by the system in the production process

ClientName

Name or business title of the issuer's client the document is being issued to. Compulsory. In the case of "Random Client" being used the actual name or title must be present. Max length 60 symbols, truncated otherwise

ClientAddress

address of the client the document is being issued to. Compulsory, use an empty string when data is not available. Max length 60 symbols, truncated otherwise.

ClientCityZip

same as ClientAddress. Max length 40 symbols.

ClientOsekNum

"מספר עוסק " of the client, numeric string. Optional where not required by law. Max length 9 symbols.

ProducedDateString

The document issue date in the format "dd/mm/yyyy" Compulsory
For documents 100,10100,300,10301,305,330 cannot be set in the future or over 15 days in the past.
For documents 320,400,405 cannot be set earlier than the last document of the same type.

SumBeforeDiscount

the numeric document total in NIS before any taxes and discounts. Compulsory, set to 0 if not available.

DiscountAmount

the numeric document total in NIS before any taxes and discounts. Compulsory, set to 0 if not available.

DiscountAmount

the numeric monetary amount in NIS of discount for the document. Set to 0 if no discount is given and for documents 400, 405. Compulsory. DiscountPercentage – the numeric discount percentage of the document total before tax. Set to 0 if no discount is given and for documents 400, 405. Compulsory.

TotalBeforeMaam

the numeric document total in NIS after any or all discounts prior to the VAT. Compulsory, set to 0 if not available.

DocTotalDue

the numeric total due for the document in NIS. Compulsory. Zero value not allowed. For document 320 the total for the invoice must be exactly equal to the total of the receipt part therefore specifying only one number is sufficient.

DocNikuyBamakorSum

the numeric amount in NIS being cleared on client's behalf for the tax purposes, 0 if none required by law or where not applicable. Compulsory

DocUserFullName

not used in the interface, set during the production

DocDetail

the document purpose description. Max length 150 symbols, truncated otherwise. Compulsory. Empty string when no description is available.

DocNotMaam

set to 1 if the document is VAT exempt, 0 otherwise.

MaamRate

the VAT rate in % applicable in the State of Israel on the Production Date specified. Compulsory.

GeneralRemark

not used in the interface, set during the production. DocTypeRemark - not used in the interface, set during the production.

DocProductsXML

the field for document products data xml, see below for detailed schema, description and explanation. Compulsory for document types 100,10100,300,10301,305,320,330 empty string otherwise.

DocChargesXML

the field for document payment information data xml, see below for detailed schema, description and explanation. Compulsory for document types 320,400,405, empty string otherwise.

DocClosureXML

empty string

DocIsSourceProduced

set to 0

DocSigned

set to 0

PrintLanguage

0 for hebrew, 1 for english

DocProductsXML

למעלה ▲
paramenters
description
DDP_LineID
a zero based product line counter. Compulsory
DDP_EsekNum
system registration number of document issuer business. Compulsory
DDP_ProductNum

system registration number for a given product or 0 for a "Catchall" product. Compulsory

DDP_ProductDetail

product description string. Max length 150 symbols. Compulsory, empty string if no description is provided

DDP_ProductUnitMeasurementUnitCode

the system code for a measurement unit being used. Default 1. Measurement units and their respective codes can be obtained through GetMeasurementUnitsList API

DDP_Quantity

the product quantity. Default 1. Compulsory.

ProductCurrencyID

the system code for the currency being used. Supported currencies and their respective codes can be obtained through GetSupportedCurrenciesList API. Compulsory

DDP_ProductUnitPrice

product unit price in foreign currency if any is being used or in NIS otherwise. Compulsory, set to 0 if no price is being charged. In the case of isItemPriceWithTax being set to 1 the value, when different from 0, must contain the VAT.

DDP_ExchangeRate

the exchange rate used to convert foreign currency in use to NIS, 1 otherwise. Compulsory.

DDP_UnitPriceILS

product unit price in NIS. Compulsory. Set to 0 if no price is being charged. In the case of isItemPriceWithTax being set to 1 the value, when different from 0, must contain the VAT.

DDP_DiscountPercentage

the product line discount percentage. Set to 0 if none is given. Compulsory. In the case of isItemPriceWithTax being set to 1 the value, when different from 0, must contain the VAT.

DDP_DiscountSum

the nimeric product line amount in NIS. Set to 0 if no discount is given. Compulsory. In the case of isItemPriceWithTax being set to 1 the value, when different from 0, must contain the VAT.

DDP_LineTotal

the numeric product line total in NIS after the product line discount if any is given. Set to 0 if no price is being charged. Compulsory. In the case of isItemPriceWithTax being set to 1 the value, when different from 0, must contain the VAT.

SrcDocType

set to empty string. Compulsory

SrcDocNumber

set to empty string. Compulsory

DocChargesXML

למעלה ▲
paramenters
description
DDR_LineID
a 1- based charge line counter. Compulsory
DDR_PayMethodTypeCode
a system code for supported payment types. Compulsory.
Possible values:
* 1 – מזומן
* 2 – המחאה
* 3 – כרטיס אשראי
* 4 – העברה בנקאית
* 8 – הוראת קבע
DDR_CheckPaymentDate
the charge line due date in format "yyyy-MM-dd". Compulsory
DDR_Sum
the numeric value in NIS for the charge line total. Compulsory. Zero sum is not allowed
DDR_ForInvProduction
set to "False". Compulsory.
If set to "True" the 400/405 type document will cause an automatic invoice generation when the appropriate flag is set in the Business Settings section of the Web interface.
Any DDR_PayMethodTypeCode values other than 1 and 3
DDR_BankCode
the system code for the bank. The supported banks and their codes can be obtained through GetBanksList API. Empty string if no data is available for payment type 4, compulsory otherwise.
DDR_BankBranchCode
the system code for the bank branch. The list of bank branch codes can be obtained through GetBankBranchesList API. Empty string if no data is available for payment type 4, compulsory otherwise.
DDR_BankAccountNum
bank account number. Empty string if no data is available for payment type 4, compulsory otherwise.
DDR_CheckNum
the check number for payment type number 2, reference number otherwise. Empty string if no data is available for payment type 4, compulsory otherwise.
DDR_CreditCardIssuerCode
set to empty string
DDR_CreditTransactionTypeCode
set to empty string
DDR_FirstCreditPayment
set to empty string
DDR_CreditPayments
set to empty string
DDR_AddCreditPaymentsSum
set to empty string
DDR_PayMethodTypeCode value of 1
DDR_BankCode
set to empty string
DDR_BankBranchCode
set to empty string
DDR_CreditCardIssuerCode
set to empty string
DDR_BankAccountNum
set to empty string
DDR_CheckNum
set to empty string
DDR_CreditTransactionTypeCode
set to empty string
DDR_FirstCreditPayment
set to empty string
DDR_AddCreditPaymentsSum
set to empty string
DDR_PayMethodTypeCode value of 3
DDR_BankCode
set to empty string
DDR_BankBranchCode
set to empty string
DDR_BankAccountNum
4 digits credit card valid through date. Compulsory
DDR_CheckNum
last 4 digits of credit card number or an empty string if no data is available. Compulsory
DDR_CreditCardIssuerCode
the system code for the credit card company. The list of codes is available through GetCreditCompaniesList API. Compulsory
DDR_CreditPayments
number of credit card payments, 1 or more. Compulsory
In case of a single payment
DDR_CreditTransactionTypeCode
set to empty string
DDR_FirstCreditPayment
set to empty string
DDR_AddCreditPaymentsSum
set to empty string
In case of multiple payments
DDR_CreditTransactionTypeCode
set to 2 for no interest payments, 3 for credit. Compulsory.
DDR_FirstCreditPayment
a numeric amount of the first payment in NIS. Compulsory.
DDR_AddCreditPaymentsSum
a numeric amount of the following payments in NIS. Compulsory.

Error codes

למעלה ▲
paramenters
description
API Errors
-2000 API busy.
-1000 Bad or incomplete data.
-100 Invalid credentialsToken.
-10 No rights.
Data integrity errors
-1 Unknown error
-2 User not found
-3 Wrong password
-4 Absence blocked
-5 Failed attempts blocked
-6 General authentication failure
-7 Account blocked
-8 Account not active
-26 Bad email supplied for Random client.
-40 ClientOsekNum did not pass validation
-142 ClientNum/Name did not pass validation.
-143 Bad or illegal production date.
-144 Bad products XML
-145 Bad SumBeforeDiscount
-146 Bad DiscountAmount
-147 Bad TotalBeforeMaam
-148 Bad DocMaamAmount
-149 Bad DocTotalDue
-150 Bad DiscountPercentage
-151 Bad DiscountAmount
-155 Bad DocNikuyBamakorSum
-158 Bad DocChargesXML
-163 Bad or mismatched EsekNum
-164 Document type not allowed
-165 Client not found
-166 Wrong docyment type
-167 Inconsistent document tax parameters
Draft of the GetLoggedResponseByClientIdentifier API manual
Input parameters
userName, userPass, valid user credentials belonging to the business issuing the document. clientIdentifier, an alphanumeric string up to 40 characters in length – a unique identifier supplied with the CreateDocument API call
Output format
string
Error codes
-1 Unknown error
-2 User not found
-3 Wrong password
-4 Absence blocked
-5 Failed attempts blocked
-6 General authentication failure
-7 Account blocked
-8 Account not active
-12 Bad or missing client identifier
-13 Nothing found
-14 Multiple entries found
-15 Log currently inaccessible
This API call returns an exact duplicate of the CreateDocument API response if a single log entry matching the supplied clientIdentifier is found.

Code Example - ASP .NET

למעלה ▲
ASP .NET
 
using System;
using System.Collections.Generic;
using System.Text;

namespace ApiExample
{
    public class PaidInvoiceExample
    {
        private string urlGetToken = "http://212.143.181.190/TiuditWeb/GetToken/"; 
        private string urlCreateDoc = "http://212.143.181.190/TiuditWeb/CreateDocument/";  
        private StringBuilder documentJson = new StringBuilder(string.Empty);

        

        public PaidInvoiceExample(ref string docResultString)
        {
            string userName = "userName"; //replace with a real one
            string userPass = "userPass"; //replace with a real one
            string tokenErrorText = string.Empty;
            string token = string.Empty;

            token = GetToken(userName, userPass, ref tokenErrorText);
            if (token == string.Empty)
            {
                docResultString = tokenErrorText;
                return;
            }

            short toSign = 0; //0 - not to sign; 1 - to sign; compulsory
            short toMail = 0; //0 - not to mail; 1 - to mail; compulsory
            short isItemPriceWithTax = 0; //0 - product line prices do not include VAT; 1 - product line prices include VAT; compulsory
            string randomClientMail = "abc@abc.com"; //compulsory with random client and toMail=1

            int esekNum = 750023; //test business
            int clientNum = 200000; //200000 reserved for random client, can be substituted with any other client ID in the Accountbook system
            short documentTypeCode = 320; //Paid Invoice
            string clientName = "שם לקוח";
            string clientAddress = "רח' אבא הילל 16";
            string clientCityZip = "12345 רמת גן";
            string clientOsekNum = "303837868"; //substitute with a valid 9 digit number
            DateTime producedDate = DateTime.Now;
            decimal sumBeforeDiscount = 110m;
            decimal discountAmount = 0m;
            decimal totalBeforeMaam = 110m;
            decimal docMaamAmount = 17.6m;
            decimal docTotalDue = 127.6m;
            decimal docNikuiBamakor = 30m;
            string userFullName = "פרטי משפחה";
            string docDetail = "תאור מסמך";
            short docNotMaam = 0; //compulsory; 0 where VAT present, 1 where no VAT
            decimal vatRate = 16m;
            string generalRemark = "הערה כללית";
            string docTypeRemark = "הערה לסוג מסמך";
            //zero-based line ID counter for products XML
            string productsXml = "";
            //usable when typecode= 100 / 10100 /300/ 10301 / 305/ 320 / 330. otherwise null.
            //1-based line ID counter for charges XML
            StringBuilder chargesXml = new StringBuilder(string.Empty); 
            //usable when 
            chargesXml.Append("");
            chargesXml.Append(""); //cash payment
            chargesXml.Append("");
            chargesXml.Append(""); //cheque
            chargesXml.Append(""); //credit card
            chargesXml.Append(""); //credit card
            chargesXml.Append("");
                            

            documentJson.Append("{");
            documentJson.Append("\"EsekNum\":" + esekNum.ToString() + ","); //compulsory numeric value
            documentJson.Append("\"ClientNumber\":" + clientNum.ToString() + ","); //compulory numeric value
            documentJson.Append("\"TypeCode\":" + documentTypeCode.ToString() + ","); //compulsory numeric value
            documentJson.Append("\"DocNumber\":\"\","); //leave empty
            documentJson.Append("\"ClientName\":\"" + clientName + "\","); //compulsory string value
            documentJson.Append("\"ClientAddress\":\"" + clientAddress + "\","); //optional string value
            documentJson.Append("\"ClientCityZip\":\"" + clientCityZip + "\","); //optional string value
            documentJson.Append("\"ClientOsekNum\":\"" + clientOsekNum + "\","); //optional 9 digit numeric value. Add leading zeros if less than 9 digits in length
            documentJson.Append("\"ProducedDateString\":\"" + producedDate.ToString("dd/MM/yyyy") + "\","); //compulsory formatted date
            documentJson.Append("\"SumBeforeDiscount\":" + String.Format("{0:n}", sumBeforeDiscount) + ",");
            documentJson.Append("\"DiscountAmount\":" + String.Format("{0:n}", discountAmount) + ",");
            documentJson.Append("\"DiscountPercentage\":0.00,"); //value currently not in use
            documentJson.Append("\"TotalBeforeMaam\":" + String.Format("{0:n}", totalBeforeMaam) + ",");
            documentJson.Append("\"DocMaamAmount\":" + String.Format("{0:n}", docMaamAmount) + ",");
            documentJson.Append("\"DocTotalDue\":" + String.Format("{0:n}", docTotalDue) + ",");
            documentJson.Append("\"DocNikuyBamakorSum\":" + String.Format("{0:n}", docNikuiBamakor) + ",");
            documentJson.Append("\"DocUserFullName\":\"" + userFullName + "\",");
            documentJson.Append("\"DocDetail\":\"" + docDetail + "\",");
            documentJson.Append("\"DocNotMaam\":" + docNotMaam.ToString() + ",");
            documentJson.Append("\"MaamRate\":" + String.Format("{0:n}", vatRate) + ",");
            documentJson.Append("\"GeneralRemark\":\"" + generalRemark + "\",");
            documentJson.Append("\"DocTypeRemark\":\"" + docTypeRemark + "\",");
            documentJson.Append("\"DocProductsXML\":\"" + productsXml + "\",");
            documentJson.Append("\"DocChargesXML\":\"" + chargesXml.ToString() + "\",");
            documentJson.Append("\"DocClosureXML\":null,"); //not used in this API call
            documentJson.Append("\"DocIsSourceProduced\":0,"); //always zero in this API call
            documentJson.Append("\"DocSigned\":0,"); //always zero in this API call
            documentJson.Append("\"SourceDocID\":null,"); //not used in this API call
            documentJson.Append("\"SourceTypeCode\":null,"); //not used in this API call
            documentJson.Append("\"SourceDocNumber\":null,"); //not used in this API call
            documentJson.Append("\"DocFromApi\":null,"); //not used in this API call
            documentJson.Append("\"DocID\":null"); //always null in this API call
            documentJson.Append("}");

            string postData = "credentialsToken=" + token + "&jsonString=" + documentJson.ToString() + "&toSign=" + toSign.ToString() + "&toMail=" + toMail.ToString() + "&isItemPriceWithTax=" + isItemPriceWithTax + "&randomClientMail=" + randomClientMail;
            string returnedTextDoc = string.Empty;
            int responseStatus = SendHttpRequestUtf8(urlCreateDoc, ref returnedTextDoc, postData);
            if (responseStatus == 200)
            {
                
                docResultString = returnedTextDoc;
            }
            else
            {
                 docResultString = "HTTP status:" + responseStatus.ToString() + Environment.NewLine + returnedTextDoc;
            }
        }

        private string GetToken(string userName, string passWord, ref string errorText)
        {
            
            string token = string.Empty;
            string postData = string.Empty;
            string returnedText = string.Empty;
            int responseStatus = 0;

            postData = "userName=" + userName + "&userPass=" + passWord;

            responseStatus = SendHttpRequestUtf8(urlGetToken, ref returnedText, postData);
            if (responseStatus == 200)
            {
                errorText = returnedText;
                if (returnedText.IndexOf('-') != 0)
                {                    
                    string[] responseParts = returnedText.Split(',');
                    if (responseParts.Length != 3)
                    {                        
                        return string.Empty;
                    }
                    token = responseParts[0];                    
                }
            }
            else
            {
                errorText = "HTTP status:" + responseStatus.ToString() + Environment.NewLine + returnedText;
                return string.Empty;
            }
            return token;
        }

        private int SendHttpRequestUtf8(string sUrl, ref string sReturnText, string sPostData)
        {
            try
            {
                System.Net.HttpWebRequest loHttp = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(sUrl);
                loHttp.KeepAlive = false;
                if (sPostData != null && sPostData != "")
                {
                    loHttp.Method = "POST";
                    Byte[] bytesPostData = System.Text.Encoding.UTF8.GetBytes(sPostData);
                    loHttp.ContentType = "application/x-www-form-urlencoded; encoding=UTF-8";
                    loHttp.ContentLength = bytesPostData.Length;
                    loHttp.GetRequestStream().Write(bytesPostData, 0, bytesPostData.Length);
                    loHttp.GetRequestStream().Close();
                }
                System.Net.HttpWebResponse loWebResponse = (System.Net.HttpWebResponse)loHttp.GetResponse();
                System.Text.Encoding enc = System.Text.Encoding.GetEncoding("utf-8");
                System.IO.StreamReader loResponseStream = new System.IO.StreamReader(loWebResponse.GetResponseStream());
                if (loWebResponse.StatusCode == System.Net.HttpStatusCode.OK) sReturnText = loResponseStream.ReadToEnd();
                else sReturnText = loWebResponse.StatusDescription;
                loWebResponse.Close();
                loResponseStream.Close();

                return (int)loWebResponse.StatusCode;
            }
            catch (System.Net.WebException e)
            {
                sReturnText = e.Message;
                if ((System.Net.HttpWebResponse)e.Response != null)
                {                    
                    return (int)((System.Net.HttpWebResponse)e.Response).StatusCode;
                }
                else
                {
                    return -1; //unknown error
                }
            }
        }
    }
}

                                              
                                                

Code Example - PHP

למעלה ▲
PHP
 

date_default_timezone_set('Asia/Bishkek');
$urlGetToken = "http://212.143.181.190/TiuditWeb/GetToken/";
$urlCreateDoc = "http://212.143.181.190/TiuditWeb/CreateDocument/";
$x = "";
PaidInvoiceExample($x);
echo $x;
die;
function GetToken($userName, $passWord, &$errorText){
	global $urlGetToken;
	$token = "";
	$postData = "";
	$returnedText = "";
	$responseStatus = 0;

	$postData = "userName=" . $userName . "&userPass=" . $passWord;

	$responseStatus = SendHttpRequestUtf8($urlGetToken, $returnedText, $postData);
	if ($responseStatus == 200)
	{
		$errorText = $returnedText;
		if (strpos($returnedText,'-') !== false)
		{
			$responseParts = explode(",", $returnedText);
			if (count($responseParts) != 3)
			{
				return "";
			}
			$token = $responseParts[0];
		}
	}
	else
	{
		$errorText = "HTTP status:" . $responseStatus . "\r\n" . $returnedText;
		return "";
	}
	return $token;
}
function SendHttpRequestUtf8($sUrl, &$sReturnText, $sPostData)
{
	$options = array(
        CURLOPT_CUSTOMREQUEST      => "GET",       
        CURLOPT_RETURNTRANSFER => 1,     // return web page
        CURLOPT_HEADER         => false,    // don't return headers
        CURLOPT_NOBODY         => false,    // don't return headers
        CURLOPT_FOLLOWLOCATION => true,     // follow redirects
        CURLOPT_ENCODING       => "",       // handle all encodings
        CURLOPT_AUTOREFERER    => true,     // set referer on redirect
        CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
        CURLOPT_TIMEOUT        => 120,      // timeout on response
        CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
        CURLOPT_SSL_VERIFYHOST      => false,       
        CURLOPT_SSL_VERIFYPEER => false     // Disabled SSL Cert checks
    );
	if(isset($sPostData) && $sPostData != ''){
		$options[CURLOPT_HTTPHEADER] = array('Content-Type: application/x-www-form-urlencoded; encoding=UTF-8' );
		$options[CURLOPT_CUSTOMREQUEST] = "POST";
		$options[CURLOPT_POST] = true;
		$options[CURLOPT_POSTFIELDS] = $sPostData;
	}
	$ch = curl_init( $sUrl );
    curl_setopt_array( $ch, $options );
    $sReturnText = curl_exec( $ch );
    $header  = curl_getinfo( $ch );
	if (!$sReturnText) {
		$sReturnText = curl_error( $ch );
		return -1;
	}
    curl_close( $ch );
	return $header["http_code"];
}


function PaidInvoiceExample(&$docResultString){
	try {
		$userName = "nabskg"; //replace with a real one
		$userPass = "nabskg1234"; //replace with a real one
		$tokenErrorText = "";
		$token = "";

		$token = GetToken($userName, $userPass, $tokenErrorText);
		if ($token == "")
		{
			$docResultString = $tokenErrorText;
			return;
		}

		$toSign = 0; //0 - not to sign; 1 - to sign; compulsory
		$toMail = 0; //0 - not to mail; 1 - to mail; compulsory
		$isItemPriceWithTax = 0; //0 - product line prices do not include VAT; 1 - product line prices include VAT; compulsory
		$randomClientMail = "abc@abc.com"; //compulsory with random client and toMail=1

		$esekNum = 750023; //test business
		$clientNum = 200000; //200000 reserved for random client, can be substituted with any other client ID in the Accountbook system
		$documentTypeCode = 320; //Paid Invoice
		$clientName = "שם לקוח";
		$clientAddress = "רח' אבא הילל 16";
		$clientCityZip = "12345 רמת גן";
		$clientOsekNum = "303837868"; //substitute with a valid 9 digit number
		$producedDate = new DateTime();
		$sumBeforeDiscount = 110;
		$discountAmount = 0;
		$totalBeforeMaam = 110;
		$docMaamAmount = 17.6;
		$docTotalDue = 127.6;
		$docNikuiBamakor = 30;
		$userFullName = "פרטי משפחה";
		$docDetail = "תאור מסמך";
		$docNotMaam = 0; //compulsory; 0 where VAT present, 1 where no VAT
		$vatRate = 16;
		$generalRemark = "הערה כללית";
		$docTypeRemark = "הערה לסוג מסמך";
		//zero-based line ID counter for products XML
		$productsXml = '';
		//1-based line ID counter for charges XML
		$chargesXml = '';
		$chargesXml .= '';
		$chargesXml .= ''; //cash payment
		$chargesXml .= ''; //cheque
		$chargesXml .= ''; //credit card
		$chargesXml .= ''; //credit card
		$chargesXml .= '';

		$documentJson = array();
		$documentJson["DocID"] = null; //always null in this API call
		$documentJson["EsekNum"] = $esekNum; //compulsory numeric value
		$documentJson["ClientNumber"] = $clientNum; //compulory numeric value
		$documentJson["TypeCode"] = $documentTypeCode; //compulsory numeric value
		$documentJson["DocNumber"] = ""; //leave empty
		$documentJson["ClientName"] = $clientName; //compulsory $value
		$documentJson["ClientAddress"] = $clientAddress; //optional $value
		$documentJson["ClientCityZip"] = $clientCityZip; //optional $value
		$documentJson["ClientOsekNum"] = $clientOsekNum; //optional 9 digit numeric value. Add leading zeros if less than 9 digits in length
		$documentJson["ProducedDateString"] = $producedDate->format('d/m/Y'); //compulsory formatted date
		$documentJson["SumBeforeDiscount"] = $sumBeforeDiscount;
		$documentJson["DiscountAmount"] = $discountAmount;
		$documentJson["DiscountPercentage"] = 0; //value currently not in use
		$documentJson["TotalBeforeMaam"] = $totalBeforeMaam;
		$documentJson["DocMaamAmount"] = $docMaamAmount;
		$documentJson["DocTotalDue"] = $docTotalDue;
		$documentJson["DocNikuyBamakorSum"] = $docNikuiBamakor;
		$documentJson["DocUserFullName"] = $userFullName;
		$documentJson["DocDetail"] = $docDetail;
		$documentJson["DocNotMaam"] = $docNotMaam;
		$documentJson["MaamRate"] = $vatRate;
		$documentJson["GeneralRemark"] = $generalRemark;
		$documentJson["DocTypeRemark"] = $docTypeRemark;
		$documentJson["DocProductsXML"] = $productsXml;
		$documentJson["DocChargesXML"] = $chargesXml;
		$documentJson["DocClosureXML"] = null; //not used in this API call
		$documentJson["DocIsSourceProduced"] = 0; //always zero in this API call
		$documentJson["DocSigned"] = 0; //always zero in this API call
		$documentJson["SourceDocID"] = null; //not used in this API call
		$documentJson["SourceTypeCode"] = null; //not used in this API call
		$documentJson["SourceDocNumber"] = null; //not used in this API call
		$documentJson["DocFromApi"] = null; //not used in this API call

		$postData = "credentialsToken=" . $token . "&jsonString=" . json_encode($documentJson) . "&toSign=" . $toSign . "&toMail=" . $toMail . "&isItemPriceWithTax=" . $isItemPriceWithTax . "&randomClientMail=" . $randomClientMail;
		//echo ''; die;
		$returnedTextDoc = "";
		global $urlCreateDoc;
		$responseStatus = SendHttpRequestUtf8($urlCreateDoc, $returnedTextDoc, $postData);
		if ($responseStatus == 200)
		{

			$docResultString = $returnedTextDoc;
		}
		else
		{
			$docResultString = "HTTP status:" . $responseStatus . "\r\n" . $returnedTextDoc;
		}
	} catch (Exception $e) {
		return "";
	}
}



                                              
                                                
יצירת קשר
מלאו את הפרטים הבאים וניצור איתכם קשר לפתיחת חשבון API
חתימה דיגיטלית כחוק
תוכנה מאושרת מס הכנסה
מוצפן ומאובטח בתקן ssl
ניתן לבטל החזר כספי מובטח
תנו לנו לחזור אליכם
מלאו את הפרטים הבאים ונציגנו יחזור אליכם בהקדם



חתימה דיגיטלית כחוק
תוכנה מאושרת מס הכנסה
מוצפן ומאובטח בתקן ssl
ניתן לבטל החזר כספי מובטח