Hi TIA,
You first need to add an invoice, then the invoice line items, them call the sync. Below is a simple C# example.
Step1 let's create an invoice for my customer called ACustomer
string[ arrInsertFieldsArray = new string[ { "ArAccount", "Customer", "TxnDate" };
string[ arrInsertValueArray = new string[ { "Accounts Receivable", "ACustomer", "13/Dec/2012" };
lblMethodAPIInsertV2.Text = _MethodAPI.MethodAPIInsertV2(CompanyAccount, Login, Password, "", "Invoice", arrInsertFieldsArray, arrInsertValueArray);
That call will return the following xml
<?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" RecordID="82" ></MethodAPI>
Step 2. We now have a new invoice with a recordid of 82. So we can then insert invoiceline items (repeat as needed for the various items you have). In my case I'm gonna say they bought 3 of SomeItem for a rate of 111.00
string[ arrInsertFieldsArray = new string[ { "InvoiceRecordID", "Item", "Quantity", "Rate" };
string[ arrInsertValueArray = new string[ { "82", "SomeItem", "3", "111.00" };
lblMethodAPIInsertV2.Text = _MethodAPI.MethodAPIInsertV2(CompanyAccount, Login, Password, "", "InvoiceLine", arrInsertFieldsArray, arrInsertValueArray);
That call will return the following xml
<?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" RecordID="223" ></MethodAPI>
Step 3. call the sync function
Now we have an invoice with line items all that is left is to invoke the sync function for the invoice.
lblMethodAPIActionSendToDesktopV2.Text = _MethodAPI.MethodAPIActionSendToDesktopV2(CompanyAccount, Login, Password, "", "Invoice", "82");
Dave