Endpoint Update Inventory Levels
Name
put_inventory_level
Description
Related Tables
Parameters
| Parameter | Required | Options | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: Action |
YES |
|
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 |
|---|---|---|---|---|
| InventoryItemId |
DT_I8
|
bigint
|
||
| LocationId |
DT_I8
|
bigint
|
||
| AvailableAdjustment |
DT_I4
|
int
|
||
| Available |
DT_I4
|
int
|
Examples
SSIS
Use Shopify Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
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 update inventory levels:
| Required Parameters | |
|---|---|
| Action | Fill-in the parameter... |
| Optional Parameters | |
| ContineOn404Error | False |
ODBC application
Use these SQL queries in your ODBC application data source:
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
)
put_inventory_level 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:
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];
put_inventory_level endpoint belongs to
InventoryLevels
table(s), and can therefore be used via those table(s).