---
title: "productVariantsBulkUpdate"
description: "Bulk update product variants."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/mutations/product-variants-bulk-update'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/mutations/product-variants-bulk-update.md'
---
# productVariantsBulkUpdate

Bulk update product variants. 

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Type Signature

`ProductVariantsBulkUpdatePayload`

## Arguments

* `variants`

  [[ProductVariantsBulkInput!]!](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/product-variants-bulk-input.md)

  A list of variants to be updated.

* `productId`

  [ID!](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/id.md)

  The product's ID linked to the variant being updated this time.

## Returns

* `product`

  [Product](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/product.md)

  The revised product object.

* `productVariants`

  [[ProductVariant!]](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/product-variant.md)

  The variants that have been updated.

* `userErrors`

  [[UserError]!](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/objects/user-error.md)

  List of errors returned during mutation execution.

## Code Example

```graphql
mutation productVariantsBulkUpdate($variants: [ProductVariantsBulkInput!]! $productId: ID! ) {
	productVariantsBulkUpdate(variants: $variants, productId: $productId ) 
		 {
			# ProductVariantsBulkUpdatePayload fields
		}
		
	}

```

## Variables

```json
{
  "productId": {},
  "variants": {
    "barcode": "",
    "compareAtPrice": {},
    "harmonizedSystemCode": {},
    "id": {},
    "inventoryItem": {
      "cost": {},
      "tracked": false
    },
    "inventoryPolicy": {},
    "inventoryQuantities": {
      "availableQuantity": {},
      "locationId": ""
    },
    "mediaId": "",
    "mediaSrc": "",
    "options": "",
    "price": "{}",
    "requiresShipping": {},
    "sku": "",
    "taxable": false,
    "weight": {},
    "weightUnit": {}
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

