ProductVariants
Lists product variants with pricing, inventory tracking, and option values.
Table-Specific Information
Select
The 本製品 uses the Shopify API to process WHERE clause conditions built with the following columns and operators. The 本製品 processes other filters client-side within the 本製品.
- 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.
- UpdatedAt supports the '=, !=, <, >, >=, <=' comparison operators.
- Taxable supports the '=, !=' comparison operators.
- DeliveryProfileId supports the '=, !=' comparison operators.
- LocationInventoryQuantity 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 UpdatedAt = '2023-01-01 11:10:00'
SELECT * FROM ProductVariants WHERE Taxable = true
SELECT * FROM ProductVariants WHERE DeliveryProfileId = 'Val1'
SELECT * FROM ProductVariants WHERE LocationInventoryQuantity = 123
Insert
The following columns can be used to create a new record:
ProductId, Barcode, Price, CompareAtPrice, TaxCode, Taxable, InventoryPolicy, InventoryItemUnitCostAmount, InventoryItemHarmonizedSystemCode, InventoryItemMeasurementWeightValue, InventoryItemMeasurementWeightUnit, InventoryItemRequiresShipping, InventoryItemTracked
The following pseudo-columns can be used to create a new record:
MediaId, MediaSrc, InventoryQuantities (references InventoryItemInventoryLevelQuantities), OptionValues (references ProductOptionValues), Metafields (references Metafields), Strategy
InventoryItemInventoryLevelQuantities Temporary Table Columns
| Column Name | Type | Description |
| InventoryLevelLocationId | String | A globally-unique ID. |
| Quantity | Int | The quantity for the quantity name. |
ProductOptionValues Temporary Table Columns
| Column Name | Type | Description |
| ProductOptionId | String | A globally-unique ID. |
| ProductOptionName | String | The product option's name. |
| Id | String | A globally-unique ID. |
| Name | String | Value associated with an option. |
| LinkedMetafieldValue | String | Metafield value associated with an option. |
Metafields Temporary Table Columns
| Column Name | Type | Description |
| Id | String | The unique ID of the metafield. |
| Namespace | String | A container for a set of metafields. You need to define a custom namespace for your metafields to distinguish them from the metafields used by other apps. |
| Key | String | The name of the metafield. |
| Value | String | The information to be stored as metadata. |
| Type | String | The metafield's information type. |
Update
The following columns can be updated:
ProductId, Barcode, Price, CompareAtPrice, TaxCode, Taxable, InventoryPolicy, InventoryItemUnitCostAmount, InventoryItemHarmonizedSystemCode, InventoryItemMeasurementWeightValue, InventoryItemMeasurementWeightUnit, InventoryItemRequiresShipping, InventoryItemTracked
The following pseudo-columns can be used to update a record:
MediaId, MediaSrc, OptionValues (references ProductOptionValues), Metafields (references Metafields), AllowPartialUpdates
ProductOptionValues Temporary Table Columns
| Column Name | Type | Description |
| ProductOptionId | String | A globally-unique ID. |
| ProductOptionName | String | The product option's name. |
| Id | String | A globally-unique ID. |
| Name | String | Value associated with an option. |
| LinkedMetafieldValue | String | Metafield value associated with an option. |
Metafields Temporary Table Columns
| Column Name | Type | Description |
| Id | String | The unique ID of the metafield. |
| Namespace | String | A container for a set of metafields. You need to define a custom namespace for your metafields to distinguish them from the metafields used by other apps. |
| Key | String | The name of the metafield. |
| Value | String | The information to be stored as metadata. |
| Type | String | The metafield's information type. |
Delete
You can delete entries by specifying the following columns:
Id, ProductId
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
A globally unique Id of the product variant. | |
| LegacyResourceId | Long | True |
The Id of the corresponding resource in the REST Admin API. | |
| ProductId | String | False |
Products.Id |
A globally unique Id of the associated product. |
| Position | Int | True |
The position of the product variant in the list of product variants. The first position in the list is 1. | |
| DisplayName | String | True |
The display name of the variant, based on the product's title and the variant's title. | |
| Barcode | String | False |
The barcode value associated with the product variant. | |
| Sku | String | True |
An identifier for the product variant in the shop. Required to connect to a fulfillment service. | |
| Title | String | True |
The title of the product variant. | |
| RequiresComponents | Bool | True |
Indicates whether the product variant requires components. If true, it can only be purchased as part of a parent bundle and is omitted from channels that don't support bundles. | |
| UpdatedAt | Datetime | True |
The date and time when the product variant was last updated. | |
| CreatedAt | Datetime | True |
The date and time when the product variant was created. | |
| SelectedOptions | String | True |
The list of product options applied to the variant. | |
| AvailableForSale | Bool | True |
Indicates whether the product variant is available for sale. | |
| Price | Decimal | False |
The price of the product variant in the default shop currency. | |
| CompareAtPrice | Decimal | False |
The compare-at price of the product variant in the default shop currency. | |
| TaxCode | String | False |
The tax code for the product variant. | |
| Taxable | Bool | False |
Indicates whether tax is charged when the product variant is sold. | |
| SellableOnlineQuantity | Int | True |
The total sellable quantity of the variant for online channels. This does not represent total available inventory and might vary by customer location. | |
| SellingPlanGroupsCount | Int | True |
The total number of selling plan groups associated with the product variant. | |
| SellingPlanGroupsCountPrecision | String | True |
The precision of the selling plan group count, indicating the exactness of the value. | |
| DeliveryProfileId | String | True |
A globally unique Id of the delivery profile. | |
| InventoryPolicy | String | False |
Defines whether customers can place an order for the product variant when it is out of stock. | |
| InventoryQuantity | Int | True |
The total sellable quantity of the variant. | |
| InventoryItemId | String | True |
A globally unique Id of the inventory item. | |
| InventoryItemUnitCostAmount | Decimal | False |
The unit cost of the inventory item, expressed as a decimal money amount. | |
| InventoryItemUnitCostCurrencyCode | String | True |
The currency code of the unit cost for the inventory item. | |
| InventoryItemHarmonizedSystemCode | String | False |
The harmonized system code of the inventory item. | |
| InventoryItemMeasurementWeightValue | Double | False |
The weight value of the inventory item, based on the specified unit. | |
| InventoryItemMeasurementWeightUnit | String | False |
The unit of measurement for the inventory item's weight value. | |
| InventoryItemRequiresShipping | Bool | False |
Indicates whether the inventory item requires shipping. | |
| InventoryItemTracked | Bool | False |
Indicates whether inventory levels are tracked for the item. | |
| ImageId | String | True |
A globally unique Id of the associated image. | |
| ImageAltText | String | True |
Alternative text that describes the image. | |
| ImageHeight | Int | True |
The original height of the image in pixels. Contains null if the image isn't hosted by Shopify. | |
| ImageWidth | Int | True |
The original width of the image in pixels. Contains null if the image isn't hosted by Shopify. | |
| ImageUrl | String | True |
The URL location of the image. | |
| UnitPriceMeasurementMeasuredType | String | True |
The type of measurement used for the unit price. | |
| UnitPriceMeasurementQuantityUnit | String | True |
The quantity unit used for the unit price measurement. | |
| UnitPriceMeasurementQuantityValue | Double | True |
The quantity value used for the unit price measurement. | |
| UnitPriceMeasurementReferenceUnit | String | True |
The reference unit used for the unit price measurement. | |
| UnitPriceMeasurementReferenceValue | Int | True |
The reference value used for the unit price measurement. | |
| LocationInventoryQuantity | Int | True |
Filters by the available inventory quantity of the variant at individual locations. |
Pseudo-Columns
疑似カラムは、明示的にリストされているタイプのステートメントでのみ使用できるフィールドです。これらは標準的なカラムではなく、特定の操作のための追加機能を提供するものです。
| Name | Type | Description |
| MediaId | String |
The Id of the media associated with the variant. |
| MediaSrc | String |
The URL of the media associated with the variant. |
| InventoryQuantities | String |
The inventory quantities at each location where the variant is stocked. The number of entries can't exceed the plan limit. |
| OptionValues | String |
The custom properties that a shop owner uses to define product variants. |
| Metafields | String |
Additional customizable metafields for the product variant. |
| Strategy | String |
Defines how standalone variants are handled when creating new variants. DEFAULT: keeps the standalone variant. REMOVE_STANDALONE_VARIANT: deletes the standalone variant when new variants are created. 使用できる値は次のとおりです。DEFAULT, REMOVE_STANDALONE_VARIANT |
| AllowPartialUpdates | Bool |
Indicates whether partial updates are allowed. If true, valid changes are saved even when some variants contain errors. If false, any error prevents all updates. |