All things Shopify and commerce
// Add product 9226170532176 to collection 615709376848
curl -X POST "xxxx" -H "Content-Type: application/json" -H "X-Shopify-Access-Token: <access token>" -d "{\"query\": \"mutation collectionAddProducts($id: ID!, $productIds: [ID!]!) { collectionAddProducts(id: $id, productIds: $productIds) { collection { id } userErrors { field message } } }\", \"variables\": { \"id\": \"gid://shopify/Collection/615709376848\", \"productIds\": [\"gid://shopify/Product/9226170532176\"] }}"
// Move Product 9226170532176 in Collection 615709376848 to New Position 22
curl -X POST "xxxxx" -H "Content-Type: application/json" -H "X-Shopify-Access-Token: <access token>" -d "{\"query\": \"mutation collectionReorderProducts($id: ID!, $moves: [MoveInput!]!) { collectionReorderProducts(id: $id, moves: $moves) { job { id } userErrors { field message } } }\", \"variables\": { \"id\": \"gid://shopify/Collection/615709376848\", \"moves\": [{\"id\": \"gid://shopify/Product/9226170532176\", \"newPosition\": \"22\"}] }}"
Somehow I cannot set a new position for my products using GraphQL. The Collection is set to manual order. Thanks for the help!
Hi! the collection is set to manual sorting. When I using the REST API it works, but when using the GraphQL API it does not.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025