InventoryLevels
Query, create, and update information regarding different inventory levels.
Table-Specific Information
Select
To query this table InventoryItemId, LocationId or both should be specified. The supported SQL operators are '=' and 'IN'. The adapter processes other filters client-side within the adapter.
For example, the following queries are processed server-side:
SELECT * FROM InventoryLevels WHERE InventoryItemId = '123'
SELECT * FROM InventoryLevels WHERE InventoryItemId = '123' AND LocationId = '456'
SELECT * FROM InventoryLevels WHERE InventoryItemId IN ('123', '456') AND LocationId IN ('123', '456')
Insert
-
Adjust the available quantity of an inventory item at a single location:
INSERT INTO InventoryLevels (InventoryItemId, LocationId, Available, Operation) VALUES (534169354263, 1448280087, 5, 'Adjust')
-
Connects an inventory item to a location by creating an inventory level at that location:
INSERT INTO InventoryLevels (InventoryItemId, LocationId, Operation) VALUES (534169354263, 4484497431, 'Connect')
-
Sets the inventory level for an inventory item at a location:
INSERT INTO InventoryLevels (InventoryItemId, LocationId, Available, Operation, DisconnectIfNecessary) VALUES (534169354263, 4484497431, 42, 'Set', true)
Delete
You must specify the InventoryItemId and LocationId to delete an inventory level of an inventory item at a location.
DELETE FROM InventoryLevels WHERE InventoryItemId = '153681943' AND LocationId = '45678'
Columns
Name | Type | ReadOnly | References | Description |
InventoryItemId [KEY] | Long | False |
The ID of the inventory item that the inventory level belongs to. | |
LocationId [KEY] | Long | False |
Locations.Id |
The ID of the location that the inventory level belongs to. To find the ID of the location, use the Locations view. |
Available | Int | False |
The quantity of inventory items available for sale. Returns null if the inventory item is not tracked. | |
UpdatedAt | Datetime | True |
The date and time (ISO 8601 format) when the inventory level was last modified. | |
Operation | String | False |
An operation to apply to the InventoryLevel. Valid values for order: adjust, connect, set. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements, to offer a more granular control over the tuples that are returned from the data source, or as parameters in INSERT statements.
Name | Type | Description |
RelocateIfNecessary | Bool |
Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. Used in insertions. |
DisconnectIfNecessary | Bool |
Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. Used in insertions. |