Endpoint Get Inventory Levels
Name
get_inventory_levels
Description
Gets inventory level for a specific location and inventory item. [API reference]
Related Tables
Parameters
| Parameter | Required | Options |
|---|---|---|
|
Name:
Label: inventory_item_ids Inventory Item Id(s) - Comma separated |
||
|
Name:
Label: location_ids Location Id(s) - Comma separated |
||
|
Name:
Label: Updated at or after Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). |
||
|
Name:
Label: Page Size The maximum number of records to show. |
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| InventoryItemId |
DT_I8
|
bigint
|
||
| LocationId |
DT_I8
|
bigint
|
||
| UpdatedAt |
DT_DBTIMESTAMP
|
datetime
|
||
| Available |
DT_I4
|
int
|
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | 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 or in API Destination SSIS Data Flow components to read or write data.
API Source
This Endpoint belongs to the InventoryLevels table, therefore it is better to use it, instead of accessing the endpoint directly:
| Optional Parameters | |
|---|---|
| inventory_item_ids | |
| location_ids | |
| Updated at or after | |
API Destination
This Endpoint belongs to the InventoryLevels table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to get inventory levels:
| 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')
get_inventory_levels endpoint belongs to
InventoryLevels
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:
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];
get_inventory_levels endpoint belongs to
InventoryLevels
table(s), and can therefore be used via those table(s).