Skip to main content

ProductVariant

Represents a version of a product such as different size or color.

type ProductVariant implements Node, ObjectWithMetadata {
id: ID!
createdAt: DateTime!
updatedAt: DateTime!
externalId: String
externalSource: String
seoTitle: String
seoDescription: String
sku: String
name: String!
nauticalStockNumber: String!
status: ProductVariantStatus!
currency: String
product: Product!
trackInventory: Boolean!
weight: Weight
seller: Seller
publishedAt: DateTime
isPublished: Boolean!
overrideCurrency: Boolean!
allowBackorders: Boolean
isPriceOverrideAllowed: Boolean!
isShippingRequired: Boolean!
isDigital: Boolean!
privateMetadata: [MetadataItem!]!
metadata: [MetadataItem!]!
price: Money
pricing: VariantPricingInfo
attributes: [SelectedAttribute!]!
customFields: [SelectedAttribute!]!
costPrice: Money
margin: Int
quantityOrdered: Int
images: [ProductImage!]
availableImages: [ProductImage!]
digitalContent: DigitalContent
stocks(
countryCode: CountryCode
): [Stock!]
quantityAvailable(
countryCode: CountryCode
): Int!
netRevenue: Float
grossRevenue: Float
sortOrderInCollection: Int
documents: [Document!]
stockEvents: [StockEvent!]
sales: [Sale!]!
vouchers: [Voucher!]!
subStatus: ProductSubStatusEnum
dimensions: ProductDimensions
warnings: [WarningMessageItem!]!
webhookHistory(
before: String
after: String
first: Int
last: Int
): ShopifyWebhookTransactionCountableConnection
}
Show more ↓

Fields

ProductVariant.id ● ID! non-null scalar

The ID of the object

ProductVariant.createdAt ● DateTime! non-null scalar

ProductVariant.updatedAt ● DateTime! non-null scalar

ProductVariant.externalId ● String scalar

ProductVariant.externalSource ● String scalar

ProductVariant.seoTitle ● String scalar

ProductVariant.seoDescription ● String scalar

ProductVariant.sku ● String scalar

ProductVariant.name ● String! non-null scalar

ProductVariant.nauticalStockNumber ● String! non-null scalar

ProductVariant.status ● ProductVariantStatus! non-null enum

ProductVariant.currency ● String scalar

ProductVariant.product ● Product! non-null object

ProductVariant.trackInventory ● Boolean! non-null scalar

ProductVariant.weight ● Weight object

ProductVariant.seller ● Seller object

ProductVariant.publishedAt ● DateTime scalar

The datetime when this variant will become available. This field may contain a past, future date or can be empty (so it is always published if isPublished is true)

ProductVariant.isPublished ● Boolean! non-null scalar

Whether the product variant is published.

ProductVariant.overrideCurrency ● Boolean! non-null scalar

ProductVariant.allowBackorders ● Boolean scalar

ProductVariant.isPriceOverrideAllowed ● Boolean! non-null scalar

indicates whether we allow overriding the unit_price of variants in checkout and draft order lines

ProductVariant.isShippingRequired ● Boolean! non-null scalar

ProductVariant.isDigital ● Boolean! non-null scalar

ProductVariant.privateMetadata ● [MetadataItem!]! non-null object

List of private metadata items.Requires proper staff permissions to access.

ProductVariant.metadata ● [MetadataItem!]! non-null object

List of public metadata items. Can be accessed without permissions.

ProductVariant.price ● Money object

Base price of a product variant. This field is restricted for admins. Use the pricing field to get the public price for customers.

ProductVariant.pricing ● VariantPricingInfo object

Lists the storefront variant's pricing, the current price and discounts, only meant for displaying.

ProductVariant.attributes ● [SelectedAttribute!]! non-null object

List of attributes assigned to this variant.

ProductVariant.customFields ● [SelectedAttribute!]! non-null object

List of custom fields assigned to this product.

ProductVariant.costPrice ● Money object

Cost price of the variant.

ProductVariant.margin ● Int scalar

Gross margin percentage value.

ProductVariant.quantityOrdered ● Int scalar

Total quantity ordered.

ProductVariant.images ● [ProductImage!] list object

List of product variant images. When 'strict_product_image_handling' is enabled:- Display only the images owned by the product variant owner.

ProductVariant.availableImages ● [ProductImage!] list object

List the product images available for assignment to a variant.When the 'strict_product_image_handling' is enabled:- Only display images owned by the product variant owner.

ProductVariant.digitalContent ● DigitalContent object

Digital content for the product variant.

ProductVariant.stocks ● [Stock!] list object

Stocks for the product variant.

ProductVariant.stocks.countryCode ● CountryCode enum

Two-letter ISO 3166-1 country code.

ProductVariant.quantityAvailable ● Int! non-null scalar

Quantity of a product available for sale in one checkout.

ProductVariant.quantityAvailable.countryCode ● CountryCode enum

Two-letter ISO 3166-1 country code. When provided, the exact quantity from a warehouse operating in shipping zones that contain this country will be returned. Otherwise, it will return the maximum quantity from all shipping zones.

ProductVariant.netRevenue ● Float scalar

ProductVariant.grossRevenue ● Float scalar

ProductVariant.sortOrderInCollection ● Int scalar

Variant sort order in the specific collection. Make sense only as a part of the parent 'collections' query.

ProductVariant.documents ● [Document!] list object

List of documents associated with the product variant.

ProductVariant.stockEvents ● [StockEvent!] list object

List of stock events associated with the variant.

ProductVariant.sales ● [Sale!]! non-null object

List of sales associated with the product.

ProductVariant.vouchers ● [Voucher!]! non-null object

List of vouchers associated with the product.

ProductVariant.subStatus ● ProductSubStatusEnum enum

The sub status of the product variant. This will be the same as product's sub status.

ProductVariant.dimensions ● ProductDimensions object

Product dimensions.

ProductVariant.warnings ● [WarningMessageItem!]! non-null object

List of warnings for this product variant that needs to be resolved for publishing.

ProductVariant.webhookHistory ● ShopifyWebhookTransactionCountableConnection object

Shopify webhook events related to this variant

ProductVariant.webhookHistory.before ● String scalar

Return the elements in the list that come before the specified cursor.

ProductVariant.webhookHistory.after ● String scalar

Return the elements in the list that come after the specified cursor.

ProductVariant.webhookHistory.first ● Int scalar

Return the first n elements from the list.

ProductVariant.webhookHistory.last ● Int scalar

Return the last n elements from the list.

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

Returned By

productVariant query

Member Of

CheckoutLine object ● DigitalContent object ● DigitalContentCreate object ● DigitalContentDelete object ● DigitalContentUpdate object ● NauticalOrderLine object ● OrderLine object ● Product object ● ProductVariantBulkCreate object ● ProductVariantCountableEdge object ● ProductVariantCreate object ● ProductVariantDelete object ● ProductVariantImageAssign object ● ProductVariantImageBulkAssign object ● ProductVariantImageUnassign object ● ProductVariantStocksCreate object ● ProductVariantStocksDelete object ● ProductVariantStocksUpdate object ● ProductVariantUpdate object ● ProductVariantVideoAssign object ● ProductVariantVideoUnassign object ● Stock object ● WishlistItem object

Implemented By

CustomFieldInstance union ● DocumentTargetInstance union

Was this page helpful?