InventoryStockedItemsRemove
This entity enables you to decrease inventory counts associated with the InventoryProducts entity.
NOTE You can refer to the Online Help to find root and child access URLs of the entity you wish to query. Refer to Finding resource and child access URLs of REST API entities for more information.
Entity details
Entity Name: | InventoryStockedItemsRemove |
Entity Path: |
/atservicesrest/v1.0/InventoryStockedItemsRemove |
Can Create: | |
Can Update: | |
Can Query: | |
Can Delete: | |
Can Have UDFs: |
IMPORTANT Requests to this entity require special handling. Refer to the Entity URLs and relationships section of this article for details.
- If this entity has a Parent relationship, you must perform all Create, Update, and Delete actions on the parent entity.
- If this entity is a child of a parent, you can leverage our Swagger instance to find the URLs you should use in your API calls. For more information, refer to Finding resource and child access URLs of REST API entities.
- To learn how to access Swagger, refer to Using Swagger UI to explore REST API requests.
Parent | InventoryProducts |
Children | None |
URLs | InventoryStockedItemsRemove (POST) InventoryStockedItemsRemove/entityInformation (GET) InventoryStockedItemsRemove/entityInformation/fields (GET) |
Fields that cannot be queried
This entity supports Create requests only. All fields will return errors if queried.
Conditions and requirements
General
-
Create actions will cause the inventoryStockedItems.onHandUnits value to be recalculated.
-
For serialized items, Create calls only update the onHandUnits value to 0 and change the removedUnits value to 1.
-
Changes to serialized items do not create new entries in inventoryStockedItems.
-
To remove a specific serial number, query the inventoryStockItems for that serial number and use the resulting inventoryStockItems.ID for the removal call.
-
It is not possible to remove Reserved, Picked, Delivered or Removed units.
-
inventoryProducts cannot be deleted if the reservedUnits or pickedUnits values are greater than 0.
-
Following the release of Autotask 2022.1, it is no longer possible to update the quantity on hand of an inventory product. The field is now calculated based on the stocked items as follows:
-
To increase the quantity on hand of a product in inventory, you'll need to send a Create request to the InventoryStockedItemsAdd endpoint for the product to increase.
-
For serialized items, each serial number requires a new Create request against InventoryStockedItemsAdd. Only one serial number can exist per row.
-
-
To decrease the quantity on hand of a product in inventory, you'll need to send an Update request to the InventoryStockedItemsRemove endpoint for the product to decrease.
-
If the product is serialized, you'll need to query InventoryStockedItems for the serial number. Set the quantityOnHand value to 0 and the quantityRemoved value to 1. If required, reasonForUpdate must also be included.
-
If the product is not serialized, query InventoryStockedItems for the product associated with the inventory location. The query may return multiple rows. Decide which of the resulting rows will be updated. We recommend reducing the quantity from the oldest item.
-
-
For serialized items, the sum of onHandUnits, reservedUnits, transferredUnits, removedUnits, pickedUnits, and deliveredUnits will always equal 1.
-
For non-serialized items, the sum of onHandUnits, reservedUnits, transferredUnits, removedUnits, pickedUnits, and deliveredUnits is always equal to the value of the purchaseOrderItemReceiving.quantityPreviouslyReceived field.
-
-
To determine the original received quantity, query the PurchaseOrderItemReceiving entity.
Special field attributes
Field | Conditions and Requirements |
---|---|
inventoryProductID | This field can only be used for non-serialized items. |
inventoryProductID and inventoryStockedItemID |
Only one of these fields can have a value at a time, and one of them is required. You can decide to remove from inventory product level or a specific stock item.
|
quantityBeingRemoved | For serialized items, this value cannot be greater than 1. For non-serialized items, the value cannot be greater than Available Units of the inventoryStockedItem from which you are removing quantity. |
reasonForUpdate | This field is required if the system setting "Require/prompt users to enter a reason when manually updating an inventory item’s On Hand quantity, or when canceling receipt of a purchase order item" is enabled. |
Guidelines for removing inventory
You'll need to query InventoryStockedItems first to get the ID from which you want to remove stocked items. Generally, if there is more than one ID from which you can remove, you should remove quantity from the oldest ID first. If you need to remove more units than are available in one stockedItemsID you will need to run this call multiple times.
Example
You have 40 mice in inventory. You query InventoryStockedItems for HP Mouse by productID and the call returns four lines (with four different IDs), indicating that in the past, you purchased mice on four different occasions (and maybe at different prices). All four entries still have the following remaining stock:
ID 123 Qty Available: 5 Received: 15 on 1-1-2019
ID 223 Qty Available: 10 Received: 10 on 5-6-2020
ID 721 Qty Available: 20 Received: 20 on 9-8-2020
ID 1023 Qty Available: 5 Received: 5 on 2-9-2021
If you want to remove 20 from stock, you could
-
remove five from ID 123, then remove 10 from 223, then remove five from 721; or
-
remove 10 from ID 223, then remove 10 from 223; or
-
remove 20 from ID 721.
We recommend the first approach, as it removes the oldest inventory first.
If you want to remove 20 from Product, you can
-
remove 20 from inventoryProduct ID 1234.
Field definitions
The following table describes the standard Autotask fields for this entity. Refer to the following articles for more information about working with these fields:
- The entityInformation REST API call
- Making basic query calls to the REST API
- Advanced query features of the REST API
To learn how to query picklist endpoints, refer to Understanding picklists.
Notes
- For string datatypes, the number in parentheses ( ) indicates the maximum number of characters allowed.
- LT indicates Local Term.
- If this entity has child collections, they will appear in a Child collection access URLs or an Entity URLs and relationships drop-down in the Entity details section of this article.
- You can call the /query/count/ endpoint of a resource to determine how many records a collection holds.
Field Name | Datatype | Read-Only | Is Required | Reference Name | Picklist |
---|---|---|---|---|---|
id | long | ||||
inventoryStockedItemID | integer | InventoryStockedItems | |||
inventoryProductID | integer | InventoryProducts | |||
quantityBeingRemoved | integer | ||||
reasonForUpdate | string (500) |