Example SOAP Request and Response for the QuickBooks Web Connector sendRequestXML() Method

Example SOAP Request

First Request

The very first call top sendRequestXML() for each session will send you a strHCPResponse from QuickBooks. It will look like this:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Body>
		<sendRequestXML xmlns="http://developer.intuit.com/">
			<ticket>a05fd1b411f6e22adbb5717f96876b5b</ticket>
			<strHCPResponse>&lt;?xml version="1.0" ?&gt;
&lt;QBXML&gt;
&lt;QBXMLMsgsRs&gt;
&lt;HostQueryRs requestID="0" statusCode="0" statusSeverity="Info" statusMessage="Status OK"&gt;
&lt;HostRet&gt;
&lt;ProductName&gt;QuickBooks Pro 2006&lt;/ProductName&gt;
&lt;MajorVersion&gt;16&lt;/MajorVersion&gt;
&lt;MinorVersion&gt;0&lt;/MinorVersion&gt;
&lt;Country&gt;US&lt;/Country&gt;
&lt;SupportedQBXMLVersion&gt;1.0&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;1.1&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;2.0&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;2.1&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;3.0&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;4.0&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;4.1&lt;/SupportedQBXMLVersion&gt;
&lt;SupportedQBXMLVersion&gt;5.0&lt;/SupportedQBXMLVersion&gt;
&lt;IsAutomaticLogin&gt;false&lt;/IsAutomaticLogin&gt;
&lt;QBFileMode&gt;SingleUser&lt;/QBFileMode&gt;
&lt;/HostRet&gt;
&lt;/HostQueryRs&gt;
&lt;CompanyQueryRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK"&gt;
&lt;CompanyRet&gt;
&lt;IsSampleCompany&gt;false&lt;/IsSampleCompany&gt;
&lt;CompanyName&gt;Test Company 2&lt;/CompanyName&gt;
&lt;LegalCompanyName&gt;Test Company 2&lt;/LegalCompanyName&gt;
&lt;FirstMonthFiscalYear&gt;January&lt;/FirstMonthFiscalYear&gt;
&lt;FirstMonthIncomeTaxYear&gt;January&lt;/FirstMonthIncomeTaxYear&gt;
&lt;CompanyType&gt;General Business&lt;/CompanyType&gt;
&lt;TaxForm&gt;OtherOrNone&lt;/TaxForm&gt;
&lt;DataExtRet&gt;
&lt;OwnerID&gt;{57F3B9B6-86F1-4fcd-B1EF-166DE1813D20}&lt;/OwnerID&gt;
&lt;DataExtName&gt;AppLock&lt;/DataExtName&gt;
&lt;DataExtType&gt;STR255TYPE&lt;/DataExtType&gt;
&lt;DataExtValue&gt;LOCKED:MACBOOK-WINDOWS:633772023577302500&lt;/DataExtValue&gt;
&lt;/DataExtRet&gt;
&lt;DataExtRet&gt;
&lt;OwnerID&gt;{57F3B9B6-86F1-4fcd-B1EF-166DE1813D20}&lt;/OwnerID&gt;
&lt;DataExtName&gt;FileID&lt;/DataExtName&gt;
&lt;DataExtType&gt;STR255TYPE&lt;/DataExtType&gt;
&lt;DataExtValue&gt;{57F3B9B6-86F1-4fdc-B1EF-966DE1813D20}&lt;/DataExtValue&gt;
&lt;/DataExtRet&gt;
&lt;/CompanyRet&gt;
&lt;/CompanyQueryRs&gt;
&lt;PreferencesQueryRs requestID="2" statusCode="0" statusSeverity="Info" statusMessage="Status OK"&gt;
&lt;PreferencesRet&gt;
&lt;AccountingPreferences&gt;
&lt;IsUsingAccountNumbers&gt;false&lt;/IsUsingAccountNumbers&gt;
&lt;IsRequiringAccounts&gt;true&lt;/IsRequiringAccounts&gt;
&lt;IsUsingClassTracking&gt;false&lt;/IsUsingClassTracking&gt;
&lt;IsUsingAuditTrail&gt;true&lt;/IsUsingAuditTrail&gt;
&lt;IsAssigningJournalEntryNumbers&gt;true&lt;/IsAssigningJournalEntryNumbers&gt;
&lt;/AccountingPreferences&gt;
&lt;FinanceChargePreferences&gt;
&lt;AnnualInterestRate&gt;0.00&lt;/AnnualInterestRate&gt;
&lt;MinFinanceCharge&gt;0.00&lt;/MinFinanceCharge&gt;
&lt;GracePeriod&gt;0&lt;/GracePeriod&gt;
&lt;IsAssessingForOverdueCharges&gt;false&lt;/IsAssessingForOverdueCharges&gt;
&lt;CalculateChargesFrom&gt;DueDate&lt;/CalculateChargesFrom&gt;
&lt;IsMarkedToBePrinted&gt;false&lt;/IsMarkedToBePrinted&gt;
&lt;/FinanceChargePreferences&gt;
&lt;JobsAndEstimatesPreferences&gt;
&lt;IsUsingEstimates&gt;true&lt;/IsUsingEstimates&gt;
&lt;IsUsingProgressInvoicing&gt;false&lt;/IsUsingProgressInvoicing&gt;
&lt;IsPrintingItemsWithZeroAmounts&gt;false&lt;/IsPrintingItemsWithZeroAmounts&gt;
&lt;/JobsAndEstimatesPreferences&gt;
&lt;PurchasesAndVendorsPreferences&gt;
&lt;IsUsingInventory&gt;true&lt;/IsUsingInventory&gt;
&lt;DaysBillsAreDue&gt;10&lt;/DaysBillsAreDue&gt;
&lt;IsAutomaticallyUsingDiscounts&gt;false&lt;/IsAutomaticallyUsingDiscounts&gt;
&lt;/PurchasesAndVendorsPreferences&gt;
&lt;ReportsPreferences&gt;
&lt;AgingReportBasis&gt;AgeFromDueDate&lt;/AgingReportBasis&gt;
&lt;SummaryReportBasis&gt;Accrual&lt;/SummaryReportBasis&gt;
&lt;/ReportsPreferences&gt;
&lt;SalesAndCustomersPreferences&gt;
&lt;IsTrackingReimbursedExpensesAsIncome&gt;false&lt;/IsTrackingReimbursedExpensesAsIncome&gt;
&lt;IsAutoApplyingPayments&gt;true&lt;/IsAutoApplyingPayments&gt;
&lt;PriceLevels&gt;
&lt;IsUsingPriceLevels&gt;true&lt;/IsUsingPriceLevels&gt;
&lt;IsRoundingSalesPriceUp&gt;true&lt;/IsRoundingSalesPriceUp&gt;
&lt;/PriceLevels&gt;
&lt;/SalesAndCustomersPreferences&gt;
&lt;TimeTrackingPreferences&gt;
&lt;FirstDayOfWeek&gt;Monday&lt;/FirstDayOfWeek&gt;
&lt;/TimeTrackingPreferences&gt;
&lt;CurrentAppAccessRights&gt;
&lt;IsAutomaticLoginAllowed&gt;false&lt;/IsAutomaticLoginAllowed&gt;
&lt;IsPersonalDataAccessAllowed&gt;false&lt;/IsPersonalDataAccessAllowed&gt;
&lt;/CurrentAppAccessRights&gt;
&lt;/PreferencesRet&gt;
&lt;/PreferencesQueryRs&gt;
&lt;/QBXMLMsgsRs&gt;
&lt;/QBXML&gt;
			</strHCPResponse>
			<strCompanyFileName>C:\Documents and Settings\Keith Palmer Jr\Desktop\Accounting\QBW\Test Company 2.QBW</strCompanyFileName>
			<qbXMLCountry>US</qbXMLCountry>
			<qbXMLMajorVers>5</qbXMLMajorVers>
			<qbXMLMinorVers>0</qbXMLMinorVers>
		</sendRequestXML>
	</soap:Body>
</soap:Envelope>

Every Subsequent Request

Every subsequent request will leave out the strHCPResponse data.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Body>
		<sendRequestXML xmlns="http://developer.intuit.com/">
			<ticket>a05fd1b411f6e22adbb5717f96876b5b</ticket>
			<strHCPResponse />
			<strCompanyFileName>C:\Documents and Settings\Keith Palmer Jr\Desktop\Accounting\QBW\Test Company 2.QBW</strCompanyFileName>
			<qbXMLCountry>US</qbXMLCountry>
			<qbXMLMajorVers>5</qbXMLMajorVers>
			<qbXMLMinorVers>0</qbXMLMinorVers>
		</sendRequestXML>
	</soap:Body>
</soap:Envelope>

Example SOAP Response

Your response should be a valid SOAP response with the qbXML portion encoded as a SOAP value. The example below shows a qbXML RecievePaymentAdd request being sent back to the QuickBooks Web Connector.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://developer.intuit.com/">
	<SOAP-ENV:Body>
		<ns1:sendRequestXMLResponse>
			<ns1:sendRequestXMLResult>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
			&lt;?qbxml version=&quot;2.1&quot;?&gt;
			&lt;QBXML&gt;
				&lt;QBXMLMsgsRq onError=&quot;stopOnError&quot;&gt;
					&lt;ReceivePaymentAddRq requestID=&quot;UmVjZWl2ZVBheW1lbnRBZGR8MTE2&quot;&gt;
						&lt;ReceivePaymentAdd&gt;
							&lt;CustomerRef&gt;
								&lt;ListID&gt;90000-1241602188&lt;/ListID&gt;
							&lt;/CustomerRef&gt;
							&lt;TxnDate&gt;2009-05-06&lt;/TxnDate&gt;
							&lt;RefNumber&gt;116&lt;/RefNumber&gt;
							&lt;TotalAmount&gt;265.40&lt;/TotalAmount&gt;
							&lt;Memo&gt;Payment for invoice #116&lt;/Memo&gt;
							&lt;IsAutoApply&gt;true&lt;/IsAutoApply&gt;
						&lt;/ReceivePaymentAdd&gt;
					&lt;/ReceivePaymentAddRq&gt;
				&lt;/QBXMLMsgsRq&gt;
			&lt;/QBXML&gt;</ns1:sendRequestXMLResult>
		</ns1:sendRequestXMLResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
quickbooks_web_connector_soap_sendrequestxml.txt · Last modified: 2013/01/21 12:44 (external edit)