Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
How do I update the navigation menus using the API? The bot thing gives me a nice answer as below, but neither the endpoint or document page exists.
Gone round and round trying to get a simple answer and Shopfiy have lost interest and directed me here.
Thanks. It's not JavaScript, but I was forced to add a tag.
To add a menu item via Shopify API, you'll need to use the POST /admin/api/2022-01/menus/{menu_id}/menu_items.json endpoint.
Here's a basic example:
{ "menu_item": { "link_type": "Collection", "title": "Your Collection Name", "subject_id": "Collection ID" } }
Replace "Your Collection Name" with the name of your collection and "Collection ID" with the ID of your collection.
For more details, check out the [Shopify API documentation](https://shopify.dev/api/admin-rest/2022-01/resources/menu-item#post
Hey @Leafie2000,
As far as I'm aware Shopify still does not offer a public-facing API or endpoint to manage an Online Store's navigation menus. It sounds like the AI chat bot on their help center got a bit confused. If there is a Navigation API we'd certainly love to use it within our Meteor Mega Menus app!
Regardless, it wouldn't hurt to provide some details about your use case for a Navigation API in this thread. If enough people request it and provide specific examples of why it would be beneficial then Shopify's product team may be convinced to prioritize it for a future release 😉
Thanks for your answer. I can only think the AI has info on a upcoming or abandoned feature, but at least I've not gone mad.
I have quite deep product "categories" which I'd like to use as a drill down on a few sites. e.g. locating printer inks, car parts etc. As Shopify doesn't have hierarchical categories I've created customs collections containing the category nodes populated with the relevant products which is maintained via the API and I want to attach the nodes (collections) to a menu structure. The structure and content changes often and is held outside of Shopify.
FYI they added APIs to create update and delete nav menus in the 2024-07 API release:
https://shopify.dev/docs/api/release-notes/2024-07
https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/menuCreate
Thanks! I'll take a look.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024