Reference

Endpoint Create a Product


Name

post_product

Description

Creates a new product. [API reference]

Related Tables

Products

Parameters

Parameter Required Options
There are no parameters

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_I8 bigint
Title DT_WSTR nvarchar(200) 200
BodyHtml DT_NTEXT nvarchar(MAX)
Vendor DT_WSTR nvarchar(200) 200
ProductType DT_WSTR nvarchar(200) 200
CreatedAt DT_DBTIMESTAMP datetime
UrlHandle DT_WSTR nvarchar(200) 200
UpdatedAt DT_DBTIMESTAMP datetime
PublishedAt DT_DBTIMESTAMP datetime
TemplateSuffix DT_WSTR nvarchar(200) 200
Status DT_WSTR nvarchar(200) 200
PublishedScope DT_WSTR nvarchar(200) 200
Tags DT_WSTR nvarchar(4000) 4000
AdminGraphqlApiId DT_WSTR nvarchar(200) 200
Variants DT_NTEXT nvarchar(MAX)
Options DT_WSTR nvarchar(4000) 4000
Images DT_NTEXT nvarchar(MAX) 4000
Image DT_WSTR nvarchar(4000) 4000
ImageId DT_I8 bigint
ImageProductId DT_I8 bigint
ImagePosition DT_I4 int
ImageCreatedAt DT_DBTIMESTAMP datetime
ImageUpdatedAt DT_DBTIMESTAMP datetime
ImageAlt DT_WSTR nvarchar(4000) 4000
ImageWidth DT_I4 int
ImageHeight DT_I4 int
ImageSrc DT_WSTR nvarchar(4000) 4000
ImageVariantIds DT_WSTR nvarchar(500) 500
ImageAdminGraphqlApiId DT_WSTR nvarchar(200) 200
Metafields DT_NTEXT nvarchar(MAX)
If the column you are looking for is missing, consider customizing Shopify Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Title DT_WSTR nvarchar(200) 200
BodyHtml DT_NTEXT nvarchar(MAX) (maximum is 512 KB)
UrlHandle DT_WSTR nvarchar(500) 500
ProductType DT_WSTR nvarchar(200) 200
Status DT_WSTR nvarchar(200) 200
Vendor DT_WSTR nvarchar(200) 200
TemplateSuffix DT_WSTR nvarchar(200) 200
PublishedScope DT_WSTR nvarchar(200) 200
Tags DT_WSTR nvarchar(4000) 4000
Variants DT_NTEXT nvarchar(MAX)
Options DT_WSTR nvarchar(4000) 4000
Images DT_NTEXT nvarchar(MAX)
Metafields DT_NTEXT nvarchar(MAX)
SEOTitle DT_WSTR nvarchar(1000) 1000
SEODescription DT_WSTR nvarchar(4000) 4000
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 Products 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:

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
Products
Insert
There are no parameters to configure.
SSIS API Destination - Access table operation

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