Update Active Inventory

The update_active_inventory API allows you to adjust the inventory quantity in an active location for a specific item. Only a single location and item may be updated per request.
Note: This is a new API meant to replace the existing legacy `update_active_inventory` API. The legacy API will eventually be retired so no further enhancements will be made to it. New functionality will instead be added to this API as part of the lgfapi suite.

Regardless of the method used to identify the location, the following input is valid:

Category Name Type Required Description
options item_barcode String C Item identifier.
options item_code String C Item identifier.
options item_alternate_code String C Item identifier.
options adjustment_qty Numeric C Non-zero adjustment quantity.
options actual_qty Numeric C Non-negative final quantity.
options batch_nbr String N Batch tied to target inventory.
options expiry_date Date N Expiration date tied to target inventory.
options invn_attr_X String N Attributes A-O tied to the inventory.
options reason_code String Y Recorded on inventory history.
options transaction_ref_nbr String N Recorded on inventory history.
options locn_capacity_check_flg Boolean N Validate locations max units and volume?
options company_id Integer N Item’s company.
options company_code String N Item’s company’s code.
  • Only one of `item_barcode`, `item_code`, or `item_alternate_code` is allowed.
  • Only one of `actual_qty` or `adjustment_qty` is allowed.
  • If positive change in quantity:
    • The provided `batch_nbr` will be created if it does not exist.
  • Only one of `company_id` or `company_code` is allowed.
    • Although not required by the API, the company context may be necessary if there is ambiguity when identifying the item to adjust. This is common in 3PL scenarios where the same identifying information may be present for different items across companies for which the user is eligible.

Location Lookup by ID

POST .../entity/location/{id}/update_active_inventory/

The caller knows the unique `id` value of the active location, which is added to the request URL. No additional `parameters` data is required from the request body.

Location Lookup by Filters

POST .../entity/location/update_active_inventory/
Category Name Type Required Description
parameters barcode String Y Location’s barcode.
parameters facility_id Integer N Location’s facility.
  • Only a single location may be updated per request.
    • The `__in` lookup is not supported for `barcode`.
  • `facility_id` supports string lookup by `code` using the double-underscore notation:
    • facility_id__code
Example Request Body:
{
"parameters": {
"facility_id__code": "FAC-1",
"barcode": "LOCN1"
},
"options": {
"item_barcode": "ITEM1234",
"adjustment_qty": -10,
"batch_nbr": "BATCH1234",
"expiry_date": "2020-01-02",
"invn_attr_a": "A",
"invn_attr_b": "B",
"reason_code": "RC",
"transaction_ref_nbr": "TX123457890",
"company_code": "COM-1"
}
}

Serial Number Tracked Items

This API also accepts serial numbers to cater to serial number tracked items or SKUs.

For positive adjustments, the serial numbers sent can be:

  • New serial numbers (or)
  • Serial numbers existing in the warehouse that are delinked and not associated with any other inventory

For negative adjustments, the serial numbers sent should be the ones that are already present in the location where inventory is being updated.

The following is an example request for serial number adjustments:

{

"parameters": {

"facility_id code": "FAC-1", "barcode": "LOCN1"

},

"options": {

"item_barcode": "ITEM1234", "adjustment_qty": -3, "batch_nbr": "BATCH1234",
        "invn_attr_a": "A",

"invn_attr_b": "B",

"reason_code": "RC", "transaction_ref_nbr": "TX123457890", "serial_nbr_list":
        [

"SrlNbr1", "SrlNbr2", "SrlNbr3"

]

}

}