Inventory

GET /api/inventory/

List all inventory points. :returns: an object mapping InventoryPoint ID to InventoryPoint object

GET /api/inventory/(int: inv_pt_id)

Get a single inventory point.

PUT /api/inventory/

Create a new inventory point.

Request JSON Object:
  • name (string) – name for the new inventory point

Status Codes:
PATCH /api/inventory/(int: inv_pt_id)

Edit an existing inventory point. The request body is a (partial) InventoryPoint object.

Status Codes:
DELETE /api/inventory/(int: inv_pt_id)

Delete an existing inventory point.

Status Codes:
POST /api/inventory/(int: ipt_id)/import

Import tool quantities to a specified inventory point from an uploaded CSV or XLSX file.

Spreadsheet layout rules:

  • The first row must contain column headers.

  • The “quantity” (or “qty”) column is required.

  • At least one column of “name” (or “item”) and “part number” (or “barcode”) are required.

  • The order of columns does not matter.

  • Column headers are not case-sensitive.

  • Inventory items can be matched either name and/or part number.

Row handling rules:

  • If no existing inventory item matches a row’s name and/or part number, the row information will be listed as an object in the not_matched array in the response.

  • Items present in the inventory point but not in the spreadsheet will not be changed.

  • Items present in both the inventory point and the spreadsheet will have their quantity in the inventory point updated to match the spreadsheet.

  • Items present in the spreadsheet but not the inventory point will be added to the inventory point with the quantity specified in the spreadsheet.

Parameters:
  • ipt_id – ID of the inventory point to import to

Status Codes:
Response JSON Array of Objects:
  • not_matched – list of rows that did not match an inventory item. Empty means all were matched.

Ordering

GET /api/inventory/ordering/items

Get a list of inventory items.

Query Parameters:
  • tools (boolean) – set to include the tools associated with each item in the results

  • active_machine (int) – set to a machine ID to get only items that are used by tools assigned to the machine’s currently active process

Status Codes:
  • 400 Bad Request – if the machine parameter is set but is not a valid machine ID

Returns:

A JSON object of all items.

POST /api/inventory/ordering/items

Create a new inventory item.

Reqjson:

partial inventory item object to create (name is required)

Returns:

the new inventory item

Status Codes:
PATCH /api/inventory/ordering/items/(int: item_id)

Edit an existing inventory item.

Request JSON Object:
  • name (string) – new name for the item

  • price (float) – new price for the item

  • qty_on_order (int) – new quantity on order for the item

Request JSON Array of Objects:
  • suppliers – new suppliers list to set

Parameters:
  • item_id – The ID of the inventory item to modify

Returns:

the modified item object

Status Codes:
DELETE /api/inventory/ordering/items/(int: item_id)

Delete an inventory item.

Parameters:
  • item_id – The ID of the item to delete

Status Codes:
POST /api/inventory/ordering/orderInfo

Calculate how many items are consumed each day for each item.

The request body may contain processes to limit the calculations to only the selected processes. Otherwise, it is assumed that all currently-active processes will be running.

Request JSON Array of Objects:
  • processes (int) – list of process IDs that will be running

Status Codes:
  • 400 Bad Request – if the cycle time is not defined for one of the selected programs

Returns:

an object whose keys are inventory IDs, each mapping to an object with a process and/or maintenance property, which map the ID of a Process or MaintenanceItem to the number of the inventory item consumed per day by that process or maintenance item. See the returned data sample below:

POST /api/inventory/ordering/generateOrder

Create an order sheet with the selected inventory items and quantities.

Reqjson:

an object mapping InventoryItem ID -> quantity to order

Status Codes:
  • 400 Bad Request – if the IDs are not provided or not provided correctly

Returns:

a XLSX file download

POST /api/inventory/ordering/markOnOrder

Add an on-order quantity to the given items.

The POST body should be a JSON object whose keys are inventory item IDs each pointing to a value representing the number to add to that item’s on-order count.

Returns:

a JSON object containing all affected items

POST /api/inventory/ordering/items/(int: item_id)/receiveOrder

Adds received quantities of a single inventory item to multiple inventory points and removes the received quantity from the item’s on-order quantity.

If any keys of the request object are not valid inventory point IDs, the error response will contain a missing_inventory_points key with a list of the invalid IDs.

Reqjson:

object mapping inventory point ID to quantity received

Parameters:
  • item_id – ID of the inventory item being received

Status Codes:
  • 404 Not Found – if the inventory item does not exist

  • 400 Bad Request – if the request body is missing or invalid, or contains an invalid inventory point ID