Skip to content

Parts catalog

Generated at build time from packages/core/src/operations/parts.ts. Every operation below isPOST /v1/ops/{name} over HTTP, env.API.invoke(actor, name, input) over RPC, and, when staff may call it, an MCP tool. See the API overview for authentication and errors.

Search the parts catalog

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
parts_search

Search the Master Parts List by part number or description, optionally only parts that fit a model. Each part shows price, the date of the price list it came from, a stale flag when that price is older than the current list, stock on hand and whether it is low.

Input (object)

FieldTypeDescription
querystringPart number or words from the descriptionmax length 200
fitsModelstringFor example Model 300max length 100
categorystringmax length 100
staleOnlybooleandefault false
lowStockOnlybooleandefault false
inStockOnlybooleandefault false
activeOnlybooleandefault true
sort"part_number" | "description" | "on_hand" | "price"default "part_number"
limitintegerMaximum rows to return (default 50, max 500)default 50, min 1, max 500
offsetintegerRows to skip, for pagingdefault 0, min 0, max 9007199254740991

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
totalrequiredintegerTotal rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991
limitrequiredintegermin -9007199254740991, max 9007199254740991
offsetrequiredintegermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts.search \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "query": {
        "description": "Part number or words from the description",
        "type": "string",
        "maxLength": 200
      },
      "fitsModel": {
        "description": "For example Model 300",
        "type": "string",
        "maxLength": 100
      },
      "category": {
        "type": "string",
        "maxLength": 100
      },
      "staleOnly": {
        "default": false,
        "type": "boolean"
      },
      "lowStockOnly": {
        "default": false,
        "type": "boolean"
      },
      "inStockOnly": {
        "default": false,
        "type": "boolean"
      },
      "activeOnly": {
        "default": true,
        "type": "boolean"
      },
      "sort": {
        "default": "part_number",
        "type": "string",
        "enum": [
          "part_number",
          "description",
          "on_hand",
          "price"
        ]
      },
      "limit": {
        "default": 50,
        "description": "Maximum rows to return (default 50, max 500)",
        "type": "integer",
        "minimum": 1,
        "maximum": 500
      },
      "offset": {
        "default": 0,
        "description": "Rows to skip, for paging",
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "category": {
              "type": [
                "string",
                "null"
              ]
            },
            "unit": {
              "type": "string",
              "description": "Unit of measure, for example each, ft, set"
            },
            "priceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "priceListDate": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Date of the price list this price comes from"
            },
            "isStale": {
              "type": "boolean",
              "description": "True when the price is older than the current price list"
            },
            "fitsModels": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Machine models the part fits"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Stock on hand; changes only through stock movements"
            },
            "reorderPoint": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "reorderQuantity": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "isLow": {
              "type": "boolean",
              "description": "True when on hand is at or below the reorder point"
            },
            "binLocation": {
              "type": [
                "string",
                "null"
              ]
            },
            "recommendedSpare": {
              "type": "boolean",
              "description": "Recommended to keep on the customer's shelf"
            },
            "active": {
              "type": "boolean"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            }
          },
          "required": [
            "id",
            "partNumber",
            "description",
            "category",
            "unit",
            "priceCents",
            "priceListDate",
            "isStale",
            "fitsModels",
            "onHand",
            "reorderPoint",
            "reorderQuantity",
            "isLow",
            "binLocation",
            "recommendedSpare",
            "active",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        }
      },
      "total": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Total rows matching the filters, ignoring limit and offset"
      },
      "limit": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "offset": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      }
    },
    "required": [
      "items",
      "total",
      "limit",
      "offset"
    ],
    "additionalProperties": false
  }
}
            

parts.get

Get a part

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
parts_get

One part by id or part number, with its latest stock movements.

Input (object)

FieldTypeDescription
idstringRecord id (UUID)min length 1, max length 64
partNumberstringmax length 60

Output (object)

FieldTypeDescription
partrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
recentMovementsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
typerequired"receive" | "adjust" | "ship" | "return"
quantityrequiredintegerSigned change: positive adds stock, negative removes itmin -9007199254740991, max 9007199254740991
balanceAfterrequiredintegerStock on hand after this movementmin -9007199254740991, max 9007199254740991
reasonrequiredstring | null
partsOrderIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
unitCostCentsrequiredinteger | nullAmount in integer US cents (zero or more)min 0, max 9007199254740991
actorNamerequiredstring
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/parts.get \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "partNumber": {
        "type": "string",
        "maxLength": 60
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "part": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "partNumber": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure, for example each, ft, set"
          },
          "priceCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "priceListDate": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Date of the price list this price comes from"
          },
          "isStale": {
            "type": "boolean",
            "description": "True when the price is older than the current price list"
          },
          "fitsModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Machine models the part fits"
          },
          "onHand": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Stock on hand; changes only through stock movements"
          },
          "reorderPoint": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reorderQuantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "isLow": {
            "type": "boolean",
            "description": "True when on hand is at or below the reorder point"
          },
          "binLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "recommendedSpare": {
            "type": "boolean",
            "description": "Recommended to keep on the customer's shelf"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "partNumber",
          "description",
          "category",
          "unit",
          "priceCents",
          "priceListDate",
          "isStale",
          "fitsModels",
          "onHand",
          "reorderPoint",
          "reorderQuantity",
          "isLow",
          "binLocation",
          "recommendedSpare",
          "active",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "recentMovements": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "receive",
                "adjust",
                "ship",
                "return"
              ]
            },
            "quantity": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Signed change: positive adds stock, negative removes it"
            },
            "balanceAfter": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Stock on hand after this movement"
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "partsOrderId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "ticketId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unitCostCents": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "actorName": {
              "type": "string"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            }
          },
          "required": [
            "id",
            "partId",
            "partNumber",
            "type",
            "quantity",
            "balanceAfter",
            "reason",
            "partsOrderId",
            "ticketId",
            "unitCostCents",
            "actorName",
            "createdAt"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "part",
      "recentMovements"
    ],
    "additionalProperties": false
  }
}
            

parts.upsert

Create or update a part

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
parts_upsert

Add a part to the catalog or change one (matched by id, else by part number, which is unique). Stock on hand cannot be set here: use stock.receive or stock.adjust so the ledger stays complete.

Input (object)

FieldTypeDescription
idstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstringmin length 1, max length 60
descriptionrequiredstringmin length 1, max length 500
categorystring | nullmax length 100
unitstringdefault "each", max length 20
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDatestring (date)Defaults to the current price list date for new parts
fitsModelsstring[]default []
reorderPointintegerdefault 0, min 0, max 9007199254740991
reorderQuantityintegerdefault 0, min 0, max 9007199254740991
binLocationstring | nullmax length 60
recommendedSparebooleandefault false
activebooleandefault true

Output (object)

FieldTypeDescription
partrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
createdrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/parts.upsert \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"partNumber":"example","description":"example","priceCents":0}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "partNumber": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
      },
      "description": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
      },
      "category": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 100
          },
          {
            "type": "null"
          }
        ]
      },
      "unit": {
        "default": "each",
        "type": "string",
        "maxLength": 20
      },
      "priceCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "priceListDate": {
        "description": "Defaults to the current price list date for new parts",
        "type": "string",
        "format": "date",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
      },
      "fitsModels": {
        "default": [],
        "type": "array",
        "items": {
          "type": "string",
          "maxLength": 100
        }
      },
      "reorderPoint": {
        "default": 0,
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "reorderQuantity": {
        "default": 0,
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "binLocation": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "recommendedSpare": {
        "default": false,
        "type": "boolean"
      },
      "active": {
        "default": true,
        "type": "boolean"
      }
    },
    "required": [
      "partNumber",
      "description",
      "priceCents"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "part": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "partNumber": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure, for example each, ft, set"
          },
          "priceCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "priceListDate": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Date of the price list this price comes from"
          },
          "isStale": {
            "type": "boolean",
            "description": "True when the price is older than the current price list"
          },
          "fitsModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Machine models the part fits"
          },
          "onHand": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Stock on hand; changes only through stock movements"
          },
          "reorderPoint": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reorderQuantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "isLow": {
            "type": "boolean",
            "description": "True when on hand is at or below the reorder point"
          },
          "binLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "recommendedSpare": {
            "type": "boolean",
            "description": "Recommended to keep on the customer's shelf"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "partNumber",
          "description",
          "category",
          "unit",
          "priceCents",
          "priceListDate",
          "isStale",
          "fitsModels",
          "onHand",
          "reorderPoint",
          "reorderQuantity",
          "isLow",
          "binLocation",
          "recommendedSpare",
          "active",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "created": {
        "type": "boolean"
      }
    },
    "required": [
      "part",
      "created"
    ],
    "additionalProperties": false
  }
}
            

parts.update_price

Update a part price

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
parts_update_price

Set a new price for a part and stamp it with a price-list date (today's list by default), which clears the stale flag. Use this when confirming or correcting the 2020 prices from the old parts list.

Input (object)

FieldTypeDescription
idstringRecord id (UUID)min length 1, max length 64
partNumberstringmax length 60
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDatestring (date)Defaults to the current price list date

Output (object)

FieldTypeDescription
partrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
previousPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
previousPriceListDaterequiredstring (date)Date as YYYY-MM-DD
Example request
                curl https://api.cemco.app/v1/ops/parts.update_price \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"priceCents":0,"id":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "partNumber": {
        "type": "string",
        "maxLength": 60
      },
      "priceCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "priceListDate": {
        "description": "Defaults to the current price list date",
        "type": "string",
        "format": "date",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
      }
    },
    "required": [
      "priceCents"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "part": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "partNumber": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure, for example each, ft, set"
          },
          "priceCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "priceListDate": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Date of the price list this price comes from"
          },
          "isStale": {
            "type": "boolean",
            "description": "True when the price is older than the current price list"
          },
          "fitsModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Machine models the part fits"
          },
          "onHand": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Stock on hand; changes only through stock movements"
          },
          "reorderPoint": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reorderQuantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "isLow": {
            "type": "boolean",
            "description": "True when on hand is at or below the reorder point"
          },
          "binLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "recommendedSpare": {
            "type": "boolean",
            "description": "Recommended to keep on the customer's shelf"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "partNumber",
          "description",
          "category",
          "unit",
          "priceCents",
          "priceListDate",
          "isStale",
          "fitsModels",
          "onHand",
          "reorderPoint",
          "reorderQuantity",
          "isLow",
          "binLocation",
          "recommendedSpare",
          "active",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "previousPriceCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "previousPriceListDate": {
        "type": "string",
        "format": "date",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
        "description": "Date as YYYY-MM-DD"
      }
    },
    "required": [
      "part",
      "previousPriceCents",
      "previousPriceListDate"
    ],
    "additionalProperties": false
  }
}
            

parts.stale_prices

List parts with stale prices

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
parts_stale_prices

Parts whose price comes from a price list older than the current one (for example the 2020 Master Parts List), oldest first, with the count of all stale parts.

Input (object)

FieldTypeDescription
limitintegerMaximum rows to return (default 50, max 500)default 50, min 1, max 500
offsetintegerRows to skip, for pagingdefault 0, min 0, max 9007199254740991

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
totalrequiredintegerTotal rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991
limitrequiredintegermin -9007199254740991, max 9007199254740991
offsetrequiredintegermin -9007199254740991, max 9007199254740991
currentPriceListDaterequiredstring (date)Date as YYYY-MM-DD
Example request
                curl https://api.cemco.app/v1/ops/parts.stale_prices \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "limit": {
        "default": 50,
        "description": "Maximum rows to return (default 50, max 500)",
        "type": "integer",
        "minimum": 1,
        "maximum": 500
      },
      "offset": {
        "default": 0,
        "description": "Rows to skip, for paging",
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "category": {
              "type": [
                "string",
                "null"
              ]
            },
            "unit": {
              "type": "string",
              "description": "Unit of measure, for example each, ft, set"
            },
            "priceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "priceListDate": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Date of the price list this price comes from"
            },
            "isStale": {
              "type": "boolean",
              "description": "True when the price is older than the current price list"
            },
            "fitsModels": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Machine models the part fits"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Stock on hand; changes only through stock movements"
            },
            "reorderPoint": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "reorderQuantity": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "isLow": {
              "type": "boolean",
              "description": "True when on hand is at or below the reorder point"
            },
            "binLocation": {
              "type": [
                "string",
                "null"
              ]
            },
            "recommendedSpare": {
              "type": "boolean",
              "description": "Recommended to keep on the customer's shelf"
            },
            "active": {
              "type": "boolean"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            }
          },
          "required": [
            "id",
            "partNumber",
            "description",
            "category",
            "unit",
            "priceCents",
            "priceListDate",
            "isStale",
            "fitsModels",
            "onHand",
            "reorderPoint",
            "reorderQuantity",
            "isLow",
            "binLocation",
            "recommendedSpare",
            "active",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        }
      },
      "total": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Total rows matching the filters, ignoring limit and offset"
      },
      "limit": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "offset": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "currentPriceListDate": {
        "type": "string",
        "format": "date",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
        "description": "Date as YYYY-MM-DD"
      }
    },
    "required": [
      "items",
      "total",
      "limit",
      "offset",
      "currentPriceListDate"
    ],
    "additionalProperties": false
  }
}
            

List recommended spare parts for a model

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
parts_recommended_spares

The spare parts Cemco recommends a customer keeps on the shelf for a machine model (or for one machine), with price and stock on hand. Use it to build a spares quote.

Input (object)

FieldTypeDescription
modelstringmax length 100
machineIdstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
modelrequiredstring
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts.recommended_spares \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model":"example"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string",
        "maxLength": 100
      },
      "machineId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "category": {
              "type": [
                "string",
                "null"
              ]
            },
            "unit": {
              "type": "string",
              "description": "Unit of measure, for example each, ft, set"
            },
            "priceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "priceListDate": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Date of the price list this price comes from"
            },
            "isStale": {
              "type": "boolean",
              "description": "True when the price is older than the current price list"
            },
            "fitsModels": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Machine models the part fits"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Stock on hand; changes only through stock movements"
            },
            "reorderPoint": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "reorderQuantity": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "isLow": {
              "type": "boolean",
              "description": "True when on hand is at or below the reorder point"
            },
            "binLocation": {
              "type": [
                "string",
                "null"
              ]
            },
            "recommendedSpare": {
              "type": "boolean",
              "description": "Recommended to keep on the customer's shelf"
            },
            "active": {
              "type": "boolean"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            }
          },
          "required": [
            "id",
            "partNumber",
            "description",
            "category",
            "unit",
            "priceCents",
            "priceListDate",
            "isStale",
            "fitsModels",
            "onHand",
            "reorderPoint",
            "reorderQuantity",
            "isLow",
            "binLocation",
            "recommendedSpare",
            "active",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        }
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      }
    },
    "required": [
      "model",
      "items",
      "totalCents"
    ],
    "additionalProperties": false
  }
}
            

parts.deactivate

Retire a part

Kind
Write (audited)
Who
Staff: admin
MCP tool
parts_deactivate

Mark a part inactive so it no longer appears in searches or on new quotes. History is kept. Pass active true to bring it back.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
activebooleandefault false

Output (object)

FieldTypeDescription
partrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
categoryrequiredstring | null
unitrequiredstringUnit of measure, for example each, ft, set
priceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
priceListDaterequiredstring (date)Date of the price list this price comes from
isStalerequiredbooleanTrue when the price is older than the current price list
fitsModelsrequiredstring[]Machine models the part fits
onHandrequiredintegerStock on hand; changes only through stock movementsmin -9007199254740991, max 9007199254740991
reorderPointrequiredintegermin 0, max 9007199254740991
reorderQuantityrequiredintegermin 0, max 9007199254740991
isLowrequiredbooleanTrue when on hand is at or below the reorder point
binLocationrequiredstring | null
recommendedSparerequiredbooleanRecommended to keep on the customer's shelf
activerequiredboolean
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/parts.deactivate \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "active": {
        "default": false,
        "type": "boolean"
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "part": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "partNumber": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure, for example each, ft, set"
          },
          "priceCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "priceListDate": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Date of the price list this price comes from"
          },
          "isStale": {
            "type": "boolean",
            "description": "True when the price is older than the current price list"
          },
          "fitsModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Machine models the part fits"
          },
          "onHand": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Stock on hand; changes only through stock movements"
          },
          "reorderPoint": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reorderQuantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "isLow": {
            "type": "boolean",
            "description": "True when on hand is at or below the reorder point"
          },
          "binLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "recommendedSpare": {
            "type": "boolean",
            "description": "Recommended to keep on the customer's shelf"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "partNumber",
          "description",
          "category",
          "unit",
          "priceCents",
          "priceListDate",
          "isStale",
          "fitsModels",
          "onHand",
          "reorderPoint",
          "reorderQuantity",
          "isLow",
          "binLocation",
          "recommendedSpare",
          "active",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "part"
    ],
    "additionalProperties": false
  }
}