Reference

Endpoint Get Inventory Levels


Name

get_inventory_levels

Description

Gets inventory level for a specific location and inventory item. [API reference]

Related Tables

InventoryLevels

Parameters

Parameter Required Options
Name: inventory_item_ids

Label: inventory_item_ids

Inventory Item Id(s) - Comma separated
Name: location_ids

Label: location_ids

Location Id(s) - Comma separated
Name: updated_at_min

Label: Updated at or after

Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00).
Name: limit

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
If the column you are looking for is missing, consider customizing Shopify Connector.

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:

API Source - 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
InventoryLevels
Optional Parameters
inventory_item_ids
location_ids
Updated at or after
SSIS API Source - Read from table or endpoint

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:

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
InventoryLevels
Select
Optional Parameters
inventory_item_ids
location_ids
Updated at or after
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Get inventory levels for all locations

Query inventory levels for all locations. If you get URL Too long error then manually supply location ids in the query (see other example)

select * from InventoryLevels 
		--WITH(location_ids='43512280416356, 44648752676964, ..... upto 300 to 500 more - until you hit URL limit error')

Get inventory level for multiple item inventory id(s)

If you get URL Too long error then reduce inventory_item ids in the query (approx 300-400 ids per call allowed)

select * from InventoryLevels WITH (inventory_item_ids='43512280416356, 44648752676964')

Get inventory level for specific location id(s) (i.e. Physcical Store / POS )

If you get URL Too long error then reduce location ids in the query (approx 300-400 ids per call allowed)

select * from InventoryLevels WITH (location_ids='43512280416356, 44648752676964')

Get inventory level for specific inventory / location id(s)

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:

Get inventory levels for all locations

Query inventory levels for all locations. If you get URL Too long error then manually supply location ids in the query (see other example)

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];

Get inventory level for multiple item inventory id(s)

If you get URL Too long error then reduce inventory_item ids in the query (approx 300-400 ids per call allowed)

DECLARE @MyQuery NVARCHAR(MAX) = 'select * from InventoryLevels WITH (inventory_item_ids=''43512280416356, 44648752676964'')';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

Get inventory level for specific location id(s) (i.e. Physcical Store / POS )

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 InventoryLevels WITH (location_ids=''43512280416356, 44648752676964'')';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

Get inventory level for specific inventory / location id(s)

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