Create a Product
Name
post_product
Description
Creates a new product. [API reference]
Related Tables
Parameters
Parameter | Label | Required | Options | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no parameters |
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
Id |
DT_I8
|
bigint
|
False |
||
Title |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
BodyHtml |
DT_NTEXT
|
nvarchar(MAX)
|
False |
||
Vendor |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
ProductType |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
CreatedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
UrlHandle |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
UpdatedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
PublishedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
TemplateSuffix |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Status |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
PublishedScope |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Tags |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
|
AdminGraphqlApiId |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Variants |
DT_NTEXT
|
nvarchar(MAX)
|
False |
||
Options |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
|
Images |
DT_NTEXT
|
nvarchar(MAX)
|
4000 | False |
|
Image |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
|
ImageId |
DT_I8
|
bigint
|
False |
||
ImageProductId |
DT_I8
|
bigint
|
False |
||
ImagePosition |
DT_I4
|
int
|
False |
||
ImageCreatedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
ImageUpdatedAt |
DT_DBTIMESTAMP
|
datetime
|
False |
||
ImageAlt |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
|
ImageWidth |
DT_I4
|
int
|
False |
||
ImageHeight |
DT_I4
|
int
|
False |
||
ImageSrc |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
|
ImageVariantIds |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
ImageAdminGraphqlApiId |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Metafields |
DT_NTEXT
|
nvarchar(MAX)
|
False |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
Title |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
BodyHtml |
DT_NTEXT
|
nvarchar(MAX)
|
False |
(maximum is 512 KB) | |
UrlHandle |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
ProductType |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Status |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Vendor |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
TemplateSuffix |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
PublishedScope |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Tags |
DT_WSTR
|
nvarchar(4000)
|
4000 | True |
|
Variants |
DT_NTEXT
|
nvarchar(MAX)
|
True |
||
Options |
DT_WSTR
|
nvarchar(4000)
|
4000 | True |
|
Images |
DT_NTEXT
|
nvarchar(MAX)
|
True |
||
Metafields |
DT_NTEXT
|
nvarchar(MAX)
|
True |
||
SEOTitle |
DT_WSTR
|
nvarchar(1000)
|
1000 | False |
|
SEODescription |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
Examples
SSIS
Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:
Insert into Products table using API Destination
This Endpoint belongs to Products 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
This example shows how to insert a new Shopify product. It also sets Variants
INSERT INTO Products
(
Title
,Status
,BodyHtml
,UrlHandle
,Vendor
,ProductType
,Variants
,Options
,Tags
,Metafields
,Images
)
VALUES
('Ice Cream'
,'draft'
,'<strong>Very yummy ice cream!</strong>'
,'ice-cream'
,'Burton'
,'Snowboard'
,'[
{"price":10.5, "option1":"Chocolate","option2":"Small","sku":"ICE-CHO-SML","inventory_quantity":100},
{"price":10.5, "option1":"Chocolate","option2":"Medium","sku":"ICE-CHO-MED","inventory_quantity":100},
{"price":11.5, "option1":"Vanilla","option2":"Small","sku":"ICE-VNL-MED","inventory_quantity":210}
]'
--you must set variants and use atlease one value from the below list in option1, option2 or option3 in any variant entry else it will fail.
,'[
{"name":"Color","values":["Chocolate","Vanilla"]},
{"name":"Size","values":["Small","Medium"]}
]'
,'["Frozen","Seasonal","Dad''s Fav"]'
--adding metadata (custom fields) - metadata fields must be created before setting it
--below are 2 system fields for SEO Title / SEO Description (you dont need to create them unlike custom metadata). These values appears on SEO section
,'[
{"key":"title_tag","value":"Yum Ice Cream SEO Title", "namespace":"global","type":"single_line_text_field"},
{"key":"description_tag","value":"Yum Ice Cream SEO description", "namespace":"global","type":"single_line_text_field"}
]'
--first image becomes main image if you supply multiple images
--upload multiple images from URL (set "src")
, '[
{"src":"https://zappysys.com/images/tech/google-analytics-logo.png"},
{"src":"https://zappysys.com/images/tech/web-api-logo.png"}
]'
--OR upload multiple local image files (set "attachment")
--, '[
-- {"attachment":"<<c:\temp\icecream_1.png,FUN_FILE_BASE64ENC>>"},
-- {"attachment":"<<c:\temp\icecream_2.png,FUN_FILE_BASE64ENC>>"}
-- ]'
)
post_product
endpoint belongs to
Products
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
This example shows how to insert a new Shopify product. It also sets Variants
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Products
(
Title
,Status
,BodyHtml
,UrlHandle
,Vendor
,ProductType
,Variants
,Options
,Tags
,Metafields
,Images
)
VALUES
(''Ice Cream''
,''draft''
,''<strong>Very yummy ice cream!</strong>''
,''ice-cream''
,''Burton''
,''Snowboard''
,''[
{"price":10.5, "option1":"Chocolate","option2":"Small","sku":"ICE-CHO-SML","inventory_quantity":100},
{"price":10.5, "option1":"Chocolate","option2":"Medium","sku":"ICE-CHO-MED","inventory_quantity":100},
{"price":11.5, "option1":"Vanilla","option2":"Small","sku":"ICE-VNL-MED","inventory_quantity":210}
]''
--you must set variants and use atlease one value from the below list in option1, option2 or option3 in any variant entry else it will fail.
,''[
{"name":"Color","values":["Chocolate","Vanilla"]},
{"name":"Size","values":["Small","Medium"]}
]''
,''["Frozen","Seasonal","Dad''''s Fav"]''
--adding metadata (custom fields) - metadata fields must be created before setting it
--below are 2 system fields for SEO Title / SEO Description (you dont need to create them unlike custom metadata). These values appears on SEO section
,''[
{"key":"title_tag","value":"Yum Ice Cream SEO Title", "namespace":"global","type":"single_line_text_field"},
{"key":"description_tag","value":"Yum Ice Cream SEO description", "namespace":"global","type":"single_line_text_field"}
]''
--first image becomes main image if you supply multiple images
--upload multiple images from URL (set "src")
, ''[
{"src":"https://zappysys.com/images/tech/google-analytics-logo.png"},
{"src":"https://zappysys.com/images/tech/web-api-logo.png"}
]''
--OR upload multiple local image files (set "attachment")
--, ''[
-- {"attachment":"<<c:\temp\icecream_1.png,FUN_FILE_BASE64ENC>>"},
-- {"attachment":"<<c:\temp\icecream_2.png,FUN_FILE_BASE64ENC>>"}
-- ]''
)';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
post_product
endpoint belongs to
Products
table(s), and can therefore be used via those table(s).