API for Product category suggestions

Solved
sho_engine
Shopify Partner
1 0 0

I'd like to ask about category suggestions when you're adding a category to a product. I like this feature so much and it'd be great to add it to my application. Do you have an API endpoint for category suggestions?

 

sho_engine_0-1675786983335.png

 

Accepted Solution (1)
ShopifyDevSup
Shopify Staff
Shopify Staff
1202 190 419

This is an accepted solution.

Hey @sho_engine - product categories are built into the product object/resource, and can be updated that way. There's no specific endpoint for the category suggestions that works similarly to how it functions in the merchant admin at the moment. We do offer a product category taxonomy here in CSV form though. The taxonomy ID numbers in that CSV correspond to the Product Taxonomy Node object in GraphQL.

 

So, it is possible to build a feature where you could pull from those category numbers and then pass it through to a product. This is done using either a ProductCreate/ProductUpdate mutation in GraphQL. This would allow your app to potentially offer product category suggestions when a merchant is creating/updating a product through your app. 

We wouldn't be able to help with code-level advice (or how to implement a front-end to show the categories to the merchant), but it looks like a feature like this is possible to implement with our GraphQL API. Hope this helps - let us know if we can clarify anything on our end!

 

Al | Shopify Developer Support 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Reply 1 (1)
ShopifyDevSup
Shopify Staff
Shopify Staff
1202 190 419

This is an accepted solution.

Hey @sho_engine - product categories are built into the product object/resource, and can be updated that way. There's no specific endpoint for the category suggestions that works similarly to how it functions in the merchant admin at the moment. We do offer a product category taxonomy here in CSV form though. The taxonomy ID numbers in that CSV correspond to the Product Taxonomy Node object in GraphQL.

 

So, it is possible to build a feature where you could pull from those category numbers and then pass it through to a product. This is done using either a ProductCreate/ProductUpdate mutation in GraphQL. This would allow your app to potentially offer product category suggestions when a merchant is creating/updating a product through your app. 

We wouldn't be able to help with code-level advice (or how to implement a front-end to show the categories to the merchant), but it looks like a feature like this is possible to implement with our GraphQL API. Hope this helps - let us know if we can clarify anything on our end!

 

Al | Shopify Developer Support 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog