EndPoint Generic Request
Name
generic_request
Description
This is generic endpoint. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.
Parameters
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Examples
SSIS
Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:
Generic Request using API Source

Generic Request using API Destination

ODBC application
Use these SQL queries in your ODBC application data source:
Set inventory with a specific inventory item and location id - generic API
If you get URL Too long error then reduce location ids in the query (approx 300-400 ids per call allowed)
SELECT * FROM generic_request
WITH (
URL='/inventory_levels/set.json'
--OR Use full URL
--URL='https://MY-STORE-HERE.myshopify.com/admin/api/2023-01/inventory_levels/set.json'
, RequestMethod='POST'
, Body='{"location_id":25801916516,"inventory_item_id":43512280416356,"available":42}' --needed if you call PUT, POST
, Filter='$.inventory_level' --change table name here
, Headers='Content-Type: application/json'
, Meta='inventory_item_id:long; location_id:long; available:int; updated_at: datetime'
)
Generic Query using Shopify admin GraphQL API
This example shows how to invoke GraphQL query for very generic data read/write. For more information on GraphQL API visit this link https://shopify.dev/docs/api/admin/getting-started
SELECT * FROM generic_request
WITH (
URL='/graphql.json'
--OR Use full URL
--URL='https://MY-STORE-HERE.myshopify.com/admin/api/2023-10/graphql.json'
, RequestMethod='POST'
, Filter='$.data.products.nodes' --change table name here e.g. products
, Headers='Content-Type: application/json'
--change table name and columns below here e.g. products... and id, title etc
-- change pagesize if needed (i.e. max 250)
, Body='{
"query" : "<<{
products(first: 250 [$tag$])
{
nodes {
id
title
createdAt
}
pageInfo {
hasNextPage
endCursor
}
}
},FUN_JSONENC>>"
}'
, NextUrlAttributeOrExpr='$.data.products.pageInfo.endCursor' --change table name
, NextUrlEndIndicator='false'
, StopIndicatorAttributeOrExpr='$.data.products.pageInfo.hasNextPage' --change table name
, UseConnection='True'
, EnablePageTokenForBody='True'
, HasDifferentNextPageInfo='True'
, NextPageBodyPart='after: \"[$pagetoken$]\"'
--Use metadata to speed up execution. To get Metadata Run query without Meta clause.
-- Then click View Metadata button found in Botttom Result Grid Toolbar. Get Compact format and paste below
--, Meta='id:String(255); title:String(255); createdAt:DateTime; '
)
Generic Query using Shopify admin REST API
This example shows how to invoke pretty much any REST API for generic data read/write. For more information on REST API visit this link https://shopify.dev/docs/api/admin/getting-started
SELECT * FROM generic_request
WITH (
URL='/products.json'
--OR Use full URL
--URL='https://MY-STORE-HERE.myshopify.com/admin/api/2023-01/products.json'
, RequestMethod='GET'
, Body='{}' --needed if you call PUT, POST
, Filter='$.products[*]' --change table name here
, Headers='Content-Type: application/json'
, PagingMode='ByResponseHeaderRfc5988'
--Use metadata to speed up execution. To get Metadata Run query without Meta clause.
--Then click View Metadata button found in Botttom Result Grid Toolbar. Get Compact format and paste below
, Meta='id:String(255); title:String(255); created_at:DateTime; '
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Set inventory with a specific inventory item and location id - generic API
If you get URL Too long error then reduce location ids in the query (approx 300-400 ids per call allowed)
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM generic_request
WITH (
URL=''/inventory_levels/set.json''
--OR Use full URL
--URL=''https://MY-STORE-HERE.myshopify.com/admin/api/2023-01/inventory_levels/set.json''
, RequestMethod=''POST''
, Body=''{"location_id":25801916516,"inventory_item_id":43512280416356,"available":42}'' --needed if you call PUT, POST
, Filter=''$.inventory_level'' --change table name here
, Headers=''Content-Type: application/json''
, Meta=''inventory_item_id:long; location_id:long; available:int; updated_at: datetime''
)';
EXEC (@MyQuery) AT [LINKED_SERVER_TO_SHOPIFY_IN_DATA_GATEWAY];
Generic Query using Shopify admin GraphQL API
This example shows how to invoke GraphQL query for very generic data read/write. For more information on GraphQL API visit this link https://shopify.dev/docs/api/admin/getting-started
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM generic_request
WITH (
URL=''/graphql.json''
--OR Use full URL
--URL=''https://MY-STORE-HERE.myshopify.com/admin/api/2023-10/graphql.json''
, RequestMethod=''POST''
, Filter=''$.data.products.nodes'' --change table name here e.g. products
, Headers=''Content-Type: application/json''
--change table name and columns below here e.g. products... and id, title etc
-- change pagesize if needed (i.e. max 250)
, Body=''{
"query" : "<<{
products(first: 250 [$tag$])
{
nodes {
id
title
createdAt
}
pageInfo {
hasNextPage
endCursor
}
}
},FUN_JSONENC>>"
}''
, NextUrlAttributeOrExpr=''$.data.products.pageInfo.endCursor'' --change table name
, NextUrlEndIndicator=''false''
, StopIndicatorAttributeOrExpr=''$.data.products.pageInfo.hasNextPage'' --change table name
, UseConnection=''True''
, EnablePageTokenForBody=''True''
, HasDifferentNextPageInfo=''True''
, NextPageBodyPart=''after: \"[$pagetoken$]\"''
--Use metadata to speed up execution. To get Metadata Run query without Meta clause.
-- Then click View Metadata button found in Botttom Result Grid Toolbar. Get Compact format and paste below
--, Meta=''id:String(255); title:String(255); createdAt:DateTime; ''
)';
EXEC (@MyQuery) AT [LINKED_SERVER_TO_SHOPIFY_IN_DATA_GATEWAY];
Generic Query using Shopify admin REST API
This example shows how to invoke pretty much any REST API for generic data read/write. For more information on REST API visit this link https://shopify.dev/docs/api/admin/getting-started
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM generic_request
WITH (
URL=''/products.json''
--OR Use full URL
--URL=''https://MY-STORE-HERE.myshopify.com/admin/api/2023-01/products.json''
, RequestMethod=''GET''
, Body=''{}'' --needed if you call PUT, POST
, Filter=''$.products[*]'' --change table name here
, Headers=''Content-Type: application/json''
, PagingMode=''ByResponseHeaderRfc5988''
--Use metadata to speed up execution. To get Metadata Run query without Meta clause.
--Then click View Metadata button found in Botttom Result Grid Toolbar. Get Compact format and paste below
, Meta=''id:String(255); title:String(255); created_at:DateTime; ''
)';
EXEC (@MyQuery) AT [LINKED_SERVER_TO_SHOPIFY_IN_DATA_GATEWAY];