Perform an operation on an Item

POST /items/:id/:action

Status codes

  • 200 on success
  • 400 on invalid request
  • 404 on item not found

Path parameters

  • id: The item id.
  • action: One of deactivate, activate, delete, restore.
deactivate

This operation will set the archived timestamp to now. This also removes the item from the list of active items and place it on the list of archived ones. If the item is already deleted, then it stays in the deleted items list and remains deleted.

activate

This operation will remove the archived timestamp and move the item to the active items list. If the item is already deleted, then it stays in the deleted items list and remains deleted.

delete

This operation will set the deleted timestamp to now. This in turn makes the item only appear in the deleted items list.

restore

This operation will remove the deleted timestamp and move the item back to the active/archived items list. If the item was also deactivated, restore won't activate it automatically.

Response properties

The response is the details of the item after the operation.

You can see all the Item properties on the GET /items/:id page under "Response properties".

Example response

{
  "id": "itm_oh0IyIjqvd",
  "category": "cat_KaNDv51Gh0",
  "name": "Vodka",
  "vessel": {
    "size": 7,
    "unit": "dl",
    "type": "BO"
  },
  "bundles": [
    {
      "type": "CT",
      "size": 6
    }
  ],
  "price": 750,
  "supplier": {
    "id": 1693919950079,
    "reference": "1100992"
  },
  "archived": 1701262121920,
  "deleted": 1701269851094
}