Sample applications and code

This page helps you find a sample application written in 64-bit SDK that you can use to jump-start your own project. The first table lists the sample applications and contains links to detailed descriptions that are further down the page. You can scan the table to find an interesting sample and then click its name to see a detailed description of it. The detailed description will link to the source files in online repositories. In addition, many of the sample applications are installed with the SDK, with the default location of the samples directory being C:\Program Files\Intuit\IDN\QBSDK16.0\samples\qbdt.

View this sample application in 32-bit SDK.

The use of these sample applications is subject to the Terms of Service for Intuit Developer Services, which are available here.

Language qbXML QBFC
C#

SubscribeAndHandleQBEvent (desktop)

CustomerAdd (desktop)

None
C# ASP.NET WCWebService (desktop) None
C#.NET MCInvoiceAdd (desktop)

WCECommSample (desktop)

QBInvoiceAdd (desktop)

MCInvoiceAddQBFC (desktop)

C++

UIandEventTest (desktop)

sdktest (desktop)

hostquery (desktop)

addcustomerjob (desktop)

addcustomer (desktop)

multiplerequests (desktop)

itemquery (desktop)

invoicequery (desktop)

billadd (desktop)

Java

QueryRq (any)

QBWebConnectorSvc (desktop)

None
VB.NET

US_CDN_CustomerAdd (desktop)

SDKTestPlus3 (desktop)

SDKTest (desktop)

modifycustomer (desktop)

InventoryAdjust (desktop)

expensereport (desktop)

DepositAdd (desktop)

deletecustomer (desktop)

DataExtSample (desktop)

DataEvents (desktop)

customtxndetreport (desktop)

CDN_InvoiceAdd (desktop)

addcustomer (desktop)

SyncCustomerList (desktop)

PriceLevels (desktop)

ItemReceipt (desktop)

ItemInventoryMod (desktop)

GeneralSummaryReportQueryRq (any)

ExpenseReportByVendor (desktop)

DepositAdd (desktop)

DataExtensions (desktop)

CustomerAdd (desktop)

US_CDN_UK_CustomerQuery (desktop)

US_CDN_BillAdd (desktop)

PurchaseOrderModify (desktop)

MenuEventContext (desktop)

Macro (desktop)

itemquery (desktop)

InvoiceMod (desktop)

InventoryAdjust (desktop)

Events (desktop)

QBFCEventsSubscriber (desktop)

QBFCEventsCallback (desktop)

CDN_VendorAdd (desktop)

Invoicequery (desktop)

Billadd (desktop)

xml

AccountQueryRq (any)

BillQueryRq (any)

CheckQueryRq (any)

CompanyQueryRq (any)

EmployeeQueryRq (any)

EntityQueryRq (any)

HostQueryRq (any)

InvoiceQueryRq (any)

ItemInventoryQueryRq (any)

ItemSalesTaxQueryRq (any)

ItemServiceQueryRq (any)

PayrollItemWageQueryRq (any)

PreferencesQueryRq (any)

ReceivePaymentQueryRq (any)

SalesRepQueryRq (any)

AccountAddRq (any)

AccountQueryRq_1 (any)

AccountQueryRq_2 (any)

AccountQueryRq_3 (any)

AccountQueryRq_4 (any)

AccountQueryRq_5 (any)

AccountQueryRq_6 (any)

AccountQueryRq_7 (any)

AddInvoiceSpecifyTemplate (any)

CustomDetailReport (any)

CustomerAddRq (any)

CustomerQuery (any)

CustomerQuery_metadata (any)

CustomFieldAddValue (any)

CustomFieldDelValue (any)

CustomFieldModValue (any)

DepositAddRq (any)

DisplayList (any)

DisplayTxn (any)

ErrRecovery1 (any)

ErrRecovery2 (any)

ErrRecovery3 (any)

HostQuery (any)

ItemsAddRq (any)

ItemServiceAddRq (any)

JournalEntryAddRq (any)

ProfitAndLossStdReport (any)

QueryFilterRq (any)

ReceivePaymentAddRq (any)

ReceivePaymentToDepositQueryRq (any)

TemplateQuery (any)

TxnDisplayAdd_Invoice (any)

VendorAddRq (any)

None
MCInvoiceAddQBFC (desktop)

This sample is a C# .NET desktop application that uses QBFC to create a new QuickBooks invoice using the multicurrency feature in QuickBooks. It uses QBFC Template Wizard shipped with the SDK (7.0 or later). The sample demonstrates how to populate some of the user input with results from querying QuickBooks, allowing the user to input data and add an invoice to QuickBooks running on the desktop (same machine). The behavior of exchange rate and line item prices are similar to QuickBooks UI.

Running the sample

Before running MCInvoiceAddQBFC.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company file (preferably sample_product-based business.qbw) open.

Building the sample

Open MCInvoiceAddQBFC.sln in Microsoft Visual Studio .NET (2015 or higher) and build the solution.

Project files

Individual files:

QBInvoiceAdd (desktop)

This sample is a C# .NET desktop application that creates a new QuickBooks invoice by calling interop.QBFC.dll. It demonstrates how to populate some of the user input with results from querying QuickBooks, allowing the user to input data and add an invoice to the QuickBooks running on the desktop (same machine). This sample also implements QBFC’s automatic error recovery feature.

Running the sample

Before running InvoiceAdd.exe, make sure that the .NET runtime is installed on the machine, and that QuickBooks is running with a company file (preferably sample_product-based business.qbw) open.

Building the sample

Open InvoiceAdd.sln in Microsoft Visual Studio .NET and build the solution. Interop.QBFC.dll is generated by Visual Studio by adding a COM reference to the DLL.

Project files

Individual files:

WCECommSample (desktop)

This sample is a C# .NET desktop application that uses QBFC to create a new QuickBooks transaction featured in QuickBooks. It uses QBFC Template Wizard shipped with the SDK (7.0 or later). The sample demonstrates how to use QuickBooks Web Connector to communicate with QuickBooks and sync data with a client database. It uses a simple phone card e-commerce example.

There are three components to this sample, listed in order of execution of steps:

Running the sample

Before running WCECommSample.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company file (preferably sample_product-based business.qbw) open.

Preparation
  1. Copy the entire WCECommSample directory into your c:\inetup\wwwroot path. If you are using Microsoft Developer Studio, the tool should automatically do this step for you.
  2. From IIS_Console, right-click WCECommSample (client, merchant, service) and select Properties. Click the Create button next to Application Name.
Client-side transaction
  1. Point your IE browser to: http://localhost/WCECommSample/client/Default.aspx
  2. Database ecommdb is pre-populated with a username and password (encryption is not used for simplicity of the sample) to log on to the client site. If you want to create a new user, use “sign-up” from the log on page. A new user created here will be transferred as a customer into QuickBooks on next update session with web connector.
  3. Database ecommdb is also pre-populated with some sample items (phone calling cards) that you could use for this sample. On the next update session with web connector (via Merchant site) any inventory items that you have in QuickBooks will be transferred to ecommdb.
  4. After you log on, do some purchasing (it’s a simulation not tied to any payment system, so don’t worry :-)) on the client to create some txns (salesreceipts).
Merchant site administration
  1. Point your IE browser to: http://localhost/WCECommSample/merchant/setup.html
  2. Start with an empty company file (no customers and inventory items).
  3. Set up WCECommService with QBWC using the merchant site, following the steps described on the site.
Web service
Building the sample

Open WCECommSample.sln in Microsoft Visual Studio .NET (2005 or higher) and build the solution.

Project files
Get all files (zipped): zips/WCECommSample.zip

Individual files:

CustomerAdd (desktop)

This sample is a simple .NET C# desktop application that creates a new QuickBooks customer by calling the qbXMLRP COM DLL. Standard .NET classes are used to format the qbXML request and parse the qbXML response.

Running the sample

Before running CustomerAdd.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company open.

Building the sample

Open CustomerAdd.sln in Microsoft Visual Studio .NET and build the solution. Interop.QBXMLRPLib.dll is generated by Visual Studio by adding a COM reference to qbXMLRP.dll.

Project files

Individual files:

MCInvoiceAdd (desktop)

This sample is a C# .NET desktop application that creates a new QuickBooks invoice using the multicurrency feature in QuickBooks. It demonstrates how to populate some of the user input with results from querying QuickBooks, allowing the user to input data and add an invoice to QuickBooks running on the desktop (same machine). The behavior of exchange rate and line item prices are similar to QuickBooks UI.

Running the sample

Before running MCInvoiceAdd.exe, make sure that the.NET runtime is installed on the machine, and QuickBooks is running with a company file (preferably sample_product-based business.qbw) open.

Running the sample

Open MCInvoiceAdd.sln in Microsoft Visual Studio .NET (2005 or higher) and build the solution. Interop.QBXMLRP2.dll is generated by Visual Studio by adding a COM reference to the DLL.

Project files

Individual files:

SubscribeAndHandleQBEvent (desktop)

This sample is a simple .NET C# desktop application that subscribes to and listens for customer add, modify and delete events. This application also provides a means to add custom menu items under the Customers menu in QuickBooks and listen for the menu click event for this item. Standard .NET classes are used to format the qbXML request and parse the qbXML response.

Running the sample

Before running SubscribeAndHandleQBEvent.exe, it must be registered as COM out of the proc server. Run the following to see the various options with the exe:

SubscribeAndHandleQBEvent.exe -h

Make sure that the .NET runtime is installed on the machine. QuickBooks must be restarted every time you add a new event subscription. Follow these steps to run the sample:

  1. Copy the .exe to the QuickBooks install directory.
  2. Register the .exe as out of proc server.
  3. Subscribe for Data and/or UI extension events.
  4. Start QuickBooks and accept the SDK request.
  5. Modify or add a customer, or click on the newly added menu item.

A message box should appear with the event qbXML.

Building the sample

Open SubscribeAndHandleQBEvent.sln in Microsoft Visual Studio .NET and build the solution. Interop.QBXMLRPLib.dll is generated by Visual Studio by adding a COM reference to qbXMLRP.dll. Interop.QBSDKEVENTLib.dll is generated by Visual Studio by adding a COM reference to qbsdkevent.dll.

Project files

Individual files:

WCWebService (desktop)

This sample is a C# ASP.NET web service application that communicates with QuickBooks 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. For simplicity, it sends three request XMLs: CustomerQuery, InvoiceQuery, and BillQuery.

Running the sample

You will need Microsoft Internet Information Services (IIS) installed on your system to run this sample. The sample assumes that you have configured IIS with ASP.NET and have a functional system to deploy this web service sample.

If you have not yet configured ASP.NET with IIS, you may need to run the following command from c:\windows\Microsoft.NET\Framework\ your_asp_dot_net_version path:

aspnet_regiis /i

This will help avoid the occasional message from the Microsoft development environment such as “VS.NET has detected that the specified web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET web applications or services).”

Copy the entire directory to the inetpub\wwwroot path. Before running this web service sample against QBWebConnector, make sure that IIS and the .NET runtime are installed on the machine, and that QuickBooks is running with a company file open.

As with any web service application that writes to the directory, configure permission for your ASP.NET user account so it can read and write to the directory. Here is one way to set permission for an ASP.NET user in Windows XP:

  1. Select Start > ControlPanel > AdministrativeTools > ComputerManagement > LocalUsersAndGroups > Users.
  2. Right-click ASPNET and select Properties > MemberOf > Administrators group (to be able to write to files).
  3. Within IIS Console, set the WCWebService properties as follows:

Alternatively, you could set your Windows username and password in the Web.config file, but that may not be safe.

When the sample web service is built successfully, run QBWebConnector and use “Load an application” to load the .qwc files provided with this sample. For development purposes, you can use http://localhost for your web service AppURL. We have provided a sample web connector configuration file (HTTPWebService.qwc) for your convenience. You could also double-click on the .qwc files, which automatically runs the QBWebConnector loaded with the application.

The .qwc (QuickBooks Web Connector Configuration) file introduces a sample web service to the QBWebConnector. This sample web service uses the Windows event log to trace activity while being updated from the QBWebConnector.To view the event log, go to Start > Programs > Administrative Tools > Event Viewer and look under the Application section.

Building the sample

Open WCWebService.sln in Microsoft Visual Studio .NET and build the solution.

Note

Note

For production purposes, use https. There are some rules to be satisfied before QBWebConnector can load a web service. For information on these rules, see the Programmer’s Guide to the QuickBooks Web Connector PDF . Due to the requirement for this sample to built and deployed to a web server there is no link to run the sample from the samples browser, nor is the sample distributed with built binaries.

Project files

Individual files:

BillAdd (desktop)

BillAdd demonstrates adding a bill using QBFC. It includes examples of the following:

Project files
Get all files (zipped): zips/cppqbfcbilladd.zip

Individual files:

InvoiceQuery (desktop)

InvoiceQuery is a C++ sample that demonstrates querying for the list of invoices. It includes examples of the following:

Project files

Individual files:

ItemQuery (desktop)

ItemQuery is a C++ sample that demonstrates querying items. Querying items is similar to querying terms or entities in the sense that the returned detail object is a list of OR objects—ORItemRet in this case. It includes examples of the following:

Project files

Individual files:

MultipleRequests (desktop)

MutipleRequests is a C++ sample that demonstrates sending multiple requests in one message set. It includes examples of the following:

Project files

Individual files:

UIandEventTest (desktop)

These applications are designed for testing and demonstrating the UI functionality of QBSDK 3.0. These applications are built with Visual Studio 6.0. This sample consists of the following sub-samples:

The shared directory contains files shared by all of the applications above.

EventHandler (desktop)

EventHandler is the event callback handler for the MenuSubscribe sample application. Run this and register it (Files->Register) before running MenuSubscribe.

Project files

Individual files:

EventSubscribe (desktop)

This sample performs data and UI event subscriptions on behalf of the EventHandler application, which subsequently receives the notifications.

Project files

Individual files:

InvokeUI (desktop)

InvokeUI opens form windows in QuickBooks for new and existing transactions and list items.

Project files

Individual files:

MenuSubscribe adds UI Extension (menu) subscriptions to QuickBooks: Run and register the EventHandler sample before running this sample.

Project files

Individual files:

Addcustomer (desktop)

This C++ sample demonstrates the minimal qbXML required to add a customer to QuickBooks. The user can view the qbXML request and response.

Project files

Individual files:

Addcustomerjob (desktop)

This C++ sample demonstrates the minimal qbXML required to add a customer and a customer job (sub customer) to QuickBooks.

Project files

Individual files:

Hostquery (desktop)

This VC++2005 sample demonstrates the minimal qbXML required to perform a hostquery to QuickBooks. The user can view the qbXML request and response in a message box. The intent of this sample is to demonstrate how to utilize the QBXMLRP2 library using VC+2005.

Project files
Get all files (zipped): zips/hostquery.zip

Individual files:

SDKtest (desktop)

This C++ version of SDKTest accepts a qbXML request and returns a qbXML response. This is a command line program rather than a GUI application.

Project files
Get all files (zipped): zips/cppqbxmlsdktest.zip

Individual files:

QBWebConnectorSvc (desktop)

This sample is a Java web service application that communicates with QuickBooks via QBWebConnector. This sample is primarily intended to demonstrate how to implement the required methods. This sample implements the QWC 1.0 spec and requires Tomcat and Axis.

Running the sample

Run compit \*.java to compile all the Java sources. Copy the resulting directory structure (starting at “com”) to the TOMCAT_HOME/webapps/axis/WEB-INF directory.

Project files
Get all files (zipped): zips/QBWebConnector.zip

Individual files:

QueryRq (any)

This XML file contains a simple query request for multiple objects. None of the requests contain filtering parameters. These are requests for all data for each data type.

Project files

Individual files:

CustomerAdd (desktop)

This sample is a simple VB.NET desktop application that creates a new QuickBooks customer using the QBFC2 COM DLL.

Running the sample

Before running CustomerAdd.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company open.

Building the sample

Open CustomerAdd.sln in Microsoft Visual Studio .NET and build the solution. QBFC2Assembly.dll is generated using the tlbimp .NET Type Library to Assembly Convertor.

Project files

Individual files:

DataExtensions (desktop)

This sample is a simple VB.NET desktop application that creates data extension definitions and allows data extensions to be added to a customer.

Running the sample

Before running DataExtSample.exe, make sure that the.NET runtime is installed on the machine and that QuickBooks is running with a company open.

Building the sample

Open DataExtensions.sln in Microsoft Visual Studio .NET and build the solution. QBFC2Assembly.dll is generated using the tlbimp .NET Type Library to Assembly Convertor.

Project files

Individual files:

DepositAdd (desktop)

This sample is a simple VB.NET desktop application that enters a new deposit into QuickBooks using the QBFC2 COM DLL.

Running the sample

Before running DepositAdd.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company open.

Building the sample

Open DepositAdd.sln in Microsoft Visual Studio .NET and build the solution. QBFC2Assembly.dll is generated using the tlbimp .NET Type Library to Assembly Convertor.

Project files

Individual files:

ExpenseReportByVendor (desktop)

This sample is a simple VB.NET desktop application that runs an expense report.

Running the sample

Before running ExpenseReport.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company open.

Building the sample

Open ExpenseReport.sln in Microsoft Visual Studio .NET and build the solution.

Project files

Individual files:

GeneralSummaryReportQueryRq (any)

This sample queries a General summary report of type ExpenseByVendorSummary. The sample summarizes columns by month, using the fiscal year for the reporting calendar.

Individual files:

ItemInventoryMod (desktop)

This sample is a simple VB.NET desktop application that modifies an Inventory Item for a QuickBooks customer by using the QBFC2 COM DLL.

Running the sample

Before running ItemInventoryMod.exe, make sure that the .NET runtime is installed on the machine and that QuickBooks is running with a company open.

Building the sample

Open ItemInventoryMod.sln in Microsoft Visual Studio .NET and build the solution.

Project files

Individual files:

ItemReceipt (desktop)

This sample illustrates the basics of receiving items against a PO already recorded in QuickBooks.

Project files

Individual files:

PriceLevels (desktop)

This sample is a simple VB.NET desktop application that manages price levels in QuickBooks to demonstrate PriceLevel requests. You may also be interested in the InvoiceAdd sample, which demonstrates the use of a PriceLevel when entering invoice lines from the SDK.

Project files

Individual files:

SyncCustomerList (desktop)

This sample maintains a simulation of an application-side customer database and synchs it with QB.

Project files

Individual files:

AddInvoice (desktop)

AddInvoice is VB sample code that shows how the same invoice can be added using qbXML built with the MSXML4 DOM parser and QBFC. It is intended to be used with the sample product-based company file and expects that QuickBooks 2003 Pro or above is running with that company file open.

Project files

Individual files:

CDN_VendorAdd (desktop)

This QBFC sample is meant to be run against either QuickBooks 2002+ US version or QuickBooks 2003+ Canadian version. It expects QuickBooks to be running with a company file open and the Admin user logged in. This sample app will work with or without multicurrency turned on in the accounting preferences. This sample app shows how to:

Project files

Individual files:

DataExtensions (desktop)

This sample presents a UI for viewing and adding data extensions to a company.

Project files

Individual files:

DepositAdd (desktop)

This sample VB program provides QBFC examples for querying QuickBooks for undeposited funds and adding a deposit transaction to QuickBooks.

Project files

Individual files:

Events (desktop)

The QBFCEventsSubscriber and QBFCEventsCallback samples work together to show how to implement Data and UI event subscription and callback handling using the QBFC library.

The QBFCEventsSubscriber application subscribes to the CustomerAdd and company file Close events. The QBFCEventsCallback application parses and processes the events. If there is a CustomerAdd event, the callback application queries for that customer using the ListID in the event to get the FullName and displays a non-blocking UI message to the user about the added customer. (Blocking UI messages can prevent the reception and handling of subsequent events, including company Close events.) The QBFCEventsCallback application also contains a query to get all the customers from the QuickBooks company file. This functionality is available until a company file Close event is received. When a company file Close event is received, the Query button is grayed and the user can no longer query QuickBooks.

Project files

Individual files:

QBFCEventsCallback (desktop)

This sample handles CustomerAdd and company File Close events from QuickBooks and displays the added customer in the UI, along with any errors. You must have this executable running in order to subscribe to it from the QBFCEventsSubscriber program.

Project files

Individual files:

QBFCEventsSubscriber (desktop)

This sample subscribes the QBFCEventsCallback.exe sample to receive CustomerAdd data events from QuickBooks, as well as company file Close events. In order to subscribe, the QBFCEventsCallback sample must be running.

Project files

Individual files:

ExpenseReportByVendor (desktop)

This VB sample program uses QBFC to generate an expense report for the selected company. It also displays the request and response messages generated by and returned to the program.

Project files

Individual files:

InventoryAdjust (desktop)

This sample VB application uses QBFC. It allows the user to select an ItemInventory item, Customer, Class, or Account, then define changes to the InventoryItem. The InventoryItem can then be added to the currently open QuickBooks company.

Project files

Individual files:

InvoiceMod (desktop)

The InvoiceMod sample program allows users who are running QB 2003 R7P to modify invoices in a company file. QuickBooks must be running and, if this is the first time the sample is run against a company file, the Admin user must have the company file open. When running the InvoiceMod sample, choose at the onset whether to use QBXMLRP or QBFC. The sample continues to use that method throughout the rest of the current run of the sample program.

The first screen the sample program presents to the user allows them to query for one invoice by invoice number (RefNumber) or by most of the other filter criteria (except TxnID) that can be used in an invoice query request. MaxReturned is hard-coded at 30 to prevent processing too many invoices. You can look at the qbXML used in the query or the QBFC calls made to create the query by checking the Show Invoice Query checkbox at the bottom left of the query screen. Once a query has been performed, the user is presented with a list of up to 30 invoices. The user can choose to modify an invoice by clicking on it and then clicking the Modify Invoice button. After clicking the Modify Invoice button, the InvoiceMod sample program queries for the invoice details and for list items displayed in the combo boxes on the Modify Invoice screen. Depending on the size of the company file this may take a little while.

A form with invoice information then appears, including a display at the bottom with invoice line information. The user may add or modify any information that can be added, removed, or modified in an invoice. When the user chooses to edit an existing invoice line or add a new invoice line, an invoice line editing form appears. The user can also delete invoice lines from an invoice. Invoice lines appear in different colors depending on their status:

A user can save the modifications to an invoice by clicking on the Modify Invoice button at the bottom right of the screen. The user can select the Show request check box to show the qbXML or the QBFC calls used to modify the invoice.

Project files

Individual files:

ItemInventoryMod (desktop)

This sample VB application uses QBFC. It allows the user to select an existing ItemInventory item, then modify all of its fields via text boxes.

Project files

Individual files:

Macro (desktop)

This VB application allows the user to select an existing estimate and create an invoice and a receive payment at the same time, using the QBFC macro feature.

Project files

Individual files:

MenuEventContext is VB sample code that shows how to add menus to QuickBooks and how, with QuickBooks 2005 and later, you can get information about which forms (if any) are open in QuickBooks at the time the menu is chosen.

Project files

Individual files:

PurchaseOrderModify (desktop)

The PurchaseOrderModify sample program allows users who are running QB 2003 R7P to close purchase orders or purchase order lines in a company file. QuickBooks must be running, and if this is the first time the sample will be run against a company file the Admin user must have the company file open.

When the PurchaseOrderModify sample is run, choose at the onset whether QBXMLRP or QBFC is to be used by the sample application. The sample continues to use that method throughout the rest of the current run of the sample program. The next form presented to the user lists up to 30 open purchase orders in the company file. The sample program uses the GeneralDetailReportQuery to retrieve columns from the OpenPOs report. It uses the new SDK 2.1 feature that allows the return of the TxnID column in an SDK report query response. It displays information about the open purchase orders and allows the user to choose a purchase order to modify.

Once a user has selected a purchase order by clicking on its information and clicks the View Purchase Order Details button, a screen listing the purchase order information and lines is displayed. The user may then choose to close the entire purchase order or close an individual line of the purchase order. They may also simulate the receipt of items against a purchase order or an individual purchase order line.

The SDK is unable to link bills created through the SDK to existing purchase orders. This sample uses a method we suggest developers use in the absence of the ability to create the purchase order to bill links. The Received Quantity value for purchase order lines cannot be modified because this is done by creating a link to a bill or item receipt through the QuickBooks UI. Using the SDK, an application must instead reduce the quantity ordered by the number they wish to have received against the purchase order line and create a bill for those items. When the sample application does this, it uses the quantity still on order (ordered minus quantity received) and modifies the purchase order line or lines to reflect the quantity received already through the UI. It also adds information to the memo field of the bill is created for the item or items and the purchase order memo field indicating what it has done.

Project files

Individual files:

SyncCustomerList (desktop)

This sample VB application shows how to synchronize a customer list using QBFC.

Project files

Individual files:

US_CDN_BillAdd (desktop)

BillAdd demonstrates adding a bill to either Desktop or QuickBooks Online using QBFC. It includes examples of the following:

Project files

Individual files:

US_CDN_UK_CustomerQuery (desktop)

This sample demonstrates how to call HostQuery to determine the version of QuickBooks running and thereby use the appropriate QBFC library to communicate with it. The sample was intentionally kept simple in order to keep the HostQuery implementation clean and easy to follow.

Project files

Individual files:

VersionDependentCustAdd (desktop)

In this sample VB application that uses QBFC to add a customer, there is a check of the qbXML version currently being used by the installed copy of QuickBooks. Different code is executed depending on which version is being used. If an unexpected version is being used, the application displays an error message.

Project files

Individual files:

BillAdd (desktop)

BillAdd demonstrates adding a bill to either Desktop or QuickBooks Online using QBFC. It includes examples of the following:

Project files
Get all files (zipped): zips/BillAdd.zip

Individual files:

CustomerAdd (desktop)

This application presents a simple UI that can be used to add a customer to QuickBooks.

Project files

Individual files:

invoicequery (desktop)

InvoiceQuery demonstrates querying for the list of invoices. It includes examples of the following:

Individual files:

ItemQuery (desktop)

ItemQuery demonstrates querying items. Querying items is similar to querying terms or entities in the sense that the returned detail object is a list of OR objects—ORItemRet in this case. It includes examples of the following:

Project files

Individual files:

AddReceivePayment (desktop)

This application allows you to choose a customer, an invoice, and an optional Credit Memo, and apply a payment.

Project files

Individual files:

CDN_InvoiceAdd (desktop)

This sample VB program lets you add an invoice that runs against the QuickBooks 2003 Canadian version. It uses the item types Item Service, Item Non Inventory, and Item Other Charge. This sample verifies whether the current version of QuickBooks is compatible with the sample application.

Project files

Individual files:

DataEvents (desktop)

This application demonstrates the use of DataEvents to keep a simple database (implemented as a Windows ListView common control) of customers in sync with the QuickBooks customer list using DataEvents, and shows the careful use of Data Extensions as a direct result of events received. See the code commentary for details regarding the discretion and care required if you plan to do anything other than query data as a direct result of an event. This sample application is made up of the following three executable sub-samples:

The first time you run this application it will take some time as it creates a data extension and each customer record is extended to store the position the customer record holds in the ListView. From then on that position belongs to that customer. This means that as customers are added and deleted in QuickBooks, records will not be in alphabetical order in the listview and records deleted since the first time the application ran will be shown in the list view as #deleted. In short, to successfully run this sample:

  1. Register the event manager with COM.
  2. Run the DataEventSubscriber to subscribe to events.
  3. Restart the QB company file, so that the subscription is acknowledged.
  4. Start QBDataEventApp.exe.
  5. Modify/add/delete customers in QB and notice that they are updated in QBDataEventApp as well.
QBDataEventSubscriber (desktop)

Subscribes the DataEvents sample to receive data events from QuickBooks. This is the sort of application you would build as a Custom Action for an MSI installer to subscribe your application to events when you install your app and unsubscribe when your app is uninstalled. You must run this executable to subscribe the EventManager to events for the others to do anything interesting.

Project files

Individual files:

QBDataEventManager (desktop)

Handles events from QuickBooks and supplies them to the main application via a second COM method. This application has a UI to display the incoming event XML. This executable is started automatically by QuickBooks (or the DataEventApp) as it is a COM server. This executable must be registered as a COM server prior to use and before you can successfully run the QBDataEventSubscriber. Simply run the following:

QBDataEventManager.exe /REGSERVER.
Project files

Individual files:

QBDataEventApp (desktop)

This application provides the UI for this sample. All this application does is display a form with a list view of the customer list from QuickBooks. As customers are changed, added, and deleted in QuickBooks (or by other applications) those changes are reflected in the list view. Changed customers are displayed in red, new customers in blue, deleted customers in yellow with the name replaced by #deleted. The first time you run this application it will take a little while as it will create a data extension and each customer record will be extended to store the position the customer record holds in the ListView, (If you have already subscribed the event handler you will see an event for each customer being extended) from then on that position belongs to that customer! This means that as customers are added and deleted in QuickBooks records will not be in alphabetical order in the listview and records deleted since the first time the application ran will be shown in the list view as #deleted.

Project files

Individual files:

DataExtSample (desktop)

The Data Extension Sample program displays the currently defined data extension definitions and custom fields, allows the user to add more data extension definitions, and allows then to add data extension values to customer records or modify existing data extension values for customers.

Project files

Individual files:

DepositAdd (desktop)

Lists funds available for deposit and allows them to be added to QuickBooks.

Project files

Individual files:

InventoryAdjust (desktop)

This sample VB application allows the user to select an ItemInventory item, Customer, Class, and Account, then define changes to the InventoryItem. The InventoryItem can then be added to the currently open QuickBooks company.

Project files

Individual files:

SDKTestPlus3 (desktop)

This is an enhanced version of SDKTest that shows how to integrate with QuickBooks SDK. This sample allows a user to select a qbXML request file and submit it to QuickBooks for processing. It allows the selection of a company file name for BeginSession, control over the application name sent to QuickBooks, and support for sending both data requests and subscription requests. The application is an excellent tool for diagnosing SDK problems.

Project files

Individual files:

US_CDN_CustomerAdd (desktop)

This VB.NET sample runs against either QuickBooks 2015 US or Canada. It determines which version of QuickBooks is running and then brings up a form that has been modified depending on the nationality of QuickBooks. The user may then add customers to that company file by providing customer name and billing address information.

Project files

Individual files:

Addcustomer (desktop)

This application presents a simple UI that can be used to add a customer to QuickBooks.

Project files

Individual files:

Customtxndetreport (desktop)

This VB sample program generates a custom transaction detail (CustomTxnDetail) report from the selected company and using the specified filters.

Individual files:

Deletecustomer (desktop)

Shows how to delete a customer via qbXML.

Project files

Individual files:

Expensereport (desktop)

Prints an ExpenseByVendorSummary report illustrating how to calculate the percentage columns since the SDK does not directly allow access to these.

Project files

Individual files:

Modifycustomer (desktop)

In this VB.NET sample application you specify the company, then are prompted to select a customer from the displayed list of customers. After you select a customer name, a window is provided where you can modify its various fields.

Project files

Individual files:

SDKTest (desktop)

Shows how to integrate with the QuickBooks SDK. Allows user to select a qbXML request file and submit it to QuickBooks for processing.

Project files
Get all files (zipped): zips/vbqbxmlSDKTest.zip

Individual files:

XML Samples
AccountQueryRq (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

BillQueryRq (any)

This XML file contains a single request to query bills.

Project files

Individual files:

CheckQueryRq (any)

This XML file contains a single request to query all checks.

Project files

Individual files:

CompanyQueryRq (any)

This XML file contains a single request to query all companies.

Project files

Individual files:

EmployeeQueryRq (any)

This XML file contains a single request to query all employees.

Project files

Individual files:

EntityQueryRq (any)

This XML file contains a single request to return all entities.

Project files

Individual files:

HostQueryRq (any)

This XML file contains a single request to obtain the QB version and support information about the host running QuickBooks.

Project files

Individual files:

InvoiceQueryRq (any)

This XML file contains a single request to get all invoices.

Project files

Individual files:

ItemInventoryQueryRq (any)

This XML file contains a single request to return all of the items in inventory.

Project files

Individual files:

ItemSalesTaxQueryRq (any)

This XML file contains a single request to return the configured sales tax schedules.

Project files

Individual files:

ItemServiceQueryRq (any)

This XML file contains a single request to return all service-related items.

Project files

Individual files:

PayrollItemWageQueryRq (any)

This XML file contains a single request to return all of the payroll wage items.

Project files

Individual files:

PPreferencesQueryRq (any)

This XML file contains a single request to return all preferences data.

Project files

Individual files:

ReceivePaymentQueryRq (any)

This XML file contains a single request to return all of the payments. This request can return a great deal of data, even in the demo system. This is an excellent opportunity to experiment with date parameters or other filtering options.

Project files

Individual files:

SalesRepQueryRq (any)

This XML file contains a single request to return all sales report data.

Project files

Individual files:

AccountAddRq (any)

This XML file contains a single request to add an account.

Project files

Individual files:

AccountQueryRq_1 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AccountQueryRq_2 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AccountQueryRq_3 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AccountQueryRq_4 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AccountQueryRq_5 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AccountQueryRq_6 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AccountQueryRq_7 (any)

This XML file contains a single request to query all accounts. It does not filter the output so many accounts might cause this to be a bit slow.

Project files

Individual files:

AddInvoiceSpecifyTemplate (any)

This XML file contains one request to add an invoice specifying the template to be used for the invoice. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

CustomDetailReport (any)

This XML file contains a single request to generate a custom detail report.

Project files

Individual files:

CustomFieldAddValue (any)

This XML file contains a single request to add a value to a custom field for a pre-existing customer in the QuickBooks 2004 sample product-based company file. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

CustomFieldDelValue (any)

This XML file contains a single request to delete (clear) a value in a pre-existing custom field for a customer in the QuickBooks 2004 sample product-based company file. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

CustomFieldModValue (any)

This XML file contains a single request to modify a value in a pre-existing custom field for a customer in the QuickBooks 2004 sample product-based company file. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

CustomerAddRq (any)

This XML file contains two customer add requests. The first request adds a top-level customer, and the second request adds a job.

Project files

Individual files:

CustomerQuery (any)

This XML file contains a single request to query for customers. Since no filters are used in this request, all customers will be returned. This could be slow on company files with large numbers of customers. You should use iterators or filters to reduce the amount of data returned.

Project files

Individual files:

CustomerQuery_metadata (any)

This XML file contains a single request to query for customers. Only the count of customers will be returned in the response.

Project files

Individual files:

DepositAddRq (any)

This XML file contains a single request to add a deposit to a checking account. This sample requires there to be an account named “Checking”.

Project files

Individual files:

DisplayList (any)

This request allows an application to cause QuickBooks to bring up the edit window for an new entity. An application can use this feature if the application’s design requires the creation of a new entity, but the frequency of this operation is low enough that implementing the UI for the creation doesn’t make sense. This XML file contains a single request to display the Other Name add UI. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

DisplayTxn (any)

This request allows an application to cause QuickBooks to bring up the edit window for an existing transaction. An application can use this if the application’s design allows or requires transaction modifications to be performed in the QuickBooks UI. It can also be used to present an existing transaction so that operations not supported by the SDK can be performed by the user in the QuickBooks UI. For example, you cannot cause items to be received against a Purchase Order by adding a bill from an application through the SDK. An application could instead direct the user to create a bill or item receipt against a Purchase Order and bring up the PO so the user only needs to right-click on the PO to perform the operation. This XML file contains a single request to display a purchase order that exists in the sample product-based company file. QuickBooks must have the sample product-based company file open in order for this request to work. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

ErrRecovery1 (any)

This file contains an XML request to add a check. It also passes in a new message set ID so information for this session will be saved. If everything proceeds normally, the check request will be processed and the session status will be saved. In the event of a failure (or just to test) this XML file may be sent to QuickBooks a second time and status will be returned for the message set named by the ID “AB1F2395”.

Next Request ErrRecovery2.xml

Project files

Individual files:

ErrRecovery2 (any)

This XML file contains no requests. It asks QuickBooks for the status of a message set that it sent earlier, named by “AB1F2395”.

Previous Request: ErrRecovery1.xml
Next Request ErrRecovery3.xml
Project files

Individual files:

ErrRecovery3 (any)

This XML file contains no requests. It asks QuickBooks to delete the session status saved for the session with the ID of “AB1F2395”.

Previous Request: ErrRecovery2.xml

Project files

Individual files:

HostQuery (any)

This XML file contains a single request to obtain the QB version and support information about the host running QuickBooks.

Project files

Individual files:

ItemServiceAddRq (any)

This XML file contains a request to add a particular service item. This script depends on there being an account named “Construction”.

Project files

Individual files:

ItemsAddRq (any)

This XML file contains four add requests for items: an inventory item, non-inventory item, service item, and a sales tax item.

Project files

Individual files:

JournalEntryAddRq (any)

This XML file contains a single request to add a journal entry transaction. This example depends on having Bank accounts named “Bank Account 1” and “Bank Account 2” and the classes “Class1” and “Class2”.

Project files

Individual files:

ProfitAndLossStdReport (any)

This XML file contains a single request to generate a standard P&L, summarized by month for a specified date range.

Project files

Individual files:

QueryFilterRq (any)

This XML file contains several query requests. One request asks for the Other Expenses account. Another request asks for Customers based on their names. This examples depends on the following:

In order for this query to return the expected data, you must run the sample XML file CustomerAddRq.xml.

Previous Request: CustomerAddRq.xml

Project files

Individual files:

ReceivePaymentAddRq (any)

This XML file contains a single request to add a receive payment. This sample requires at least a 1.1 version DOCTYPE since this request is not implemented in earlier versions.

Project files

Individual files:

ReceivePaymentToDepositQueryRq (any)

This is a helper request that provides a response that contains a list of payments that are available to deposit.

Project files

Individual files:

TemplateQuery (any)

This XML file contains a single request to query for the list of templates defined for the currently open company file. This is the request an application would use to determine which templates are defined in a company file. An application might ask a user to import or download a template if it can’t find a particular template in the query response. Another strategy would be to have the user designate a template to be used when the application creates a particular transaction. This XML file will only work when passed through the QBXMLRP2 request processor. The QBXMLRP request processor does not support SDK 3.0 version messages.

Project files

Individual files:

TxnDisplayAdd_Invoice (any)

This sample illustrates the transaction display add request for an invoice, prefilling the new invoice with an existing customer name. The end user has to tab out of the new invoice form in QuickBooks to complete the prefilling, just as the user would when working purely in QuickBooks.

Project files

Individual files:

VendorAddRq (any)

This XML file contains one add request for a vendor. This sample depends on a vendor type called “Materials”.

Project files

Individual files: