Skip to main content

Inventory Quantity Adjustment Experimental API usage

The following article demonstrates how to manage or retrieve inventory levels in our inventory management system.

Prerequisites

  1. An inventory item you want to adjust levels for.
  2. A location you want to adjust levels at.

Operations

You can take one of two approaches when setting inventory levels in ChannelApe's IMS. Operations determine which action is take upon the quantity you give the API.

  1. Set - Resets the quantity to the given quantity passed to the API. This is good for when you want to true-up on values you know are accurate at either the warehouse or channel. It's recommended you do this once a day if possible with your inventory levels prior to business hours so that your channels have accurate inventory levels.

  2. Adjust - This will perform a relative adjustment on the current inventory levels for the item. This operation is useful when you do not want to perform a reset and have activity during the day such as orders being placed and fulfilled. This is the default operation on the inventory adjustments API.

Setting an inventory items quantity

POST https://api.channelape.io/v1/inventory_item_quantity_adjustments

Request

{
"quantity": 10,
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"status": "available_to_sell",
"operation": "set",
"memo": "Morning Inventory True-up",
"external_ids": {
"SAP_ID": "123"
}
}

Response

[
{
"id": "ff7077f9-b656-45c1-8a64-c63b16c2b639",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"status": "available_to_sell",
"quantity": 10,
"adjustment_time": "2023-11-08T18:03:42.185135+00:00",
"memo": "Morning Inventory True-up",
"operation": "set",
"creation_time": "2023-11-08T18:03:42.185135+00:00",
"update_time": null,
"external_ids": {
"SAP_ID": "123"
},
"sub": "2f8da7d7-2fed-4f27-968d-e721cd87ff6b"
}
]

Adjusting an inventory items quantity

Request

{
"quantity": 10,
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"status": "available_to_sell",
"operation": "adjust",
"memo": "Morning Inventory True-up",
"external_ids": {
"SAP_ID": "123"
}
}

Response

[
{
"id": "ff7077f9-b656-45c1-8a64-c63b16c2b639",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"status": "available_to_sell",
"quantity": 10,
"adjustment_time": "2023-11-08T18:03:42.185135+00:00",
"memo": "Morning Inventory True-up",
"operation": "set",
"creation_time": "2023-11-08T18:03:42.185135+00:00",
"update_time": null,
"external_ids": {
"SAP_ID": "123"
},
"sub": "2f8da7d7-2fed-4f27-968d-e721cd87ff6b"
}
]

Note: sub is a read only field. This is the user or API account ID who made the adjustment.

Retrieving current quantities for an item

To get the current quantities for an item at a location

Note: That this will eventually fold into the inventory_item_current_quantities API, but for now if you are using these experimental API's then should use this endpoint to get your current quantities. They both share the same interface.

GET https://api.channelape.io/v1/inventory_item_current_quantities_live?location_id=eq.549e5287-fe45-4f59-b4e7-43e572c89af1&inventory_item_id=eq.82f1240a-af04-4c74-99d0-069f8d317f52&business_id=eq.6bd4e7ba-b250-443a-95e7-f83ce291e107

Response

[
{
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"available_to_sell": 10,
"committed": 2,
"on_hand": 0,
"on_hold": 5,
"on_order": -2,
"reserve": 0,
"incoming": -2,
"unavailable": 0,
"available_to_promise": 6,
"sku": "DK6K92K",
"title": "Recycled Plastic Soap",
"location": "Dare - Turner platforms",
"location_legacy_id": null,
"inventory_item_legacy_id": null
}
]

Retrieving adjustment history for an item at a location

GET https://api.channelape.io/v1/inventory_item_quantity_adjustments?location_id=eq.549e5287-fe45-4f59-b4e7-43e572c89af1&inventory_item_id=eq.82f1240a-af04-4c74-99d0-069f8d317f52&business_id=eq.6bd4e7ba-b250-443a-95e7-f83ce291e107&order=adjustment_time.desc

Response

[
{
"id": "ff7077f9-b656-45c1-8a64-c63b16c2b639",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"status": "available_to_sell",
"quantity": 10,
"adjustment_time": "2023-11-08T18:03:42.185135+00:00",
"memo": "Morning Inventory True-up",
"operation": "set",
"creation_time": "2023-11-08T18:03:42.185135+00:00",
"update_time": null,
"external_ids": {
"SAP_ID": "123"
},
"sub": "2f8da7d7-2fed-4f27-968d-e721cd87ff6b"
},
{
"id": "54fe0a81-1c43-4ed4-b0fe-f3c8c3fcfba7",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"status": "available_to_sell",
"quantity": 10,
"adjustment_time": "2023-11-08T18:01:47.757321+00:00",
"memo": null,
"operation": "set",
"creation_time": "2023-11-08T18:01:47.757321+00:00",
"update_time": null,
"external_ids": null,
"sub": "2f8da7d7-2fed-4f27-968d-e721cd87ff6b"
},
{
"id": "c817feb1-7522-4e9c-bff1-a294ff283154",
"inventory_item_id": "82f1240a-af04-4c74-99d0-069f8d317f52",
"location_id": "549e5287-fe45-4f59-b4e7-43e572c89af1",
"business_id": "6bd4e7ba-b250-443a-95e7-f83ce291e107",
"status": "available_to_sell",
"quantity": 10,
"adjustment_time": "2023-11-08T18:01:26.334979+00:00",
"memo": null,
"operation": "adjust",
"creation_time": "2023-11-08T18:01:26.334979+00:00",
"update_time": null,
"external_ids": null,
"sub": "2f8da7d7-2fed-4f27-968d-e721cd87ff6b"
}
]
info

Inventory Adjustments on this API are in Preview. Please use the legacy inventory adjustments API for inventory adjustments. Reach out to support to enable access to this Inventory Adjustments API for your organization.