Create a Product Variant
Name
post_product_variant
Description
Creates a new product variant. [API reference]
Related Tables
Parameters
Parameter | Label | Required | Options | Description |
---|---|---|---|---|
Id | Product Id | YES | The ID of the product for which you like to create a new variant. |
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
Id |
DT_I8
|
bigint
|
False |
||
ProductId |
DT_I8
|
bigint
|
False |
||
Title |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
Sku |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Price |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
CompareAtPrice |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
Position |
DT_I4
|
int
|
False |
||
Option1 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Option2 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Option3 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
CreatedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
UpdatedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
Taxable |
DT_BOOL
|
bit
|
False |
||
InventoryItemId |
DT_I8
|
bigint
|
False |
||
InventoryQuantity |
DT_I4
|
int
|
False |
||
OldInventoryQuantity |
DT_I4
|
int
|
False |
||
InventoryPolicy |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
InventoryManagement |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
FulfillmentService |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
Barcode |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Grams |
DT_I4
|
int
|
False |
||
ImageId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Weight |
DT_R8
|
float
|
False |
||
WeightUnit |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
RequiresShipping |
DT_BOOL
|
bit
|
False |
||
AdminGraphqlApiId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
PresentmentPrices |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
Id |
DT_I8
|
bigint
|
False |
||
ProductId |
DT_I8
|
bigint
|
False |
||
Title |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Price |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
Sku |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Position |
DT_I4
|
int
|
False |
||
InventoryPolicy |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
CompareAtPrice |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
FulfillmentService |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
InventoryManagement |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
Option1 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Option2 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Option3 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Taxable |
DT_BOOL
|
bit
|
False |
||
Barcode |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Grams |
DT_I4
|
int
|
False |
||
ImageId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
Weight |
DT_R8
|
float
|
False |
||
WeightUnit |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
InventoryItemId |
DT_I8
|
bigint
|
False |
||
InventoryQuantity |
DT_I4
|
int
|
False |
||
OldInventoryQuantity |
DT_I4
|
int
|
False |
||
RequiresShipping |
DT_BOOL
|
bit
|
False |
||
AdminGraphqlApiId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
ProductId |
DT_WSTR
|
nvarchar(1000)
|
1000 | False |
Examples
SSIS
Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:
Insert into ProductVariants table using API Destination
This Endpoint belongs to ProductVariants table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

ODBC application
Use these SQL queries in your ODBC application data source:
Create a new product variant
This example shows how to create a new product variant.
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)
post_product_variant
endpoint belongs to
ProductVariants
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Create a new product variant
This example shows how to create a new product variant.
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];
post_product_variant
endpoint belongs to
ProductVariants
table(s), and can therefore be used via those table(s).