Inventory Point

Model

class pytm4srv.models.InventoryPoint
items: dict[int, int]

Maps inventory item IDs to the quantity stored in the inventory point.

id: MappedColumn object at 0x7e2fe7159d80>]]

Unique, numeric ID for this inventory point in OnTakt.

name: Mapped[str]

Name of this inventory point.

Endpoints

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.