Reference

Endpoint Create a Product Variant


Name

post_product_variant

Description

Creates a new product variant. [API reference]

Related Tables

ProductVariants

Parameters

Parameter Required Options
Name: Id

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
If the column you are looking for is missing, consider customizing Shopify Connector.

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
Required columns that you need to supply are bolded.

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:

API Destination - Shopify
Shopify Connector can be used to integrate Shopify REST API in your App / BI Tools. You can read/write data about Customers, Orders, OrderItems, Products and more.
Shopify
ProductVariants
Insert
Required Parameters
Product Id Fill-in the parameter...
SSIS API Destination - Access table operation

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).