This sample is a C# ASP.NET web service application that communicates with QuickBooks Point of Sale via QBWebConnector. The sample focuses primarily on demonstrating how to set up all web service web methods to run against QBWebConnector and does not focus on any particular use case.
Step 1
Install QuickBooks desktop from
here
Step 2
Install QuickBooks Web Connector from
here
Step 3
Create a new web service in Visual Studio and give the name of this web service as QWCPOSWebService
Step 4
Open your Service class file and paste the below code into that.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.Web;
- using System.Web.Services;
- using System.IO;
- using System.Security.Cryptography;
- using Microsoft.Win32;
- using System.Xml;
- using System.Text.RegularExpressions;
-
-
- namespace QWCPOSWebService
- {
-
-
-
-
-
-
- [WebService(
- Namespace = "http://developer.intuit.com/",
- Name = "QWCPOSWebService",
- Description = "Sample WebService in ASP.NET to demonstrate " +
- "QBWebConnector with QuickBooks POS")]
-
-
-
-
-
- public class QWCPOSWebService : System.Web.Services.WebService
- {
- #region GlobalVariables
- System.Diagnostics.EventLog evLog = new System.Diagnostics.EventLog();
- public int count = 0;
- public ArrayList req = new ArrayList();
- #endregion
-
-
- #region Constructor
- public QWCPOSWebService()
- {
-
-
- InitializeComponent();
-
- initEvLog();
- }
- #endregion
-
-
- #region AutoGeneratedMethods
-
- private IContainer components = null;
-
-
-
-
-
-
- private void InitializeComponent()
- {
- }
-
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (disposing && components != null)
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
-
- #endregion
-
-
- #region WebMethods
- [WebMethod]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public string clientVersion(string strVersion)
- {
- string evLogTxt = "WebMethod: clientVersion() has been called " +
- "by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string strVersion = " + strVersion + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
-
-
- string retVal = null;
- double recommendedVersion = 1.5;
- double supportedMinVersion = 1.0;
- double suppliedVersion = Convert.ToDouble(this.parseForVersion(strVersion));
- evLogTxt = evLogTxt + "QBWebConnector version = " + strVersion + "\r\n";
- evLogTxt = evLogTxt + "Recommended Version = " + recommendedVersion.ToString() + "\r\n";
- evLogTxt = evLogTxt + "Supported Minimum Version = " + supportedMinVersion.ToString() + "\r\n";
- evLogTxt = evLogTxt + "SuppliedVersion = " + suppliedVersion.ToString() + "\r\n";
- if (suppliedVersion < recommendedVersion)
- {
- retVal = "W:We recommend that you upgrade your QBWebConnector";
- }
- else if (suppliedVersion < supportedMinVersion)
- {
- retVal = "E:You need to upgrade your QBWebConnector";
- }
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "string retVal = " + retVal;
- logEvent(evLogTxt);
- return retVal;
- }
- [WebMethod]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public string[] authenticate(string strUserName, string strPassword)
- {
- string evLogTxt = "WebMethod: authenticate() has been called by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string strUserName = " + strUserName + "\r\n";
- evLogTxt = evLogTxt + "string strPassword = " + strPassword + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
- string[] authReturn = new string[2];
-
-
- authReturn[0] = System.Guid.NewGuid().ToString();
-
-
-
-
-
-
- string pwd = "password";
- evLogTxt = evLogTxt + "Password locally stored = " + pwd + "\r\n";
- if (strUserName.ToUpper().Trim().Equals("USERNAME") && strPassword.ToUpper().Trim().Equals(pwd.ToUpper()))
- {
-
-
- authReturn[1] = "Company Data=IqbalStore";
- }
- else
- {
- authReturn[1] = "nvu";
- }
-
-
-
-
-
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "string[] authReturn[0] = " + authReturn[0].ToString() + "\r\n";
- evLogTxt = evLogTxt + "string[] authReturn[1] = " + authReturn[1].ToString();
- logEvent(evLogTxt);
- return authReturn;
- }
- [WebMethod(Description = "This web method facilitates web service to handle connection errors between QuickBooks and QBWebConnector", EnableSession = true)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public string connectionError(string ticket, string hresult, string message)
- {
- if (Session["ce_counter"] == null)
- {
- Session["ce_counter"] = 0;
- }
-
-
- string evLogTxt = "WebMethod: connectionError() has been called by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string ticket = " + ticket + "\r\n";
- evLogTxt = evLogTxt + "string hresult = " + hresult + "\r\n";
- evLogTxt = evLogTxt + "string message = " + message + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
-
-
- string retVal = null;
-
- const string CANT_CONNECT_TO_DB = "0x8000FFFF";
-
-
-
- if (hresult.Trim().Equals(CANT_CONNECT_TO_DB))
- {
- evLogTxt = evLogTxt + "HRESULT = " + hresult + "\r\n";
- evLogTxt = evLogTxt + "Message = " + message + "\r\n";
- retVal = "DONE";
- }
- else
- {
-
- if ((int)Session["ce_counter"] == 0)
- {
-
- evLogTxt = evLogTxt + "HRESULT = " + hresult + "\r\n";
- evLogTxt = evLogTxt + "Message = " + message + "\r\n";
- evLogTxt = evLogTxt + "Sending connection string as \"Company Data=\" to QBWebConnector.";
- retVal = "Company Data=";
- }
- else
- {
- evLogTxt = evLogTxt + "HRESULT = " + hresult + "\r\n";
- evLogTxt = evLogTxt + "Message = " + message + "\r\n";
- evLogTxt = evLogTxt + "Sending DONE to stop.";
- retVal = "DONE";
- }
- }
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "string retVal = " + retVal + "\r\n";
- logEvent(evLogTxt);
- Session["ce_counter"] = ((int)Session["ce_counter"]) + 1;
- return retVal;
- }
- [WebMethod(Description = "This web method facilitates web service to send request XML to QuickBooks via QBWebConnector", EnableSession = true)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public string sendRequestXML(string ticket, string strHCPResponse, string strCompanyFileName,
- string qbXMLCountry, int qbXMLMajorVers, int qbXMLMinorVers)
- {
- if (Session["counter"] == null)
- {
- Session["counter"] = 0;
- }
- string evLogTxt = "WebMethod: sendRequestXML() has been called by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string ticket = " + ticket + "\r\n";
- evLogTxt = evLogTxt + "string strHCPResponse = " + strHCPResponse + "\r\n";
- evLogTxt = evLogTxt + "string strCompanyFileName = " + strCompanyFileName + "\r\n";
- evLogTxt = evLogTxt + "string qbXMLCountry = " + qbXMLCountry + "\r\n";
- evLogTxt = evLogTxt + "int qbXMLMajorVers = " + qbXMLMajorVers.ToString() + "\r\n";
- evLogTxt = evLogTxt + "int qbXMLMinorVers = " + qbXMLMinorVers.ToString() + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
-
-
- ArrayList req = buildRequest();
- string request = "";
- int total = req.Count;
- count = Convert.ToInt32(Session["counter"]);
-
-
- if (count < total)
- {
- request = req[count].ToString();
- evLogTxt = evLogTxt + "sending request no = " + (count + 1) + "\r\n";
- Session["counter"] = ((int)Session["counter"]) + 1;
- }
- else
- {
- count = 0;
- Session["counter"] = 0;
- request = "";
- }
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "string request = " + request + "\r\n";
- logEvent(evLogTxt);
- return request;
- }
- [WebMethod(Description = "This web method facilitates web service to receive response XML from QuickBooks via QBWebConnector", EnableSession = true)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public int receiveResponseXML(string ticket, string response, string hresult, string message)
- {
- string evLogTxt = "WebMethod: receiveResponseXML() has been called by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string ticket = " + ticket + "\r\n";
- evLogTxt = evLogTxt + "string response = " + response + "\r\n";
- evLogTxt = evLogTxt + "string hresult = " + hresult + "\r\n";
- evLogTxt = evLogTxt + "string message = " + message + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
-
-
- int retVal = 0;
- if (!hresult.ToString().Equals(""))
- {
-
-
- evLogTxt = evLogTxt + "HRESULT = " + hresult + "\r\n";
- evLogTxt = evLogTxt + "Message = " + message + "\r\n";
- retVal = -101;
- }
- else
- {
- evLogTxt = evLogTxt + "Length of response received = " + response.Length + "\r\n";
-
-
- ArrayList req = buildRequest();
- int total = req.Count;
- int count = Convert.ToInt32(Session["counter"]);
-
-
- int percentage = (count * 100) / total;
- if (percentage >= 100)
- {
- count = 0;
- Session["counter"] = 0;
- }
- retVal = percentage;
- }
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "int retVal= " + retVal.ToString() + "\r\n";
- logEvent(evLogTxt);
- return retVal;
- }
-
-
- [WebMethod]
-
-
-
-
-
-
-
-
-
-
-
-
- public string getLastError(string ticket)
- {
- string evLogTxt = "WebMethod: getLastError() has been called by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string ticket = " + ticket + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
-
-
- int errorCode = 0;
- string retVal = null;
- if (errorCode == -101)
- {
- retVal = "QuickBooks was not running!";
- }
- else
- {
- retVal = "Error!";
- }
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "string retVal= " + retVal + "\r\n";
- logEvent(evLogTxt);
- return retVal;
- }
- [WebMethod]
-
-
-
-
-
-
-
-
-
-
-
- public string closeConnection(string ticket)
- {
- string evLogTxt = "WebMethod: closeConnection() has been called by QBWebconnector" + "\r\n\r\n";
- evLogTxt = evLogTxt + "Parameters received:\r\n";
- evLogTxt = evLogTxt + "string ticket = " + ticket + "\r\n";
- evLogTxt = evLogTxt + "\r\n";
- string retVal = null;
-
-
- retVal = "OK";
-
-
- evLogTxt = evLogTxt + "\r\n";
- evLogTxt = evLogTxt + "Return values: " + "\r\n";
- evLogTxt = evLogTxt + "string retVal= " + retVal + "\r\n";
- logEvent(evLogTxt);
- return retVal;
- }
-
-
- #endregion
-
-
- #region UtilityMethods
- private void initEvLog()
- {
- try
- {
- string source = "WCWebService";
- if (!System.Diagnostics.EventLog.SourceExists(source))
- System.Diagnostics.EventLog.CreateEventSource(source, "Application");
- evLog.Source = source;
- }
- catch { };
- return;
- }
-
-
- private void logEvent(string logText)
- {
- try
- {
- evLog.WriteEntry(logText);
- }
- catch { };
- return;
- }
-
-
- public ArrayList buildRequest()
- {
- string strRequestXML = "";
- XmlDocument inputXMLDoc = null;
-
-
-
- inputXMLDoc = new XmlDocument();
- inputXMLDoc.AppendChild(inputXMLDoc.CreateXmlDeclaration("1.0", null, null));
- inputXMLDoc.AppendChild(inputXMLDoc.CreateProcessingInstruction("qbposxml", "version=\"1.0\""));
-
-
- XmlElement qbposXML = inputXMLDoc.CreateElement("QBPOSXML");
- inputXMLDoc.AppendChild(qbposXML);
- XmlElement qbposXMLMsgsRq = inputXMLDoc.CreateElement("QBPOSXMLMsgsRq");
- qbposXML.AppendChild(qbposXMLMsgsRq);
- qbposXMLMsgsRq.SetAttribute("onError", "stopOnError");
- XmlElement customerQueryRq = inputXMLDoc.CreateElement("CustomerQueryRq");
- qbposXMLMsgsRq.AppendChild(customerQueryRq);
- customerQueryRq.SetAttribute("requestID", "1");
- XmlElement maxReturned = inputXMLDoc.CreateElement("MaxReturned");
- customerQueryRq.AppendChild(maxReturned).InnerText = "1";
-
-
- strRequestXML = inputXMLDoc.OuterXml;
- req.Add(strRequestXML);
-
-
-
- strRequestXML = "";
- inputXMLDoc = null;
- qbposXML = null;
- qbposXMLMsgsRq = null;
- maxReturned = null;
-
-
-
- inputXMLDoc = new XmlDocument();
- inputXMLDoc.AppendChild(inputXMLDoc.CreateXmlDeclaration("1.0", null, null));
- inputXMLDoc.AppendChild(inputXMLDoc.CreateProcessingInstruction("qbposxml", "version=\"1.0\""));
-
-
- qbposXML = inputXMLDoc.CreateElement("QBPOSXML");
- inputXMLDoc.AppendChild(qbposXML);
- qbposXMLMsgsRq = inputXMLDoc.CreateElement("QBPOSXMLMsgsRq");
- qbposXML.AppendChild(qbposXMLMsgsRq);
- qbposXMLMsgsRq.SetAttribute("onError", "stopOnError");
- XmlElement itemInventoryQueryRq = inputXMLDoc.CreateElement("ItemInventoryQueryRq");
- qbposXMLMsgsRq.AppendChild(itemInventoryQueryRq);
- itemInventoryQueryRq.SetAttribute("requestID", "2");
- maxReturned = inputXMLDoc.CreateElement("MaxReturned");
- itemInventoryQueryRq.AppendChild(maxReturned).InnerText = "1";
-
-
- strRequestXML = inputXMLDoc.OuterXml;
- req.Add(strRequestXML);
-
-
-
- strRequestXML = "";
- inputXMLDoc = null;
- qbposXML = null;
- qbposXMLMsgsRq = null;
- maxReturned = null;
-
-
-
- inputXMLDoc = new XmlDocument();
- inputXMLDoc.AppendChild(inputXMLDoc.CreateXmlDeclaration("1.0", null, null));
- inputXMLDoc.AppendChild(inputXMLDoc.CreateProcessingInstruction("qbposxml", "version=\"1.0\""));
-
-
- qbposXML = inputXMLDoc.CreateElement("QBPOSXML");
- inputXMLDoc.AppendChild(qbposXML);
- qbposXMLMsgsRq = inputXMLDoc.CreateElement("QBPOSXMLMsgsRq");
- qbposXML.AppendChild(qbposXMLMsgsRq);
- qbposXMLMsgsRq.SetAttribute("onError", "stopOnError");
- XmlElement purchaseOrderQueryRq = inputXMLDoc.CreateElement("PurchaseOrderQueryRq");
- qbposXMLMsgsRq.AppendChild(purchaseOrderQueryRq);
- purchaseOrderQueryRq.SetAttribute("requestID", "3");
- maxReturned = inputXMLDoc.CreateElement("MaxReturned");
- purchaseOrderQueryRq.AppendChild(maxReturned).InnerText = "1";
-
-
- strRequestXML = inputXMLDoc.OuterXml;
- req.Add(strRequestXML);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return req;
- }
- private string parseForVersion(string input)
- {
-
-
-
-
-
-
- string retVal = "";
- string major = "";
- string minor = "";
- Regex version = new Regex(@"^(?\d+)\.(?\d+)(\.\w+){0,2}$", RegexOptions.Compiled);
- Match versionMatch = version.Match(input);
- if (versionMatch.Success)
- {
- major = versionMatch.Result("${major}");
- minor = versionMatch.Result("${minor}");
- retVal = major + "." + minor;
- }
- else
- {
- retVal = input;
- }
- return retVal;
- }
- #endregion
- }
- }
Step 5
Now, create the QuickBooks file for making the connection between QuickBooks desktop and your web service.
As part of your QB Web Connector configuration (.QWC) file, you include OwnerID and FileID. The following note on these two parameters may be useful.
OwnerID
This is a GUID that represents your application or suite of applications if your application needs to store private data in the company file. Another reason (one of the most common cases being to check if you have communicated with this company file before, and possibly some data about that communication) is that private data will be visible to any application that knows the OwnerID.
FileID
This is a GUID we stamp in the file on your behalf (using your OwnerID) as a private data extension to the "Company" object. It allows an application to verify that the company file it is exchanging data with is consistent over time (by doing a Company Query with the field).
An example of GUID is {85B41BEE-5CD9-427a-A61B-83964F1EB426}
Given below is the code for them.QWC file.
- <?xml version="1.0"?><QBWCXML>
- <AppName>hanavision</AppName>
- <AppID>1</AppID>
- <AppURL>http:
- <AppDescription>A short description for QWCPOSWebService</AppDescription>
- <AppSupport>http:
- <OwnerID>{87EDAAF8-0000-1111-2222-4BA79C2F8998}</OwnerID>
- <FileID>{CA1C3EB8-0000-1111-2222-8D5B438B83AC}</FileID>
- <UserName>Bhavdip</UserName>
- <QBType>QBFS</QBType>
- <Style>Document</Style>
- <AuthFlags>0xF</AuthFlags>
- </QBWCXML>
Note
Don’t forget to change the localhost path.
Step 6
Now, open your web connector and add this file into your web connector. After successfully adding this, now add your file to a web connector.
-
Add your file using the "Add an Application" button; then choose your QBC file.
-
Add password which is similar to the one in your code of web services.
-
Select this web service in web connector using the checkbox.
-
Click the "Update selected" button for running your code of web service.
If you want to run like scheduler, then you can set autorun and give the timing in every Min text box. So now, your QuickBooks desktop and your web service are connected using this web connector.
Authorizing the Application
On the first time that an application connects to a QuickBooks company file, QuickBooks should be opened and a user must be there to authorize the access. When we try to save a customer again and QuickBooks is running this time, a dialog will appear in QuickBooks, as shown in the figure below. We should take note that this will block the current thread so if we used the UI thread, then the UI will become unresponsive.
Example qbXML Request to "Add Customer".
- <?xml version="1.0" encoding="utf-8"?>
- <?qbxml version="2.0"?>
- <QBXML>
- <QBXMLMsgsRq onError="stopOnError">
- <CustomerAddRq requestID="15">
- <CustomerAdd>
- <Name>20706 - Eastern XYZ University</Name>
- <CompanyName>Eastern XYZ University</CompanyName>
- <FirstName>Keith</FirstName>
- <LastName>Palmer</LastName>
- <BillAddress>
- <Addr1>Eastern XYZ University</Addr1>
- <Addr2>College of Engineering</Addr2>
- <Addr3>123 XYZ Road</Addr3>
- <City>Storrs-Mansfield</City>
- <State>CT</State>
- <PostalCode>06268</PostalCode>
- <Country>United States</Country>
- </BillAddress>
- <Phone>860-634-1602</Phone>
- <AltPhone>860-429-0021</AltPhone>
- <Fax>860-429-5183</Fax>
- <Email>[email protected]</Email>
- <Contact>Keith Palmer</Contact>
- </CustomerAdd>
- </CustomerAddRq>
- </QBXMLMsgsRq>
- </QBXML>
Example qbXML Response to "Add Customer".
- <?xml version="1.0" ?>
- <QBXML>
- <QBXMLMsgsRs>
- <CustomerAddRs requestID="15" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
- <CustomerRet>
- <ListID>F540000-1197683154</ListID>
- <TimeCreated>2007-12-14T20:45:54-05:00</TimeCreated>
- <TimeModified>2007-12-14T20:45:54-05:00</TimeModified>
- <EditSequence>1197683154</EditSequence>
- <Name>20706 - Eastern XYZ University</Name>
- <FullName>20706 - Eastern XYZ University</FullName>
- <IsActive>true</IsActive>
- <Sublevel>0</Sublevel>
- <CompanyName>Eastern XYZ University</CompanyName>
- <FirstName>Keith</FirstName>
- <LastName>Palmer</LastName>
- <BillAddress>
- <Addr1>Eastern XYZ University</Addr1>
- <Addr2>College of Engineering</Addr2>
- <Addr3>123 XYZ Road</Addr3>
- <City>Storrs-Mansfield</City>
- <State>CT</State>
- <PostalCode>88130</PostalCode>
- <Country>USA</Country>
- </BillAddress>
- <Phone>860-634-1602</Phone>
- <AltPhone>860-429-0021</AltPhone>
- <Fax>860-429-5183</Fax>
- <Email>[email protected]</Email>
- <Contact>Keith Palmer</Contact>
- <Balance>0.00</Balance>
- <TotalBalance>0.00</TotalBalance>
- <JobStatus>None</JobStatus>
- </CustomerRet>
- </CustomerAddRs>
- </QBXMLMsgsRs>
- </QBXML>
Example qbXML to "Add an Invoice".
- <?xml version="1.0" encoding="utf-8"?>
- <?qbxml version="2.0"?>
- <QBXML>
- <QBXMLMsgsRq onError="stopOnError">
- <InvoiceAddRq requestID="2">
- <InvoiceAdd>
- <CustomerRef>
- <ListID>F560000-1197683156</ListID> <!-- or
- <Name>Bhavdip</Name> -->
- </CustomerRef>
- <TxnDate>2007-12-14</TxnDate>
- <RefNumber>9668</RefNumber>
- <BillAddress>
- <Addr1>56 Cowles Road</Addr1>
- <City>Willington</City>
- <State>CT</State>
- <PostalCode>06279</PostalCode>
- <Country>United States</Country>
- </BillAddress>
- <PONumber></PONumber>
- <Memo></Memo>
-
- <InvoiceLineAdd>
- <ItemRef>
- <FullName>Downloaded Invoice</FullName>
- </ItemRef>
- <Desc>Item 1 Description Goes Here</Desc>
- <Quantity>1</Quantity>
- <Rate>295</Rate>
- </InvoiceLineAdd>
-
- <InvoiceLineAdd>
- <ItemRef>
- <FullName>Downloaded Invoice</FullName>
- </ItemRef>
- <Desc>Item 2 Description Goes Here</Desc>
- <Quantity>3</Quantity>
- <Rate>25</Rate>
- </InvoiceLineAdd>
-
- </InvoiceAdd>
- </InvoiceAddRq>
- </QBXMLMsgsRq>
- </QBXML>
Note
Make sure of the Ref like below,
- <CustomerRef>
- <ListID>F560000-1197683156</ListID> <!-- or
- <Name>Bhavdip</Name> -->
- </CustomerRef>
If your customer "Bhavdip" is already added in your QuickBooks desktop, then your invoice will be added. Otherwise, it will return an error.
Thus, first add a customer, item etc. which is required for the invoice. Then and only then make an invoice.