---
title: "ProductVariantInput"
description: "The product variant-related input fields."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/product-variant-input'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/product-variant-input.md'
---
# ProductVariantInput

The product variant-related input fields.

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

## Input Fields

* `inventoryItem`

  [InventoryItemInput](https://developer.shopline.com/docs/admin-graph-ql-api/inventory/inputs/inventory-item-input.md)

  Input information for inventory items corresponding to the product variant.

* `taxable`

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

  Indicates whether the variant is subject to tax.
  
  - `true`: Tax is required.
  - `false`: Tax is not required.
  
  Default value: `true`

* `inventoryPolicy`

  [ProductVariantInventoryPolicy](https://developer.shopline.com/docs/admin-graph-ql-api/inventory/enums/product-variant-inventory-policy.md)

  Indicates whether the variant is allowed to be oversold.

* `weight`

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

  The weight of the variant. The value must be greater than `0`，and rounded up to two decimal places. 

* `mediaId`

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

  The unique ID of the media associated with the product variant. This field is used to link or create media during a mutation. If the media ID is not associated with the product, the system will automatically synchronize the media to the product's media library. <br/>
  Maximum length: 64 

* `inventoryQuantities`

  [[InventoryLevelInput!]](https://developer.shopline.com/docs/admin-graph-ql-api/inventory/inputs/inventory-level-input.md)

  The total inventory quantity of the product variant across all storage locations. This field is only supported as an input parameter for the `productVariantCreate` mutation.

* `mediaSrc`

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

  The URL of the media resource for the product variant.

* `harmonizedSystemCode`

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

  The variant's Harmonized System (HS) code or tariff code.

* `requiresShipping`

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

  Indicates whether the variant requires shipping.
  
  - `true`: Shipping is required.
  - `false`: Shipping is not required.
  
  Default value: `true`

* `price`

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

  The selling price of the variant. The value is rounded to two decimal places.<br/>Default value: `0`

* `options`

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

  Product variant options.

* `id`

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

  The unique ID of the product variant. It is used to specify the product variant to be updated. If the specified product variant does not exist, the system will create a new one.<br/>
  Maximum length: 64

* `sku`

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

  The product SKU. <br/>
  Maximum length: 255

* `barcode`

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

  The barcode of the variant.<br/>
  Maximum length: 255

* `weightUnit`

  [WeightUnit](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/enums/weight-unit.md)

  The unit of weight for the variant. 

* `compareAtPrice`

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

  The original price of the variant. The value is rounded to two decimal places.<br/>Default value: `0`

## Input field from

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

