Nxus.Qbd 0.8.1

dotnet add package Nxus.Qbd --version 0.8.1
                    
NuGet\Install-Package Nxus.Qbd -Version 0.8.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nxus.Qbd" Version="0.8.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nxus.Qbd" Version="0.8.1" />
                    
Directory.Packages.props
<PackageReference Include="Nxus.Qbd" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nxus.Qbd --version 0.8.1
                    
#r "nuget: Nxus.Qbd, 0.8.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nxus.Qbd@0.8.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nxus.Qbd&version=0.8.1
                    
Install as a Cake Addin
#tool nuget:?package=Nxus.Qbd&version=0.8.1
                    
Install as a Cake Tool

Nxus.Qbd

Official .NET SDK for the Nxus QuickBooks Desktop API.

Installation

dotnet add package Nxus.Qbd

Quick Start

using Nxus.Qbd;

using var client = new NxusClient(new NxusClientOptions {
    ApiKey = "sk_live_...",
    ConnectionId = "your-connection-id",
});

// List vendors
var page = await client.Vendors.ListAsync(limit: 50);
foreach (var vendor in page.Data) {
    Console.WriteLine(vendor.GetProperty("name").GetString());
}

// Retrieve a single customer
var customer = await client.Customers.RetrieveAsync("80000001-1234567890");

// Create an invoice
var invoice = await client.Invoices.CreateAsync(new {
    customerRefListId = "80000001-1234567890",
});

Sync And Async APIs

The SDK supports both sync and async usage:

// Sync
var vendors = client.Vendors.List(limit: 10);
foreach (var vendor in vendors.Data) {
    Console.WriteLine(vendor.GetProperty("name").GetString());
}

// Async
var asyncPage = await client.Vendors.ListAsync(limit: 10);
await foreach (var vendor in asyncPage) {
    Console.WriteLine(vendor.GetProperty("name").GetString());
}

Environments

The SDK defaults to https://api.nx-us.net/.

For local development, use Environment = NxusEnvironment.Development. An explicit BaseUrl override still wins when you need a custom endpoint:

using var client = new NxusClient(new NxusClientOptions {
    ApiKey = "sk_test_...",
    Environment = NxusEnvironment.Development,
    ConnectionId = "your-connection-id",
});

Timeouts

The SDK defaults to a 30s client timeout. You can override this globally or per request:

using var client = new NxusClient(new NxusClientOptions {
    ApiKey = "sk_live_...",
    ConnectionId = "your-connection-id",
    Timeout = TimeSpan.FromSeconds(60),
});

var page = await client.Transactions.ListAsync(
    limit: 100,
    options: new RequestOptions {
        Timeout = TimeSpan.FromSeconds(45),
    });

List and report calls can also send a backend timeout hint without changing the local HTTP timeout:

var page = await client.Customers.ListAsync(
    limit: 100,
    options: new RequestOptions {
        ServerTimeoutSeconds = 45,
    });

When ServerTimeoutSeconds is provided, the SDK sends it as the X-Nxus-Timeout-Seconds request header and preserves it across pagination calls.

Connection Scoping

Every request requires a QuickBooks Desktop connection context. The easiest path is to set it once on the client:

using var client = new NxusClient(new NxusClientOptions {
    ApiKey = "sk_live_...",
    ConnectionId = "your-connection-id",
});

You can also set it per request:

var vendor = await client.Vendors.RetrieveAsync(
    "80000001-1234567890",
    new RequestOptions {
        ConnectionId = "your-connection-id",
    });

Pagination

All list methods return a CursorPage<T> that supports both manual navigation and auto-pagination:

// Auto-paginate through all records
var firstPage = await client.Customers.ListAsync(limit: 100);
await foreach (var customer in firstPage) {
    Console.WriteLine(customer.GetProperty("name").GetString());
}

// Manual page-by-page navigation
var page = await client.Customers.ListAsync(limit: 50);
while (page.HasNextPage()) {
    page = await page.GetNextPageAsync();
}

If you stop early with break, the SDK best-effort closes the backend cursor automatically so the QuickBooks Desktop lane is released quickly:

var page = await client.Customers.ListAsync(limit: 100);
await foreach (var customer in page) {
    if (customer.GetProperty("name").GetString() == "Acme") {
        break;
    }
}

If you are testing pagination manually by sending cursors yourself, note that the cursor session stays open for only about 10 seconds between pages. If you do not request the next page within that window, the session is closed and you must restart the query from the beginning.

Examples

Runnable examples live in examples/Nxus.Qbd.Examples/:

Example Description
BasicCrud.cs Create, retrieve, update, list, and delete a vendor
AutoPagination.cs Async auto-pagination, find-and-stop, and manual page navigation

The example runner auto-loads a .env file from the repo root. Copy .env.example to .env and fill in your values:

copy .env.example .env
NXUS_API_KEY=sk_test_your_key_here
NXUS_CONNECTION_ID=your_connection_id_here
NXUS_ENVIRONMENT=development

Run an example:

dotnet run --project examples/Nxus.Qbd.Examples -- crud
dotnet run --project examples/Nxus.Qbd.Examples -- pagination

Error Handling

Non-success responses throw NxusApiException:

using Nxus.Qbd.Errors;

try {
    await client.Vendors.RetrieveAsync("non-existent-id");
} catch (NxusApiException ex) {
    Console.WriteLine(ex.Status);
    Console.WriteLine(ex.UserMessage);
    Console.WriteLine(ex.Code);
    Console.WriteLine(ex.RequestId);
}

Resources

All QuickBooks Desktop resources are available as namespaced properties on NxusClient:

Category Resources
Transactions Invoices, Bills, Checks, Deposits, Estimates, CreditMemos, PurchaseOrders, SalesReceipts, JournalEntries, ReceivePayments, VendorCredits, CreditCardCharges, CreditCardBills, CreditCardCredits, Charges, BuildAssemblies, ArRefundCreditCards, SalesTaxPaymentChecks, ItemReceipts, CheckBills, TimeTrackings, Transactions
Lists Accounts, Customers, Vendors, Employees, OtherNames, Currencies, Terms, DateDrivenTerms, PaymentMethods, ShipMethods, SalesTaxCodes, PriceLevels, Classes, CustomerTypes, VendorTypes, BillingRates, InventorySites, BarCodes, AccountTaxLineInfos, BillsToPay, UnitOfMeasureSets, Leads
Items Items, InventoryItems, ItemDiscounts, ItemFixedAssets, ItemGroups, ItemInventoryAssemblies, ItemNonInventory, ItemOtherCharges, ItemPayments, ItemSalesTax, ItemSalesTaxGroups, ServiceItems, ItemSubtotals
Payroll PayrollItemNonWages, PayrollItemWages, WorkersCompCodes
Reports Reports
Core AuthSessions, Connections, SpecialItems

Custom fields and data extensions

QuickBooks Desktop uses the same underlying mechanism for both UI-visible custom fields and application-only integration data:

QuickBooks concept SDK/API name Purpose
Data extension definition DataExtDef / custom field definition Describes a field's owner, name, data type, and supported object types.
Data extension value DataExt / custom field value Stores the field's value on one specific QuickBooks list object, transaction, or transaction line.

A definition must exist before a value can be written. Definitions are identified by ownerId + name; values add the specific QuickBooks target to that composite identity. QuickBooks may omit DataExtID for private definitions, so SDK consumers must allow DataExtDef.id to be null.

The ownerId determines how a definition is used:

  • Public custom field: use "0". The field is visible in the QuickBooks UI, its type must be STR255TYPE, and assignToObjects must contain at least one of Customer, Employee, Item, or Vendor. Public definitions cannot be deleted through the SDK.
  • Private data extension: use an application-owned GUID such as "{C3AA84E0-D242-47AB-A12B-3EDA3A2590A2}". The field is available only to applications that know that GUID. assignToObjects is optional; when supplied, it may contain any object type supported by QuickBooks for DataExtDefAdd. The GUID does not require separate registration with QuickBooks.

The assignToObjects property is therefore optional in the SDK request type, but conditionally required by QuickBooks for public definitions. QuickBooks accepts a private definition with the property omitted and returns that definition with an empty assignToObjects list. Supply the intended object assignments before relying on DataExt value writes for those object types.

The normal workflow is:

  1. Create the DataExtDef.
  2. Create a DataExt value using the same ownerId and field name, plus a target such as a Customer ListID, an Invoice TxnID, or a transaction-line TxnLineID.
  3. Update or delete the value using that same composite identity.
  4. Delete a private definition only after its values are no longer needed. Public definitions must be managed in the QuickBooks UI because QuickBooks does not support deleting them through DataExtDefDel.

Public fields are typically used for information users should see or edit in QuickBooks. Private extensions are commonly used for external-system identifiers, synchronization or verification markers, workflow state, migration metadata, and other integration data that should not appear in the QuickBooks UI.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.1 121 8/2/2026
0.7.1 113 7/30/2026
0.7.0 108 7/28/2026
0.6.2 118 5/27/2026
0.6.0 120 5/25/2026
0.5.1 109 5/18/2026
0.5.0 123 5/16/2026
0.3.2 118 5/8/2026
0.3.1 112 5/7/2026
0.3.0 104 5/4/2026
0.2.2 106 5/2/2026
0.2.1 100 5/2/2026
0.2.0 113 4/29/2026