How to Find Product Price Based on Customer Buying History from QuickBooks Desktop Applications

By: Ashish
Updated: April 2, 2018 | Technology: Asp.Net, QuickBooks Desktop
How to Find Product Price Based on Customer Buying History from QuickBooks Desktop Applications

We all know about Quickbooks desktop version, it’s the place where we can manage Sales, Inventory, Products, Suppliers and many more.We can manage whole company data in QuickBooks for a desktop.

There are 3 different Versions of Quickbooks:

  1. QuickBooks Online
  2. QuickBooks Payments
  3. QuickBooks Desktop

We can manage all the accounting and be invoicing data using with QuickBooks Desktop.

In Quickbooks desktop SDK we can develop desktop software that integrates Quickbooks easily, Which may be used for small business company’s.

In Quickbooks desktop SDK there are mainly two ways to communicate with Quickbooks Desktop:

  1. QBXML
  2. QBFC

In this blog, I have used QBXML for getting data.

Now Let’s focus on the topic How to find Product Price based on Customer buying History in Quickbooks desktop applications.

For archiving the goal I have used Sample Code of Quickbooks desktop SDK in QBXML.

I have divided whole things into small parts for understanding purpose.

This is a few steps which I want to discuss with you:

  1. Get All Invoices from Quickbooks desktop.
  2. Send Specific Customer’s ListID or FullName with InvoiceLineItems true for getting invoices of that specific Customer.
  3. Get All line items in new List from the Customer Invoices and Search for the specific items the last price from the list.
  4. Set it in the textbox of Price.

Now see all points one by one.

Get All Invoices from Quickbooks:

For getting data of all invoice from Quickbooks using qbxml we have to request the Quickbooks using xml.

In response, we will get all the invoices in XML form with all the fields of Invoice other than Invoice Line Items.We cannot get all the invoice line items.For invoice line items we have to pass specific listID of Customer.

For using further we have to Convert all XML into C# list.

Copy to Clipboard

Send Specific Customer’s ListID or FullName with InvoiceLineItems true for getting invoices of that specific Customer:

In this, we will send Customer’s ListID.

We also have to request for Invoice Line Items otherwise it will return the invoice to the customer but there is no any Invoice Line Items in that.

Copy to Clipboard

Here also what we get in responses_itemLines is XML. So we have to convert XML into List.here you have to make a new class of QBXML because the response of all invoices does not have Invoice line item in that, but now in responses_itemLines we have invoice line items.

Copy to Clipboard

Get All line items in new List from the Customer Invoices and Search for the specific items the last price from the list:

Copy to Clipboard

Set it in the textbox of a price:

Copy to Clipboard

So this is how we can find Product Price based on Customer buying History from QuickBooks.

Here is the full combined code, I have provided all parts in one code below.

NOTE: When you are requesting for Customer Wise invoice, XML should like:

Copy to Clipboard

Hope you enjoyed this article and may it help you out to get the better solutions for Quickbooks Desktop.

Still, if you are finding any more difficulties for the implementation then you can ask for the paid help from me or Satva Solutions Quickbooks API Integration Services.