---
title: "ProductVariant"
description: "Represents a type of product variant."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/product-variant'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/product-variant.md'
---
# ProductVariant

Represents a type of product variant.

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

## Type Signature

`ProductVariant`

## Fields

* `availableForSale`

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

  The availability of the variant for sale.

* `barcode`

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

  The barcode value linked to the product.

* `compareAtPrice`

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

  The variant's original price, using the store's default currency.

* `createdAt`

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

  Creation date and time of the variant.

* `defaultCursor`

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

  Returns the default cursor for the next variant, sorted in ascending order by variant ID.

* `displayName`

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

  The variant's display name, derived from the product title and variant title.

* `id`

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

  The ID of product variant, a universally unique identifier.

* `image`

  [Image](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/objects/image.md)

  The image of the variant.

* `inventoryItem`

  [InventoryItem!](https://developer.shopline.com/docs/admin-graph-ql-api/inventory/objects/inventory-item.md)

  A product inventory item used for querying stock information.

* `inventoryPolicy`

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

  Whether the product variant can be ordered when inventory is depleted.

* `inventoryQuantity`

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

  The total available quantity for sale of the product variant.

* `price`

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

  The product variant's price, using the store's default currency.

* `product`

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

  The product to which this product variant belongs.

* `productId`

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

  The product ID that the variant belongs to.

* `selectedOptions`

  [[SelectedOption!]](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/objects/selected-option.md)

  A list of options configured for the variant.

* `sku`

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

  The SKU of the product variant, a case-sensitive string.

* `taxable`

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

  Whether the variant is taxed when sold.

* `title`

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

  The product variant's title

* `updatedAt`

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

  The last modified date and time of the product variant.

* `weight`

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

  The product variant's weight in the unit defined by weight_unit.

* `weightUnit`

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

  The measurement unit for the weight of the variant. If weight_unit is not specified, the store's default measurement unit will be applied.

## Schema Definition

```graphql
type ProductVariant { 
	availableForSale: Boolean!
	barcode: String
	compareAtPrice: Money
	createdAt: Date!
	defaultCursor: String!
	displayName: String!
	id: ID!
	image: Image
	inventoryItem: InventoryItem!
	inventoryPolicy: ProductVariantInventoryPolicy
	inventoryQuantity: Int
	price: Money
	product: Product
	productId: ID!
	selectedOptions: [SelectedOption!]
	sku: String
	taxable: Boolean!
	title: String!
	updatedAt: Date!
	weight: Float
	weightUnit: WeightUnit 
}
```

## Field from

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

  Node of the ProductVariant.

* [ProductVariantsBulkCreatePayload](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/product-variants-bulk-create-payload.md).productVariants

  Newly created variant.

* [ProductVariantsBulkUpdatePayload](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/product-variants-bulk-update-payload.md).productVariants

  The variants that have been updated.

* [Query](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/queries/product-variant.md).productVariant

  按 ID 返回 ProductVariant 资源。

## 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).

