Item hierarchies using categories

Use categories to create a hierarchical organization of the things a company sells. Categories allow products tp be placed in intuitive groups, making it easy to keep the company’s list of products and services organized and allowing you to easily find items to add to transactions. For example, it is intuitive to look for Men’s Jeans under Apparel->Jeans.

Items and categories

With QuickBooks Online you can create hierarchical categories and subcategories for your inventory items.

The Item resource is used to manage both the things you sell and their category hierarchy. Use the Item resource type of Category to define category levels in the hierarchy.

To create an inventory item in a new category, you need to make two API calls - one to create the category and one to create the item under that category. Use the minorversion=4 query parameter with Item resource URIs to access categories. If you access Category type items with minor versions earlier than 4, they are returned with Item.Type set to Service. They are not sellable and you receive an error if you include them in a transaction.

For detailed information about Category objects and supported CRUD methods, see Item in the API Reference.

Creating categories

To create a category, use the following endpoint, with the request body for either a top-level category or a subcategory as required.

POST https://quickbooks.api.intuit.com/v3/company/9341452321439603/item?minorversion=70

Use the following equest body to create a top-level category:

1
2
3
4
{
   "Name": "CategoryOne",
   "Type": "Category"
}

Use the following equest body to create a subcategory. In this exmaple, 101 is the ID of the parent category:

1
2
3
4
5
6
7
8
{
   "Name": "CategoryTwo",
   "Type": "Category",
   "SubItem": true,
   "ParentRef": {
       "value": "101"
   }
}
Creating inventory items

You can create an inventory item without a category or add it to an existing category or subcategory.

To create an item without a category, use the following endpoint and request body:

POST https://quickbooks.api.intuit.com/v3/company/9341452321439603/item?minorversion=70

1
2
3
4
5
6
7
8
{
 "Name": "ItemTwo",
 "IncomeAccountRef": {
   "name": "Sales of Product Income",
   "value": "5"
 },
 "Type": "Service"
}

To create an item within a category, include the category information in the body. The following example creates an item that belongs to a category where “101” is the ID of the Category:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
 "Name": "ItemFour",
 "IncomeAccountRef": {
   "name": "Sales of Product Income",
   "value": "5"
 },
 "Type": "Service",
 "SubItem":true,
 "ParentRef" : {
   "value": "101"
 }
}

Creating an item within a subcategory

To create an item that belongs to a subcategory