Inventory items
In QuickBooks Desktop, an inventory item is any merchandise or part that a business purchases, tracks as inventory, and then resells. In QuickBooks, information about an inventory item is grouped into three categories:
- Purchase Information:
PurchaseDesc
,PurchaseCost
,COGSAccountRef
, andPrefVendorRef
. - Sales Information:
SalesDesc
,SalesPrice
, andSalesTaxCodeRef
. - Inventory Information:
AssetAccountRef
,ReorderPoint
,QuantityOnHand
,TotalValue
, andInventoryDate
.
To see all of the request parameters and response fields for , check out our client library’s amazing autocomplete.
In addition to the inventory item operations documented herein, Conductor can fetch, create, and update every other inventory-related QuickBooks Desktop data type:
- Inventory assembly items
- Inventory transfers
- Inventory adjustments
- Inventory sites
We will document these data types in the future. In the meantime, contact us if you need help with them.
Fetching inventory items
It is quite simple to fetch inventory items. There are many optional request parameters you can use to filter the results.
const inventoryItems =
await conductor.qbd.itemInventory.query("{{END_USER_ID}}");
const inventoryItems = await conductor.qbd.itemInventory.query(
"{{END_USER_ID}}",
{
NameFilter: {
MatchCriterion: "StartsWith",
Name: "Test Inventory Items",
},
},
);
Creating inventory items
Creating vendors is also quite simple. There are many optional request parameters available, but the only required one is Name
.
const END_USER_ID = "{{END_USER_ID}}";
// Use unique names for mock objects because QBD requires each to be unique.
const UNIQUE_SUFFIX = Math.random().toFixed(6);
// An inventory item requires an income account, asset account, and a COGS
// account. These will usually already exist for an end-user, but we create
// mock accounts below for this example:
const incomeAccount = await client.qbd.account.add(END_USER_ID, {
Name: `Test Income Account ${UNIQUE_SUFFIX}`,
AccountType: "Income",
});
const assetAccount = await client.qbd.account.add(END_USER_ID, {
Name: `Test Asset Account ${UNIQUE_SUFFIX}`,
AccountType: "FixedAsset",
});
const cogsAccount = await client.qbd.account.add(END_USER_ID, {
Name: `Test COGS Account ${UNIQUE_SUFFIX}`,
AccountType: "CostOfGoodsSold",
});
const inventoryItem = await client.qbd.itemInventory.add(END_USER_ID, {
Name: `Test Inventory Item ${UNIQUE_SUFFIX}`,
IncomeAccountRef: {
ListID: incomeAccount.ListID,
},
AssetAccountRef: {
ListID: assetAccount.ListID,
},
COGSAccountRef: {
ListID: cogsAccount.ListID,
},
PurchaseCost: "50.00",
SalesPrice: "100.00",
});