Table ProductVariants
Description
No description available
Supported Operations
Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.| Method | Supported | Reference EndPoint |
|---|---|---|
| SELECT | get_product_variants | |
| INSERT | post_product_variant | |
| UPDATE | put_product_variant | |
| UPSERT | ||
| DELETE | delete_product_variant | |
| LOOKUP | get_product_variants |
Examples
SSIS
Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:
Read from ProductVariants table using API Source
| Optional Parameters | |
|---|---|
| Product Id(s) - Comma separated | |
| Since Product Id | |
| Only Fields to Show | |
| Created Before | |
| Created After | |
| Updated Before | |
| Updated After | |
Read/write to ProductVariants table using API Destination
| Optional Parameters | |
|---|---|
| Product Id(s) - Comma separated | |
| Since Product Id | |
| Only Fields to Show | |
| Created Before | |
| Created After | |
| Updated Before | |
| Updated After | |
ODBC application
Use these SQL queries in your ODBC application data source:
Read product variants
<p>Gets a list of all product variants from the <code>ProductVariants</code> table.</p>
SELECT * FROM ProductVariants
Read product variants by product ID
<p>Gets all variants belonging to a specific product. Supply the <code>ProductId</code> in the <code>WHERE</code> clause.</p>
SELECT * FROM ProductVariants Where ProductId='1111111111111'
Read product variants by multiple product IDs
<p>Gets variants for multiple products by supplying a comma-separated list of product IDs in the <code>ids</code> parameter within the <code>WITH</code> clause.</p>
SELECT * FROM ProductVariants WITH(ids='1111111111111,2222222222222,3333333333333')
Create a product variant
<p>Creates a new variant for an existing product. You must provide the <code>ProductId</code> and variant details such as <code>Option1</code>, <code>Price</code>, <code>SKU</code>, and <code>Weight</code>.</p>
INSERT INTO ProductVariants (ProductId, Option1, Option2,SKU,Price,CompareAtPrice,Position,Weight,WeightUnit,ImageId)
Values(7348335771748, 'Chocolate', 'Medium', 'ICE-CHO-MED', 195.5, 200.5, 3, 20.5, 'lb', 31900013854820)
Update a product variant
<p>Updates an existing product variant identified by its <code>Id</code>. You can modify attributes like <code>Price</code>, <code>SKU</code>, <code>Weight</code>, and <code>Option1</code>.</p>
Update ProductVariants
SET
Option1='Chocolate'
,Option2='Large'
,SKU='ICE-CHO-SML'
,Price=90.45
,CompareAtPrice=100.45
,Position=2
,Weight=10.5
,WeightUnit='lb'
,ImageId=31900013854820 --use available images from Products table
Where Id=42564507992164
Delete a product variant
<p>Deletes an existing product variant by its <code>Id</code>.</p>
DELETE FROM ProductVariants
WHERE Id=31900013854820
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read product variants
<p>Gets a list of all product variants from the <code>ProductVariants</code> table.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM ProductVariants';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read product variants by product ID
<p>Gets all variants belonging to a specific product. Supply the <code>ProductId</code> in the <code>WHERE</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM ProductVariants Where ProductId=''1111111111111''';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read product variants by multiple product IDs
<p>Gets variants for multiple products by supplying a comma-separated list of product IDs in the <code>ids</code> parameter within the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM ProductVariants WITH(ids=''1111111111111,2222222222222,3333333333333'')';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Create a product variant
<p>Creates a new variant for an existing product. You must provide the <code>ProductId</code> and variant details such as <code>Option1</code>, <code>Price</code>, <code>SKU</code>, and <code>Weight</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO ProductVariants (ProductId, Option1, Option2,SKU,Price,CompareAtPrice,Position,Weight,WeightUnit,ImageId)
Values(7348335771748, ''Chocolate'', ''Medium'', ''ICE-CHO-MED'', 195.5, 200.5, 3, 20.5, ''lb'', 31900013854820)';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Update a product variant
<p>Updates an existing product variant identified by its <code>Id</code>. You can modify attributes like <code>Price</code>, <code>SKU</code>, <code>Weight</code>, and <code>Option1</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'Update ProductVariants
SET
Option1=''Chocolate''
,Option2=''Large''
,SKU=''ICE-CHO-SML''
,Price=90.45
,CompareAtPrice=100.45
,Position=2
,Weight=10.5
,WeightUnit=''lb''
,ImageId=31900013854820 --use available images from Products table
Where Id=42564507992164';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Delete a product variant
<p>Deletes an existing product variant by its <code>Id</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM ProductVariants
WHERE Id=31900013854820';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];