Table InventoryLevels
Description
No description available
Supported Operations
Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.| Method | Supported | Reference EndPoint |
|---|---|---|
| SELECT | get_inventory_levels | |
| INSERT | post_inventory_level | |
| UPDATE | put_inventory_level | |
| UPSERT | ||
| DELETE | ||
| LOOKUP |
Examples
SSIS
Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:
Read from InventoryLevels table using API Source
| Optional Parameters | |
|---|---|
| inventory_item_ids | |
| location_ids | |
| Updated at or after | |
Read/write to InventoryLevels table using API Destination
| Optional Parameters | |
|---|---|
| inventory_item_ids | |
| location_ids | |
| Updated at or after | |
ODBC application
Use these SQL queries in your ODBC application data source:
Read inventory levels
<p>Gets inventory levels for all locations. If you encounter a "URL Too Long" error (due to API limits), manually supply a list of <code>location_ids</code> in the <code>WITH</code> clause.</p>
select * from InventoryLevels
--WITH(location_ids='43512280416356, 44648752676964, ..... upto 300 to 500 more - until you hit URL limit error')
Read inventory levels by inventory item IDs
<p>Gets inventory levels for specific inventory items. Supply a comma-separated list of IDs in the <code>inventory_item_ids</code> parameter within the <code>WITH</code> clause.</p>
select * from InventoryLevels WITH (inventory_item_ids='43512280416356, 44648752676964')
Read inventory levels by location IDs
<p>Gets inventory levels for specific locations (e.g. physical store, POS). Supply a comma-separated list of IDs in the <code>location_ids</code> parameter within the <code>WITH</code> clause.</p>
select * from InventoryLevels WITH (location_ids='43512280416356, 44648752676964')
Read inventory levels by inventory and location IDs
<p>Gets inventory levels for specific inventory items at specific locations by supplying both <code>inventory_item_ids</code> and <code>location_ids</code> in the <code>WITH</code> clause.</p>
select * from InventoryLevels WITH (inventory_item_ids='43512280416356, 44648752676964' , location_ids='111100034, 111100055')
Adjust inventory level
<p>Adjusts the inventory level of an item at a single location. Use <code>Action='Adjust'</code> in the <code>WITH</code> clause and provide the <code>AvailableAdjustment</code> amount (positive or negative).</p>
UPDATE InventoryLevels
SET AvailableAdjustment=488,
LocationId=25801916516
WHERE InventoryItemId=43512276942948
WITH(
Action='Adjust' --or set or connect
, ContineOn404Error=0
)
Set inventory level
<p>Sets the absolute inventory level for an item at a location. Use <code>Action='set'</code> in the <code>WITH</code> clause and provide the <code>Available</code> quantity. If the location is not connected, it will be automatically connected.</p>
UPDATE InventoryLevels
SET LocationId=25801916516
,Available=488
WHERE InventoryItemId=43512276942948
WITH(
Action='set' --or adjust or connect
, ContineOn404Error=0
)
--OR--
/*
INSERT INTO InventoryLevels (InventoryItemId,LocationId,Available)
VALUES(43512276942948, 25801916516, 488)
--WITH( ContineOn404Error=0 )
*/
Connect inventory item to location
<p>Connects an inventory item to a location by creating an inventory level record. Use <code>Action='connect'</code> in the <code>WITH</code> clause.</p>
UPDATE InventoryLevels
SET LocationId=25801916516
WHERE InventoryItemId=43512276942948
WITH(
Action='connect' --or adjust or set
, ContineOn404Error=0
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read inventory levels
<p>Gets inventory levels for all locations. If you encounter a "URL Too Long" error (due to API limits), manually supply a list of <code>location_ids</code> in the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'select * from InventoryLevels
--WITH(location_ids=''43512280416356, 44648752676964, ..... upto 300 to 500 more - until you hit URL limit error'')';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read inventory levels by inventory item IDs
<p>Gets inventory levels for specific inventory items. Supply a comma-separated list of IDs in the <code>inventory_item_ids</code> parameter within the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'select * from InventoryLevels WITH (inventory_item_ids=''43512280416356, 44648752676964'')';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read inventory levels by location IDs
<p>Gets inventory levels for specific locations (e.g. physical store, POS). Supply a comma-separated list of IDs in the <code>location_ids</code> parameter within the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'select * from InventoryLevels WITH (location_ids=''43512280416356, 44648752676964'')';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read inventory levels by inventory and location IDs
<p>Gets inventory levels for specific inventory items at specific locations by supplying both <code>inventory_item_ids</code> and <code>location_ids</code> in the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'select * from InventoryLevels WITH (inventory_item_ids=''43512280416356, 44648752676964'' , location_ids=''111100034, 111100055'')';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Adjust inventory level
<p>Adjusts the inventory level of an item at a single location. Use <code>Action='Adjust'</code> in the <code>WITH</code> clause and provide the <code>AvailableAdjustment</code> amount (positive or negative).</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE InventoryLevels
SET AvailableAdjustment=488,
LocationId=25801916516
WHERE InventoryItemId=43512276942948
WITH(
Action=''Adjust'' --or set or connect
, ContineOn404Error=0
)';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Set inventory level
<p>Sets the absolute inventory level for an item at a location. Use <code>Action='set'</code> in the <code>WITH</code> clause and provide the <code>Available</code> quantity. If the location is not connected, it will be automatically connected.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE InventoryLevels
SET LocationId=25801916516
,Available=488
WHERE InventoryItemId=43512276942948
WITH(
Action=''set'' --or adjust or connect
, ContineOn404Error=0
)
--OR--
/*
INSERT INTO InventoryLevels (InventoryItemId,LocationId,Available)
VALUES(43512276942948, 25801916516, 488)
--WITH( ContineOn404Error=0 )
*/';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Connect inventory item to location
<p>Connects an inventory item to a location by creating an inventory level record. Use <code>Action='connect'</code> in the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE InventoryLevels
SET LocationId=25801916516
WHERE InventoryItemId=43512276942948
WITH(
Action=''connect'' --or adjust or set
, ContineOn404Error=0
)';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];