Return to documentation index

inventory_activities

The inventory_activities API is used exclusively to send inventory activities from the iPad to the portal. Retrieving inventory activities has been deprecated since the release of v4.6 (internal version 80) of the Tastevin iOS client.

Parameters

The server expects a HTTP POST with a single top-level "inventory_activities" array, which contains objects with attributes:

  • adjustment (float) - the amount of inventory to be added/subtracted from the beverage_skus inventory levels.
  • adjustment_type (int) - must be the integer 2, to identify to the server that the client is an iPad.
  • beverage_sku_id (int) - the unique identifier for the beverage_sku affected by this inventory activity
  • beverage_sku_status (int) (optional) - a flag that allows the iOS client to change the status of a beverage_sku. Must be either 0 (active) or 2 (stocked) if supplied.
  • client_id (string) - a unique string meant for the client to identify successfully committed inventory activities. See the Response section for a description of usage.
  • computer_count (float) (optional) - New 'zero-based' inventory count for the beverage SKU. When this attribute is supplied, the portal will calculate an inventory adjustment that takes the current inventory of the SKU to this number. NOTE: If both adjustment and computer_count are supplied, adjustment is ignored.
  • price (float) (optional) - Price in dollars and cents to set for the beverage SKU. NOTE: values of null or empty will be ignored.
  • bin_number (string) (optional) - Bin number to set for the beverage SKU. NOTE: values of null or empty will be ignored.
  • par (integer) (optional) - Par value to set for the beverage SKU. NOTE: values of null or empty will be ignored.
  • cogs (float) (optional) - Wholesale price in dollars and cents to set for the beverage SKU. NOTE: values of null or empty will be ignored.

Sample POST

{ "inventory_activities": [ { "adjustment": -2.4, "adjustment_type": 2, "beverage_sku_id": 15235, "beverage_sku_status": 0, "client_id": "123456" }, { "adjustment": 12, "adjustment_type": 2, "beverage_sku_id": 15236, "beverage_sku_status": 2, "client_id": "abcdef" } ] }

Response

The portal responds with a list of client_ids, representing the inventory activities that, which correspond to the client_id attribute given in the original POST payload

It is understood that any client_ids that were not echoed by the server have not succeeded in being committed, and should therefore be retried.

Example Response:

{ "inventory_activities": [ "123456", "abcdef" ] }

Important Notes on Updated Inventory Counts

The response from the server does not give any indication of the final updated count of a particular SKU after the inventory update has occurred. This could be due to the fact that other updates could have occurred concurrently, or that the iOS client has been kept out of sync with the server for some time.

Rely instead on the /wine_list, /beer_list, and /spirit_list APIs to retrieve canonical versions of inventory levels (via the "computer_count" attribute)