Quickstart
-
Open Home in a test project. If it shows Add sample company, select it. Then select Send test request.
-
Create a key and set
DAAPI_SECRET_KEY:Terminal window export DAAPI_SECRET_KEY="sk_test_..." -
Run the code on Home. It lists five customers.
Home shows this code with the sample company’s end-user ID in place of eu_01j9....
npm install @desktopaccountingapi/quickbooks-desktop@0.12.1npm pkg set type=moduleimport { DesktopAccountingApi } from "@desktopaccountingapi/quickbooks-desktop";
const qb = new DesktopAccountingApi().forEndUser("eu_01j9..."); // reads DAAPI_SECRET_KEY
const page = await qb.qbd.customers.list({ limit: 5 });for (const customer of page.data) console.log(customer.fullName);Run it with node list-customers.ts (Node.js 22.18 or later).
pip install desktopaccountingapi-quickbooks-desktop==0.12.1from desktopaccountingapi import DesktopAccountingApi
qb = DesktopAccountingApi().for_end_user("eu_01j9...") # reads DAAPI_SECRET_KEY
page = qb.qbd.customers.list(limit=5).first_page()for customer in page.data: print(customer.full_name)Requires the .NET 8 SDK or newer.
dotnet new console -o DaapiQuickstartcd DaapiQuickstartdotnet add package DesktopAccountingAPI.QuickBooksDesktop --version 0.12.1Replace Program.cs with this and run dotnet run:
using DesktopAccountingApi.QuickBooksDesktop;using DesktopAccountingApi.QuickBooksDesktop.Models;
var qb = new DesktopAccountingApiClient().ForEndUser("eu_01j9..."); // reads DAAPI_SECRET_KEY
var page = await qb.Qbd.Customers.ListAsync(new CustomerListParams { Limit = 5 }).GetFirstPageAsync();foreach (var customer in page.Data) Console.WriteLine(customer.FullName);Requires Java 11 or newer and Maven. In a new directory, save this as pom.xml:
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>daapi-quickstart</artifactId> <version>1.0</version> <properties> <maven.compiler.release>11</maven.compiler.release> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>com.desktopaccountingapi</groupId> <artifactId>quickbooks-desktop</artifactId> <version>0.12.1</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>3.6.4</version> </plugin> </plugins> </build></project>import com.desktopaccountingapi.quickbooksdesktop.DesktopAccountingApiClient;import com.desktopaccountingapi.quickbooksdesktop.models.Customer;import com.desktopaccountingapi.quickbooksdesktop.models.CustomerListParams;
public class ListCustomers { public static void main(String[] args) throws Exception { DesktopAccountingApiClient qb = DesktopAccountingApiClient.fromEnv().forEndUser("eu_01j9..."); // reads DAAPI_SECRET_KEY
for (Customer customer : qb.qbd().customers().list(new CustomerListParams().limit(5)).firstPage().data()) { System.out.println(customer.fullName()); } }}Run it with mvn -q compile exec:java -Dexec.mainClass=ListCustomers.
curl "https://api.desktopaccountingapi.com/v1/quickbooks-desktop/customers?limit=5" \ -H "Authorization: Bearer $DAAPI_SECRET_KEY" \ -H "Daapi-End-User-Id: eu_01j9..."The sample company is simulated. Test with real QuickBooks Desktop before production: connect a company file.