Products
Create, update, delete, and query products.
Table-Specific Information
Select
The driver uses the Shopify API to process search criteria that refer to the following columns: Id, Title, Vendor, Handle, ProductType, PublishedStatus, CreatedAt, PublishedAt, and UpdatedAt. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria will be ignored and an unfiltered response will be returned.
For example, the following queries are processed server side.
SELECT * FROM Products
SELECT * FROM Products WHERE Id = '123'
SELECT * FROM Products WHERE Id IN ('123','456')
SELECT * FROM Products WHERE CreatedAt > '2017-10-25'
SELECT * FROM Products WHERE Title = 'just a title'
SELECT * FROM Products WHERE Vendor = 'just a vendor'
Insert
-
Create a new product with the default product variant.
INSERT INTO Products(Title, BodyHtml, Vendor, ProductType, Tags) VALUES('Burton Custom Freestyle 151', 'Good snowboard!', 'Burton', 'Snowboard', 'Barnes & Noble, Johns Fav, Big Air')
-
Create a new unpublished product.
INSERT INTO Products(Title, BodyHtml, Vendor, ProductType, Tags, Published) VALUES('Burton Custom Freestyle 151', 'Good snowboard!', 'Burton', 'Snowboard', 'Barnes & Noble, Johns Fav, Big Air', false)
Update
To update a product you must specify its Id.
UPDATE Products SET Published=true WHERE Id='123'
UPDATE Products SET MetafieldsGlobalTitleTag='Brand new title', MetafieldsGlobalDescriptionTag='Brand new description' WHERE Id='123'
Delete
To delete a product you must specify its Id.
DELETE FROM Products WHERE Id='123'
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | Long | True |
A unique numeric identifier for the product. | |
BodyHtml | String | False |
The description of the product, complete with HTML formatting. | |
Handle | String | True |
A human-friendly unique string for the Product automatically generated from its title. | |
Images | String | False |
A list of image objects. | |
ProductType | String | False |
A categorization that a product can be tagged with, commonly used for filtering and searching. | |
Options | String | True |
Custom product property names. | |
PublishedScope | String | False |
Indicates whether the product is published to the Point of Sale channel. | |
Tags | String | False |
A categorization that a product can be tagged with. Use commas to separate categories. | |
Status | String | False |
The status of the product. The allowed values are active, archived, draft. | |
TemplateSuffix | String | True |
The suffix of the liquid template being used. | |
Title | String | False |
The name of the product. | |
Vendor | String | False |
The name of the vendor of the product. | |
PublishedAt | Datetime | True |
The date and time when the product was published to the Online Store channel. | |
CreatedAt | Datetime | True |
The date and time when the product was created. | |
UpdatedAt | Datetime | True |
The date and time when the product was last modified. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
PublishedStatus | String |
Return products by their published status: published: show only published products;unpublished: show only unpublished products; any: show all products. |
Published | Boolean |
Set to true to publish the product or to false to not publish it |
MetafieldsGlobalTitleTag | String |
The name of the product, to be used for SEO purposes. |
MetafieldsGlobalDescriptionTag | String |
The description of the product, to be used for SEO purposes. |