Endpoint Create a Product Variant
Name
post_product_variant
Description
Creates a new product variant. [API reference]
Related Tables
Parameters
| Parameter | Required | Options |
|---|---|---|
|
Name:
Label: Product Id The ID of the product for which you like to create a new variant. |
YES |
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| Id |
DT_I8
|
bigint
|
||
| ProductId |
DT_I8
|
bigint
|
||
| Title |
DT_WSTR
|
nvarchar(100)
|
100 | |
| Sku |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Price |
DT_WSTR
|
nvarchar(100)
|
100 | |
| CompareAtPrice |
DT_WSTR
|
nvarchar(100)
|
100 | |
| Position |
DT_I4
|
int
|
||
| Option1 |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Option2 |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Option3 |
DT_WSTR
|
nvarchar(500)
|
500 | |
| CreatedAt |
DT_DBTIMESTAMP
|
datetime
|
||
| UpdatedAt |
DT_DBTIMESTAMP
|
datetime
|
||
| Taxable |
DT_BOOL
|
bit
|
||
| InventoryItemId |
DT_I8
|
bigint
|
||
| InventoryQuantity |
DT_I4
|
int
|
||
| OldInventoryQuantity |
DT_I4
|
int
|
||
| InventoryPolicy |
DT_WSTR
|
nvarchar(50)
|
50 | |
| InventoryManagement |
DT_WSTR
|
nvarchar(100)
|
100 | |
| FulfillmentService |
DT_WSTR
|
nvarchar(100)
|
100 | |
| Barcode |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Grams |
DT_I4
|
int
|
||
| ImageId |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Weight |
DT_R8
|
float
|
||
| WeightUnit |
DT_WSTR
|
nvarchar(50)
|
50 | |
| RequiresShipping |
DT_BOOL
|
bit
|
||
| AdminGraphqlApiId |
DT_WSTR
|
nvarchar(500)
|
500 | |
| PresentmentPrices |
DT_WSTR
|
nvarchar(4000)
|
4000 |
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| Id |
DT_I8
|
bigint
|
||
| ProductId |
DT_I8
|
bigint
|
||
| Title |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Price |
DT_WSTR
|
nvarchar(100)
|
100 | |
| Sku |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Position |
DT_I4
|
int
|
||
| InventoryPolicy |
DT_WSTR
|
nvarchar(50)
|
50 | |
| CompareAtPrice |
DT_WSTR
|
nvarchar(100)
|
100 | |
| FulfillmentService |
DT_WSTR
|
nvarchar(100)
|
100 | |
| InventoryManagement |
DT_WSTR
|
nvarchar(100)
|
100 | |
| Option1 |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Option2 |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Option3 |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Taxable |
DT_BOOL
|
bit
|
||
| Barcode |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Grams |
DT_I4
|
int
|
||
| ImageId |
DT_WSTR
|
nvarchar(500)
|
500 | |
| Weight |
DT_R8
|
float
|
||
| WeightUnit |
DT_WSTR
|
nvarchar(50)
|
50 | |
| InventoryItemId |
DT_I8
|
bigint
|
||
| InventoryQuantity |
DT_I4
|
int
|
||
| OldInventoryQuantity |
DT_I4
|
int
|
||
| RequiresShipping |
DT_BOOL
|
bit
|
||
| AdminGraphqlApiId |
DT_WSTR
|
nvarchar(500)
|
500 | |
| ProductId |
DT_WSTR
|
nvarchar(1000)
|
1000 |
Examples
SSIS
Use Shopify Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Destination
This Endpoint belongs to the ProductVariants table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to create a product variant:
| Required Parameters | |
|---|---|
| Product Id | Fill-in the parameter... |
ODBC application
Use these SQL queries in your ODBC application data source:
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)
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 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];
post_product_variant endpoint belongs to
ProductVariants
table(s), and can therefore be used via those table(s).