# Retrieve category from order item

**URL:** <https://developer.squareup.com/forums/t/retrieve-category-from-order-item/6136>\
**Category:** Questions\
**Tags:** orders-api, payments-api, catalog-api\
**Created:** [June 6, 2022, 2:15pm UTC](https://developer.squareup.com/forums/t/retrieve-category-from-order-item/6136 "2022-06-06T14:15:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![katiepatch](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/katiepatch/32/1181_2.png) [@katiepatch](https://developer.squareup.com/forums/u/katiepatch)\
**Post date:** [June 6, 2022, 2:15pm UTC](https://developer.squareup.com/forums/t/retrieve-category-from-order-item/6136/1 "2022-06-06T14:15:35Z")

</div>

Hello! I’m stuck on part of the v1 to v2 migration for the payments api that involves getting an order line item’s category name. Previously it was available from the payments api here: `itemizations.item_detail.category_name`. The migration guide says:

> You can use the `OrderLineItem.catalog\_object\_id to retrieve the catalog information.

So I am using the order api to retrieve the order and the catalog api to retrieve the catalog item. However when I use the catalog\_object\_id to retrieve the catalog object from the catalog api, I get an item variation in return, not a category. Am I mixing something up here? Any guidance would be much appreciated. Thank you!

 ![Screen Shot 2022-06-06 at 9.01.17 AM](https://global.discourse-cdn.com/square/original/2X/0/0b7f6397b7e5008c69ad86ea6a76db6ff47ee46a.png)

---

<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:** [June 6, 2022, 7:23pm UTC](https://developer.squareup.com/forums/t/retrieve-category-from-order-item/6136/2 "2022-06-06T19:23:14Z")

</div>

👋 With the Catalog API you can set `include_related_object` to `true` to get the category the items associated with. 🙂

---

<div class="post-metadata">

**Author:** ![katiepatch](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/katiepatch/32/1181_2.png) [@katiepatch](https://developer.squareup.com/forums/u/katiepatch)\
**Post date:** [June 6, 2022, 7:41pm UTC](https://developer.squareup.com/forums/t/retrieve-category-from-order-item/6136/3 "2022-06-06T19:41:43Z")

</div>

Ah, that returns a category id. So to be clear, in order to to get the category name from an order I need to make two separate api calls

- retrieve the item variation from the catalog api with the catalog\_object\_id
- retrieve the category from the catalog api with the category\_id

Am I missing a simpler way of doing this or is this accurate?

---

<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:** [June 6, 2022, 9:25pm UTC](https://developer.squareup.com/forums/t/retrieve-category-from-order-item/6136/4 "2022-06-06T21:25:21Z")

</div>

You got it! That’s it! 🙂
