Get Category name by id

Is there currently a way to get an Items Category name by the category ID? I can pull all my sales, but trying to add the category name to my API calls

Hi @keith.schmitt, it sounds like you’re pulling sales information from orders and are referencing the category id on the order line item’s catalog item.

To retrieve the category name, you can use the retrieve catalog object endpoint and use the category id in your call. This should get you the name you need. If you need more than one, you can use the batch retrieve catalog object endpoint.

1 Like

Thank you very much.

I do not see category id in the orders API, I did check within line_items as well and it’s not there. How do I get the category for every line item from Orders API.

If the category_id isn’t in an order then the item that’s in the order is uncategorized. If it is categorized do you have an example order_id that we can look into? :slightly_smiling_face:

Alright, What I noticed is, there is catalog object id in line items and I have to use that to get the category id using catalog API. Once I get the category ID, I can use catalog API again to get the category name and other attributes. Seems like there is no direct way to get it but this is what I found so far.

That’s correct. The Catalog API is where you’ll want to get all the information about the objects in the order and their related objects. :slightly_smiling_face: