ProductVariants
Returns a list of the product variants.
Table-Specific Information
Select
The server uses the Shopify API to process WHERE clause conditions built with the following columns and operators. The server processes other filters client-side within the server.
- Id supports the '=, IN' comparison operators.
- ProductId supports the '=, !=' comparison operators.
- Barcode supports the '=, !=' comparison operators.
- Sku supports the '=, !=' comparison operators.
- Title supports the '=, !=' comparison operators.
- Taxable supports the '=, !=' comparison operators.
- UpdatedAt supports the '=, !=, <, >, >=, <=' comparison operators.
- CreatedAt supports the '=, !=, <, >, >=, <=' comparison operators.
- InventoryQuantity supports the '=, !=, <, >, >=, <=' comparison operators.
- DeliveryProfileId supports the '=, !=' comparison operators.
For example, the following queries are processed server-side:
SELECT * FROM ProductVariants WHERE Id = 'Val1'
SELECT * FROM ProductVariants WHERE ProductId = 'Val1'
SELECT * FROM ProductVariants WHERE Barcode = 'Val1'
SELECT * FROM ProductVariants WHERE Sku = 'Val1'
SELECT * FROM ProductVariants WHERE Title = 'Val1'
SELECT * FROM ProductVariants WHERE Taxable = true
SELECT * FROM ProductVariants WHERE UpdatedAt = '2023-01-01 11:10:00'
SELECT * FROM ProductVariants WHERE CreatedAt = '2023-01-01 11:10:00'
SELECT * FROM ProductVariants WHERE InventoryQuantity = 123
SELECT * FROM ProductVariants WHERE DeliveryProfileId = 'Val1'
Insert
The following columns can be used to create a new record:
ProductId, Position, Price, CompareAtPrice, Barcode, Weight, WeightUnit, Sku, Title, Taxable, TaxCode, InventoryPolicy, InventoryItemTracked
The following pseudo-columns can be used to create a new record:
Options, MediaId, MediaSrc
Update
The following columns can be updated:
Position, Price, CompareAtPrice, Barcode, Weight, WeightUnit, Sku, Title, Taxable, TaxCode, InventoryPolicy, InventoryItemTracked
The following pseudo-columns can be used to update a record:
Options, MediaId, MediaSrc
Delete
You can delete entries by specifying the following column:
Id
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
A globally-unique identifier. | |
| LegacyResourceId | Long | True |
The ID of the corresponding resource in the REST Admin API. | |
| ProductId | String | True |
Products.Id |
A globally-unique identifier. |
| Position | Int | False |
The order of the product variant in the list of product variants. The first position in the list is 1. | |
| AvailableForSale | Bool | True |
Whether the product variant is available for sale. | |
| SellableOnlineQuantity | Int | True |
The total sellable quantity of the variant for online channels. This doesn't represent the total available inventory or capture (limitations based on customer location). | |
| SellingPlanGroupCount | Int | True |
Count of selling plan groups associated with the product variant. | |
| Price | Decimal | False |
The price of the product variant in the default shop currency. | |
| CompareAtPrice | Decimal | False |
The compare-at price of the variant in the default shop currency. | |
| DisplayName | String | True |
Display name of the variant, based on product's title + variant's title. | |
| Barcode | String | False |
The value of the barcode associated with the product. | |
| Weight | Double | False |
The weight of the product variant in the unit system specified with weight_unit. | |
| WeightUnit | String | False |
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: 'g', 'kg', 'oz', 'lb'. | |
| Sku | String | False |
An identifier for the product variant in the shop. Required in order to connect to a fulfillment service. | |
| Title | String | False |
The title of the product variant. | |
| Taxable | Bool | False |
Whether a tax is charged when the product variant is sold. | |
| TaxCode | String | False |
The tax code for the product variant. | |
| UpdatedAt | Datetime | True |
The date and time when the product variant was last modified. | |
| CreatedAt | Datetime | True |
The date and time when the variant was created. | |
| InventoryPolicy | String | False |
Whether customers are allowed to place an order for the product variant when it's out of stock. | |
| InventoryQuantity | Int | True |
The total sellable quantity of the variant. | |
| InventoryItemId | String | True |
A globally-unique identifier. | |
| InventoryItemTracked | Bool | False |
Whether inventory levels are tracked for the item. | |
| ImageId | String | True |
A unique identifier for the image. | |
| ImageAltText | String | True |
A word or phrase to share the nature or contents of an image. | |
| ImageHeight | Int | True |
The original height of the image in pixels. Returns 'null' if the image is not hosted by Shopify. | |
| ImageWidth | Int | True |
The original width of the image in pixels. Returns 'null' if the image is not hosted by Shopify. | |
| ImageUrl | String | True |
The location of the image as a URL. | |
| DeliveryProfileId | String | True |
A globally-unique identifier. | |
| FulfillmentServiceEditableLocked | Bool | True |
Whether the attribute is locked for editing. | |
| FulfillmentServiceEditableReason | String | True |
The reason the attribute is locked for editing. |
Pseudo-Columns
Pseudo-columns are fields that can only be used in the types of statements under which they are explicitly listed. They are not standard columns but instead provide additional functionality for specific operations.
| Name | Type | Description |
| Options | String |
The custom properties that a shop owner uses to define product variants. |
| MediaId | String |
The ID of the media to associate with the variant. |
| MediaSrc | String |
The URL of the media to associate with the variant. |