# How to access the list of categories associated to an item

**URL:** <https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716>\
**Category:** Questions\
**Tags:** catalog-api, net\
**Created:** [February 22, 2024, 2:30am UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716 "2024-02-22T02:30:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chilenazo](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@chilenazo](https://developer.squareup.com/forums/u/chilenazo)\
**Post date:** [February 22, 2024, 2:30am UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/1 "2024-02-22T02:30:00Z")

</div>

Hello,

An item can be associated to more than one category. But how do I get the list of categories of an item? The .NET SDK only exposes a single CategoryId for an item. Is there a way to access the list of categories of an item?

Thank you

> **[Categorize Catalog Items](https://developer.squareup.com/docs/catalog-api/categorize-catalog-items#search-for-categories)**
>
> Learn how to use the Square Catalog API to categorize items in a Square seller's catalog.

 ![image](https://global.discourse-cdn.com/square/original/2X/5/596721b6795fa1affe5f3813e4e355c2c8a906f8.png)

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [February 22, 2024, 2:30am UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/2 "2024-02-22T02:30:14Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Call the SearchCatalogItems Endpoint](https://developer.squareup.com/docs/catalog-api/search-catalog-items)**
>
> Learn how to call the SearchCatalogItems endpoint to search for items or item variations using one or more supported query filters.

> **[Search for Items and Objects](https://developer.squareup.com/docs/catalog-api/search-catalog)**
>
> Learn how to search for objects, including items or items variations, programmatically using the SearchCatalogItems and SearchCatalogObjects endpoints.

> **Additional Documentation**
>
> [https://developer.squareup.com/docs/catalog-api/what-it-does](https://developer.squareup.com/docs/catalog-api/what-it-does)  
> [https://developer.squareup.com/docs/catalog-api/design-a-catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog)  
> [https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [February 22, 2024, 2:39am UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/3 "2024-02-22T02:39:01Z")

</div>

When you `SearchCatalogObjects` or `BathRetrieveCatalogObjects` you can set `include_related_objects` to `true` to include all the categories associated to catalog objects. 🙂

---

<div class="post-metadata">

**Author:** ![Dev777](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dev777](https://developer.squareup.com/forums/u/Dev777)\
**Post date:** [February 22, 2025, 7:48pm UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/4 "2025-02-22T19:48:41Z")

</div>

@Bryan-Square I have an example where only one category is returning in the related objects field but there are two IDs being returned for category in the objects field

When I go to map the ID to the related objects not all categories are being returned. This is for SearchCataLogObjects

---

<div class="post-metadata">

**Author:** ![Dev777](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dev777](https://developer.squareup.com/forums/u/Dev777)\
**Post date:** [February 22, 2025, 7:55pm UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/5 "2025-02-22T19:55:51Z")

</div>

> [@Bryan-Square](#):
>
> SearchCatalogObjects

I found the bug on Square’s side. The relatedObject is only returning categories if they appear on an item as a “reporting category” but not all categories mapped to an item. Looks like the graphql code on Square’s side needs to be updated to return relatedObjects from a merge of categories and reporting categories

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [February 24, 2025, 5:45pm UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/6 "2025-02-24T17:45:30Z")

</div>

At this time the reporting category is the related object that is returned when calling SearchCatalogObjects. This is the expected behavior. 🙂

---

<div class="post-metadata">

**Author:** ![Dev777](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dev777](https://developer.squareup.com/forums/u/Dev777)\
**Post date:** [February 24, 2025, 6:45pm UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/7 "2025-02-24T18:45:16Z")

</div>

How am I able to get all categories in an efficient call?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [February 24, 2025, 7:18pm UTC](https://developer.squareup.com/forums/t/how-to-access-the-list-of-categories-associated-to-an-item/12716/8 "2025-02-24T19:18:42Z")

</div>

What exactly are you trying to get with `SearchCatalogObjects`? 🙂
