Update prices in bulk via graphql?

I use productVariantUpdate to update variants price and compare-at price.

It works well but it is not efficient as it only allows one update per call.

https://shopify.dev/api/admin-graphql/2022-01/mutations/productVariantUpdate#examples-Update_a_product_variant_s_price_and_compare_at_price

mutation productVariantUpdate($input: ProductVariantInput!) {
  productVariantUpdate(input: $input) {
    productVariant {
      id
      title
      inventoryPolicy
      inventoryQuantity
      price
      compareAtPrice
    }
    userErrors {
      field
      message
    }
  }
}
{
  "input": {
    "id": "gid://shopify/ProductVariant/43729076",
    "price": 9.99,
    "compareAtPrice": 14.99
  }
}

For example I use inventoryBulkAdjustQuantityAtLocation to update my stock and it is amazing.
I update 50 in one go and enjoy extremly fast updates with fewer API calls.

mutation BulkInventory($invItemAdjustments: [InventoryAdjustItemInput!]!, $locationId: ID!) {
  inventoryBulkAdjustQuantityAtLocation(inventoryItemAdjustments: $invItemAdjustments, locationId: $locationId) {
    inventoryLevels {
      id
      available
      item {
        id
        sku
      }
      location {
        id
        name
      }
    }
    userErrors {
      field
      message
    }
  }
}
{
"invItemAdjustments":[
{
"inventoryItemId":"gid://shopify/InventoryItem/43028674117838",
"availableDelta":16
},
{
"inventoryItemId":"gid://shopify/InventoryItem/43028674150606",
"availableDelta":3
},
{
"inventoryItemId":"gid://shopify/InventoryItem/43028674183374",
"availableDelta":2
},
{
"inventoryItemId":"gid://shopify/InventoryItem/43028676018382",
"availableDelta":10
}
],
"locationId":"gid://shopify/Location/62241177806"
}

Any way to adapt this?

1 Like

Hi,

You can use ProductVariants Bulk Update

https://shopify.dev/api/admin-graphql/2022-10/mutations/productvariantsbulkupdate

This isn’t really a bulk update though in that you can only ‘bulk’ update the variants of a single product in a single call.

Oddly, if you’re using Markets, you can use the priceListFixedPricesAdd mutation to change up to 250 prices in one go, for 10 points but only on price lists, not the primary currency.

1 Like

Thanks for chiming in.

I am not aware about Markets - what is it? You mean Shopify Plus?

Yes, sorry, you can create currency pricelists for different countries (markets).

Ok, thanks.

Is it feasible to use it? Eg. possible to get rid of the primary currency by defining all markets?

I’m afraid it doesn’t look like it