Development discussions around Shopify APIs
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
Is there any way to update products in bulk
Like I want to update the status of products in bulk and update price of each product at once
You would need to make several callouts depending on how many products you are looking to update.
To use the api, see the documentation below:
https://shopify.dev/api/admin-rest/2022-10/resources/product#put-products-product-id
You would need the product ids to edit products
Hi @fahadali 👋
With GraphQL, you can use bulk operations that are designed to handle large volumes of data asychronously. To update the product status and variant prices, you can use the `bulkOperationRunMutation` with the `productUpdate` mutation and upload a JSONL file containing the input variables to a staged target.
mutation {
bulkOperationRunMutation(
mutation: "
mutation productUpdate($input: ProductInput!) {
productUpdate(input: $input) {
product {
id
status
variants (first:10){
nodes {
id
price
}
}
}
}
}",
stagedUploadPath: "...") {
bulkOperation {
id
url
status
}
}
}
Each input line would be formatted similar to the below:
{
"input": {
"id": "gid://shopify/Product/987654321",
"status":"DRAFT",
"variants": [
{
"id": "gid://shopify/ProductVariant/123",
"price": 111
},
{
"id": "gid://shopify/ProductVariant/456",
"price": 222
}
]
}
}
Hope that helps!
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
User | RANK |
---|---|
5 | |
5 | |
4 | |
4 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022