Quickbooky

Accounting News

SDK & Integration

Deleting Employee and List Items Through the QuickBooks SDK

QuickBooks SDK users who need to remove list objects like employees or customers can use the ListDel request rather than simply marking items inactive.

Deleting Employee and List Items Through the QuickBooks SDK

When a developer builds an integration that creates QuickBooks list objects programmatically, cleanup can become a problem. One developer using QuickBooks SDK 12.0 described a workflow where a new employee record is created first, followed by a sales representative entry tied to that employee. If the sales rep creation fails — for instance, because the rep initials duplicate an existing entry — the now-orphaned employee record needs to come back out. The developer found no obvious deletion path and wondered whether marking the record inactive was the only option.

The Symptom

The scenario is straightforward. An external application creates an employee through the SDK and then attempts to create a corresponding sales rep using that employee’s internal identifier. The sales rep add fails because QuickBooks requires unique sales rep initials, and a conflict exists. At that point the employee record is already committed in the company file. The developer needed a way to reverse that creation — to fully delete the employee — but the SDK’s object model does not surface a list-item delete operation as prominently as it does for transactions.

The same question applies broadly. Users integrating with QuickBooks through the SDK may want to remove customers, vendors, items, accounts, or any other list object, and the path to do so is not immediately obvious from the typical add/query/modify request set.

Why Inactive Is Not the Same as Deleted

Marking a list object as inactive by setting its active status to false is a valid QuickBooks operation, and it is the approach many users default to when a delete is not readily available. Inactive records disappear from most lists within the QuickBooks interface, which can make the problem appear solved. But the data remains in the company file. Over time, inactive records accumulate, inflate the file size, and can still surface in certain reports or SDK queries. They also count toward list-entry limits — a concern for larger company files approaching the ceiling on customers, vendors, or other named list elements.

For a workflow that creates and then discards records in a trial-and-error cycle, relying on inactive flags can leave behind dozens or hundreds of ghost entries. A true deletion is the cleaner approach when the record was created in error or is no longer needed.

The Accepted Solution: ListDel

The QuickBooks SDK provides a dedicated request type for exactly this purpose. The list deletion request — known in the SDK’s request vocabulary as ListDel — accepts two required pieces of information: the type of list object being deleted and that object’s unique identifier.

The list type tells QuickBooks which table the record lives in. Supported types span the full range of QuickBooks list objects: accounts, customers, vendors, employees, items of every variety (inventory, non-inventory, service, discount, payment, and others), sales reps, classes, payment methods, shipping methods, price levels, payroll items, tax codes, and more.

The object identifier is the same internal ID that QuickBooks assigns when the record is first created. Any application that created the record through the SDK already has this identifier from the add response. Applications that need to delete a record they did not create can obtain the identifier through a standard list query first.

Practical Considerations

A few constraints govern what the list deletion request can and cannot do. QuickBooks will not allow a list object to be deleted if it is referenced by existing transactions. An employee with payroll records, a customer with invoices, or an item on a sales order cannot be removed until those references are cleared. In those situations, marking the record inactive remains the practical fallback.

The deletion is also permanent. Unlike marking a record inactive — which can be reversed by toggling the active flag back — a deleted list object is gone from the company file entirely. Applications that delete programmatically should do so deliberately, ideally with logging so that removed records can be recreated if needed.

For the developer’s original scenario, the workflow is simple. When the sales rep creation fails, issue a list deletion request for the employee using the employee type and the identifier returned from the earlier employee add. The orphaned record is removed cleanly, and no inactive residue is left behind.

SDK Version Notes

The list deletion request has been available across many versions of the QuickBooks SDK and continues to work in version 12.0, which the original developer was using. Developers working with older company files or earlier SDK versions should find the same request type available, though the full set of supported list types may vary slightly depending on the QuickBooks edition and version involved.

For developers and integrators managing QuickBooks Desktop files that have grown large or complex through programmatic creation and deletion cycles, condensing an oversized company file can reclaim space and improve performance.

← Back to Community Issues