Skip to content

Parts quotes and orders

Generated at build time from packages/core/src/operations/parts_orders.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.

parts_orders.list

List parts quotes and orders

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

Parts quotes and parts orders with filters for account, status and machine. A quote is a parts order with status quote.

Input (object)

FieldTypeDescription
accountIdstringRecord id (UUID)min length 1, max length 64
machineIdstringRecord id (UUID)min length 1, max length 64
ticketIdstringRecord id (UUID)min length 1, max length 64
status"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
openbooleantrue for quote, ordered and shipped; false for delivered and cancelled
querystringMatches order number, tracking number, customer PO or account namemax length 200
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
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
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_orders.list \
  -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": {
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "machineId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "ticketId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "open": {
        "description": "true for quote, ordered and shipped; false for delivered and cancelled",
        "type": "boolean"
      },
      "query": {
        "description": "Matches order number, tracking number, customer PO or account name",
        "type": "string",
        "maxLength": 200
      },
      "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)"
            },
            "orderNumber": {
              "type": "string"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "contactId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "machineId": {
              "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"
                }
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "quote",
                "ordered",
                "shipped",
                "delivered",
                "cancelled"
              ]
            },
            "subtotalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "shippingCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "taxCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "quotedOn": {
              "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"
            },
            "quoteValidUntil": {
              "anyOf": [
                {
                  "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"
                },
                {
                  "type": "null"
                }
              ]
            },
            "orderedOn": {
              "anyOf": [
                {
                  "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"
                },
                {
                  "type": "null"
                }
              ]
            },
            "shippedOn": {
              "anyOf": [
                {
                  "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"
                },
                {
                  "type": "null"
                }
              ]
            },
            "deliveredOn": {
              "anyOf": [
                {
                  "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"
                },
                {
                  "type": "null"
                }
              ]
            },
            "carrier": {
              "type": [
                "string",
                "null"
              ]
            },
            "trackingNumber": {
              "type": [
                "string",
                "null"
              ]
            },
            "shipToName": {
              "type": [
                "string",
                "null"
              ]
            },
            "shipToAddress": {
              "type": [
                "string",
                "null"
              ]
            },
            "customerPo": {
              "type": [
                "string",
                "null"
              ]
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            },
            "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"
            },
            "accountName": {
              "type": "string"
            },
            "lineCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "id",
            "orderNumber",
            "accountId",
            "contactId",
            "machineId",
            "ticketId",
            "status",
            "subtotalCents",
            "shippingCents",
            "taxCents",
            "totalCents",
            "quotedOn",
            "quoteValidUntil",
            "orderedOn",
            "shippedOn",
            "deliveredOn",
            "carrier",
            "trackingNumber",
            "shipToName",
            "shipToAddress",
            "customerPo",
            "notes",
            "createdAt",
            "updatedAt",
            "accountName",
            "lineCount"
          ],
          "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_orders.get

Get a parts quote or order

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
parts_orders_get
In-chat view
ui://cemco/parts-order.html

One parts order by id or order number with its lines, totals, status dates, carrier and tracking number.

Input (object)

FieldTypeDescription
idstringRecord id (UUID)min length 1, max length 64
orderNumberstringmax length 40

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.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)"
      },
      "orderNumber": {
        "type": "string",
        "maxLength": 40
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "orderNumber": {
        "type": "string"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "subtotalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "quotedOn": {
        "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"
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "orderedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "deliveredOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "carrier": {
        "type": [
          "string",
          "null"
        ]
      },
      "trackingNumber": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToName": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToAddress": {
        "type": [
          "string",
          "null"
        ]
      },
      "customerPo": {
        "type": [
          "string",
          "null"
        ]
      },
      "notes": {
        "type": [
          "string",
          "null"
        ]
      },
      "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"
      },
      "accountName": {
        "type": "string"
      },
      "lineCount": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partsOrderId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Current stock of the part, for the quote builder"
            }
          },
          "required": [
            "id",
            "partsOrderId",
            "partId",
            "partNumber",
            "description",
            "quantity",
            "unitPriceCents",
            "totalCents",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "id",
      "orderNumber",
      "accountId",
      "contactId",
      "machineId",
      "ticketId",
      "status",
      "subtotalCents",
      "shippingCents",
      "taxCents",
      "totalCents",
      "quotedOn",
      "quoteValidUntil",
      "orderedOn",
      "shippedOn",
      "deliveredOn",
      "carrier",
      "trackingNumber",
      "shipToName",
      "shipToAddress",
      "customerPo",
      "notes",
      "createdAt",
      "updatedAt",
      "accountName",
      "lineCount",
      "lines"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.create

Start a parts quote

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

Create a parts quote for an account, optionally tied to a machine or service ticket, with its first lines. It starts at status quote; nothing leaves stock until it ships. The order number is assigned automatically.

Input (object)

FieldTypeDescription
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdstring | nullRecord id (UUID)min length 1, max length 64
machineIdstring | nullRecord id (UUID)min length 1, max length 64
ticketIdstring | nullRecord id (UUID)min length 1, max length 64
quoteValidUntilstring (date) | nullDefaults to 30 days from today
shippingCentsintegerAmount in integer US cents (zero or more)default 0, min 0, max 9007199254740991
taxCentsintegerAmount in integer US cents (zero or more)default 0, min 0, max 9007199254740991
shipToNamestring | nullmax length 200
shipToAddressstring | nullmax length 500
customerPostring | nullmax length 60
notesstring | nullmax length 5000
linesobject[]default []
partIdstringRecord id (UUID)min length 1, max length 64
partNumberstringmax length 60
quantityintegerdefault 1, min 1, max 9007199254740991
unitPriceCentsintegerDefaults to the catalog pricemin 0, max 9007199254740991

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.create \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"accountId":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "quoteValidUntil": {
        "description": "Defaults to 30 days from today",
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippingCents": {
        "default": 0,
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "default": 0,
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shipToName": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "shipToAddress": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 500
          },
          {
            "type": "null"
          }
        ]
      },
      "customerPo": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "notes": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 5000
          },
          {
            "type": "null"
          }
        ]
      },
      "lines": {
        "default": [],
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string",
              "maxLength": 60
            },
            "quantity": {
              "default": 1,
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "description": "Defaults to the catalog price",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          }
        }
      }
    },
    "required": [
      "accountId"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "orderNumber": {
        "type": "string"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "subtotalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "quotedOn": {
        "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"
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "orderedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "deliveredOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "carrier": {
        "type": [
          "string",
          "null"
        ]
      },
      "trackingNumber": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToName": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToAddress": {
        "type": [
          "string",
          "null"
        ]
      },
      "customerPo": {
        "type": [
          "string",
          "null"
        ]
      },
      "notes": {
        "type": [
          "string",
          "null"
        ]
      },
      "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"
      },
      "accountName": {
        "type": "string"
      },
      "lineCount": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partsOrderId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Current stock of the part, for the quote builder"
            }
          },
          "required": [
            "id",
            "partsOrderId",
            "partId",
            "partNumber",
            "description",
            "quantity",
            "unitPriceCents",
            "totalCents",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "id",
      "orderNumber",
      "accountId",
      "contactId",
      "machineId",
      "ticketId",
      "status",
      "subtotalCents",
      "shippingCents",
      "taxCents",
      "totalCents",
      "quotedOn",
      "quoteValidUntil",
      "orderedOn",
      "shippedOn",
      "deliveredOn",
      "carrier",
      "trackingNumber",
      "shipToName",
      "shipToAddress",
      "customerPo",
      "notes",
      "createdAt",
      "updatedAt",
      "accountName",
      "lineCount",
      "lines"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.update

Update a parts quote or order

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

Change the contact, machine, ticket, shipping, tax, ship-to, customer PO, validity date or notes of a parts order. Totals are recalculated.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
contactIdstring | nullRecord id (UUID)min length 1, max length 64
machineIdstring | nullRecord id (UUID)min length 1, max length 64
ticketIdstring | nullRecord id (UUID)min length 1, max length 64
quoteValidUntilstring (date) | nullDate as YYYY-MM-DD
shippingCentsintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shipToNamestring | nullmax length 200
shipToAddressstring | nullmax length 500
customerPostring | nullmax length 60
notesstring | nullmax length 5000

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.update \
  -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)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shipToName": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "shipToAddress": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 500
          },
          {
            "type": "null"
          }
        ]
      },
      "customerPo": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "notes": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 5000
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "orderNumber": {
        "type": "string"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "subtotalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "quotedOn": {
        "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"
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "orderedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "deliveredOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "carrier": {
        "type": [
          "string",
          "null"
        ]
      },
      "trackingNumber": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToName": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToAddress": {
        "type": [
          "string",
          "null"
        ]
      },
      "customerPo": {
        "type": [
          "string",
          "null"
        ]
      },
      "notes": {
        "type": [
          "string",
          "null"
        ]
      },
      "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"
      },
      "accountName": {
        "type": "string"
      },
      "lineCount": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partsOrderId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Current stock of the part, for the quote builder"
            }
          },
          "required": [
            "id",
            "partsOrderId",
            "partId",
            "partNumber",
            "description",
            "quantity",
            "unitPriceCents",
            "totalCents",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "id",
      "orderNumber",
      "accountId",
      "contactId",
      "machineId",
      "ticketId",
      "status",
      "subtotalCents",
      "shippingCents",
      "taxCents",
      "totalCents",
      "quotedOn",
      "quoteValidUntil",
      "orderedOn",
      "shippedOn",
      "deliveredOn",
      "carrier",
      "trackingNumber",
      "shipToName",
      "shipToAddress",
      "customerPo",
      "notes",
      "createdAt",
      "updatedAt",
      "accountName",
      "lineCount",
      "lines"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.add_line

Add a part to a parts quote

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

Add a part line (by part id or part number) to a parts order that is still a quote or ordered. Adding a part already on the order increases its quantity. Totals are recalculated.

Input (object)

FieldTypeDescription
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdstringRecord id (UUID)min length 1, max length 64
partNumberstringmax length 60
quantityintegerdefault 1, min 1, max 9007199254740991
unitPriceCentsintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.add_line \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"partsOrderId":"00000000-0000-4000-8000-000000000000","partId":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "partsOrderId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "partId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "partNumber": {
        "type": "string",
        "maxLength": 60
      },
      "quantity": {
        "default": 1,
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
      },
      "unitPriceCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      }
    },
    "required": [
      "partsOrderId"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "orderNumber": {
        "type": "string"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "subtotalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "quotedOn": {
        "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"
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "orderedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "deliveredOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "carrier": {
        "type": [
          "string",
          "null"
        ]
      },
      "trackingNumber": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToName": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToAddress": {
        "type": [
          "string",
          "null"
        ]
      },
      "customerPo": {
        "type": [
          "string",
          "null"
        ]
      },
      "notes": {
        "type": [
          "string",
          "null"
        ]
      },
      "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"
      },
      "accountName": {
        "type": "string"
      },
      "lineCount": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partsOrderId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Current stock of the part, for the quote builder"
            }
          },
          "required": [
            "id",
            "partsOrderId",
            "partId",
            "partNumber",
            "description",
            "quantity",
            "unitPriceCents",
            "totalCents",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "id",
      "orderNumber",
      "accountId",
      "contactId",
      "machineId",
      "ticketId",
      "status",
      "subtotalCents",
      "shippingCents",
      "taxCents",
      "totalCents",
      "quotedOn",
      "quoteValidUntil",
      "orderedOn",
      "shippedOn",
      "deliveredOn",
      "carrier",
      "trackingNumber",
      "shipToName",
      "shipToAddress",
      "customerPo",
      "notes",
      "createdAt",
      "updatedAt",
      "accountName",
      "lineCount",
      "lines"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.update_line

Change a parts order line

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

Change the quantity or unit price of a line on a parts order that has not shipped. Totals are recalculated.

Input (object)

FieldTypeDescription
lineIdrequiredstringRecord id (UUID)min length 1, max length 64
quantityintegermin 1, max 9007199254740991
unitPriceCentsintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.update_line \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"lineId":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "lineId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "quantity": {
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
      },
      "unitPriceCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      }
    },
    "required": [
      "lineId"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "orderNumber": {
        "type": "string"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "subtotalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "quotedOn": {
        "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"
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "orderedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "deliveredOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "carrier": {
        "type": [
          "string",
          "null"
        ]
      },
      "trackingNumber": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToName": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToAddress": {
        "type": [
          "string",
          "null"
        ]
      },
      "customerPo": {
        "type": [
          "string",
          "null"
        ]
      },
      "notes": {
        "type": [
          "string",
          "null"
        ]
      },
      "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"
      },
      "accountName": {
        "type": "string"
      },
      "lineCount": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partsOrderId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Current stock of the part, for the quote builder"
            }
          },
          "required": [
            "id",
            "partsOrderId",
            "partId",
            "partNumber",
            "description",
            "quantity",
            "unitPriceCents",
            "totalCents",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "id",
      "orderNumber",
      "accountId",
      "contactId",
      "machineId",
      "ticketId",
      "status",
      "subtotalCents",
      "shippingCents",
      "taxCents",
      "totalCents",
      "quotedOn",
      "quoteValidUntil",
      "orderedOn",
      "shippedOn",
      "deliveredOn",
      "carrier",
      "trackingNumber",
      "shipToName",
      "shipToAddress",
      "customerPo",
      "notes",
      "createdAt",
      "updatedAt",
      "accountName",
      "lineCount",
      "lines"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.remove_line

Remove a parts order line

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

Delete a line from a parts order that has not shipped. Totals are recalculated.

Input (object)

FieldTypeDescription
lineIdrequiredstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
okrequiredtrue
idrequiredstringRecord id (UUID)min length 1, max length 64
orderrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.remove_line \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"lineId":"00000000-0000-4000-8000-000000000000"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "lineId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      }
    },
    "required": [
      "lineId"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "ok": {
        "type": "boolean",
        "const": true
      },
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "orderNumber": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "machineId": {
            "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"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "quote",
              "ordered",
              "shipped",
              "delivered",
              "cancelled"
            ]
          },
          "subtotalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "shippingCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "taxCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "totalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "quotedOn": {
            "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"
          },
          "quoteValidUntil": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "shippedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveredOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackingNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToName": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerPo": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "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"
          },
          "accountName": {
            "type": "string"
          },
          "lineCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partsOrderId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partNumber": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "unitPriceCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "totalCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "onHand": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Current stock of the part, for the quote builder"
                }
              },
              "required": [
                "id",
                "partsOrderId",
                "partId",
                "partNumber",
                "description",
                "quantity",
                "unitPriceCents",
                "totalCents",
                "onHand"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "orderNumber",
          "accountId",
          "contactId",
          "machineId",
          "ticketId",
          "status",
          "subtotalCents",
          "shippingCents",
          "taxCents",
          "totalCents",
          "quotedOn",
          "quoteValidUntil",
          "orderedOn",
          "shippedOn",
          "deliveredOn",
          "carrier",
          "trackingNumber",
          "shipToName",
          "shipToAddress",
          "customerPo",
          "notes",
          "createdAt",
          "updatedAt",
          "accountName",
          "lineCount",
          "lines"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "ok",
      "id",
      "order"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.place

Turn a parts quote into an order

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

The customer accepted the quote: move it from quote to ordered and record the order date and customer PO. The response lists any lines with less stock on hand than ordered.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderedOnstring (date)Defaults to today
customerPostring | nullmax length 60

Output (object)

FieldTypeDescription
orderrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
shortagesrequiredobject[]
partNumberrequiredstring
orderedrequiredintegermin -9007199254740991, max 9007199254740991
onHandrequiredintegermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.place \
  -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)"
      },
      "orderedOn": {
        "description": "Defaults to today",
        "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])))$"
      },
      "customerPo": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "orderNumber": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "machineId": {
            "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"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "quote",
              "ordered",
              "shipped",
              "delivered",
              "cancelled"
            ]
          },
          "subtotalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "shippingCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "taxCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "totalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "quotedOn": {
            "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"
          },
          "quoteValidUntil": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "shippedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveredOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackingNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToName": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerPo": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "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"
          },
          "accountName": {
            "type": "string"
          },
          "lineCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partsOrderId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partNumber": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "unitPriceCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "totalCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "onHand": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Current stock of the part, for the quote builder"
                }
              },
              "required": [
                "id",
                "partsOrderId",
                "partId",
                "partNumber",
                "description",
                "quantity",
                "unitPriceCents",
                "totalCents",
                "onHand"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "orderNumber",
          "accountId",
          "contactId",
          "machineId",
          "ticketId",
          "status",
          "subtotalCents",
          "shippingCents",
          "taxCents",
          "totalCents",
          "quotedOn",
          "quoteValidUntil",
          "orderedOn",
          "shippedOn",
          "deliveredOn",
          "carrier",
          "trackingNumber",
          "shipToName",
          "shipToAddress",
          "customerPo",
          "notes",
          "createdAt",
          "updatedAt",
          "accountName",
          "lineCount",
          "lines"
        ],
        "additionalProperties": false
      },
      "shortages": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "partNumber": {
              "type": "string"
            },
            "ordered": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "partNumber",
            "ordered",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "order",
      "shortages"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.ship

Ship a parts order

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

Mark an ordered parts order shipped with the carrier and tracking number. Shipping deducts every line from stock and writes one stock ledger row per part. Fails with a conflict if any line has less stock than ordered, unless allowNegativeStock is true. The customer is emailed the tracking number.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
carrierrequiredstringmin length 1, max length 100
trackingNumberrequiredstringmin length 1, max length 100
shippedOnstring (date)Defaults to today
allowNegativeStockbooleandefault false
notifyCustomerbooleandefault true

Output (object)

FieldTypeDescription
orderrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
movementsrequiredobject[]
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
lowStockPartNumbersrequiredstring[]Parts now at or below their reorder point
emailQueuedrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.ship \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000","carrier":"example","trackingNumber":"example"}'
              
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)"
      },
      "carrier": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "trackingNumber": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "shippedOn": {
        "description": "Defaults to today",
        "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])))$"
      },
      "allowNegativeStock": {
        "default": false,
        "type": "boolean"
      },
      "notifyCustomer": {
        "default": true,
        "type": "boolean"
      }
    },
    "required": [
      "id",
      "carrier",
      "trackingNumber"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "orderNumber": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "machineId": {
            "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"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "quote",
              "ordered",
              "shipped",
              "delivered",
              "cancelled"
            ]
          },
          "subtotalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "shippingCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "taxCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "totalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "quotedOn": {
            "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"
          },
          "quoteValidUntil": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "shippedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveredOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackingNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToName": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerPo": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "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"
          },
          "accountName": {
            "type": "string"
          },
          "lineCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partsOrderId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partNumber": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "unitPriceCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "totalCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "onHand": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Current stock of the part, for the quote builder"
                }
              },
              "required": [
                "id",
                "partsOrderId",
                "partId",
                "partNumber",
                "description",
                "quantity",
                "unitPriceCents",
                "totalCents",
                "onHand"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "orderNumber",
          "accountId",
          "contactId",
          "machineId",
          "ticketId",
          "status",
          "subtotalCents",
          "shippingCents",
          "taxCents",
          "totalCents",
          "quotedOn",
          "quoteValidUntil",
          "orderedOn",
          "shippedOn",
          "deliveredOn",
          "carrier",
          "trackingNumber",
          "shipToName",
          "shipToAddress",
          "customerPo",
          "notes",
          "createdAt",
          "updatedAt",
          "accountName",
          "lineCount",
          "lines"
        ],
        "additionalProperties": false
      },
      "movements": {
        "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
        }
      },
      "lowStockPartNumbers": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Parts now at or below their reorder point"
      },
      "emailQueued": {
        "type": "boolean"
      }
    },
    "required": [
      "order",
      "movements",
      "lowStockPartNumbers",
      "emailQueued"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.deliver

Mark a parts order delivered

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

Record that a shipped parts order arrived.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
deliveredOnstring (date)Defaults to today

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.deliver \
  -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)"
      },
      "deliveredOn": {
        "description": "Defaults to today",
        "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": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "orderNumber": {
        "type": "string"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "contactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "machineId": {
        "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"
          }
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "quote",
          "ordered",
          "shipped",
          "delivered",
          "cancelled"
        ]
      },
      "subtotalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "shippingCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "taxCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "totalCents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Amount in integer US cents (zero or more)"
      },
      "quotedOn": {
        "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"
      },
      "quoteValidUntil": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "orderedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "shippedOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "deliveredOn": {
        "anyOf": [
          {
            "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"
          },
          {
            "type": "null"
          }
        ]
      },
      "carrier": {
        "type": [
          "string",
          "null"
        ]
      },
      "trackingNumber": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToName": {
        "type": [
          "string",
          "null"
        ]
      },
      "shipToAddress": {
        "type": [
          "string",
          "null"
        ]
      },
      "customerPo": {
        "type": [
          "string",
          "null"
        ]
      },
      "notes": {
        "type": [
          "string",
          "null"
        ]
      },
      "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"
      },
      "accountName": {
        "type": "string"
      },
      "lineCount": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partsOrderId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "partNumber": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "unitPriceCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "onHand": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Current stock of the part, for the quote builder"
            }
          },
          "required": [
            "id",
            "partsOrderId",
            "partId",
            "partNumber",
            "description",
            "quantity",
            "unitPriceCents",
            "totalCents",
            "onHand"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "id",
      "orderNumber",
      "accountId",
      "contactId",
      "machineId",
      "ticketId",
      "status",
      "subtotalCents",
      "shippingCents",
      "taxCents",
      "totalCents",
      "quotedOn",
      "quoteValidUntil",
      "orderedOn",
      "shippedOn",
      "deliveredOn",
      "carrier",
      "trackingNumber",
      "shipToName",
      "shipToAddress",
      "customerPo",
      "notes",
      "createdAt",
      "updatedAt",
      "accountName",
      "lineCount",
      "lines"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.cancel

Cancel a parts quote or order

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

Cancel a parts order. If it had already shipped, the parts are returned to stock through return ledger rows when restock is true.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
reasonstring | nullmax length 2000
restockbooleandefault true

Output (object)

FieldTypeDescription
orderrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
linesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
partsOrderIdrequiredstringRecord id (UUID)min length 1, max length 64
partIdrequiredstringRecord id (UUID)min length 1, max length 64
partNumberrequiredstring
descriptionrequiredstring
quantityrequiredintegermin 1, max 9007199254740991
unitPriceCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
onHandrequiredintegerCurrent stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991
movementsrequiredobject[]
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_orders.cancel \
  -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)"
      },
      "reason": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 2000
          },
          {
            "type": "null"
          }
        ]
      },
      "restock": {
        "default": true,
        "type": "boolean"
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "orderNumber": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "machineId": {
            "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"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "quote",
              "ordered",
              "shipped",
              "delivered",
              "cancelled"
            ]
          },
          "subtotalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "shippingCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "taxCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "totalCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Amount in integer US cents (zero or more)"
          },
          "quotedOn": {
            "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"
          },
          "quoteValidUntil": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "shippedOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveredOn": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackingNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToName": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipToAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerPo": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "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"
          },
          "accountName": {
            "type": "string"
          },
          "lineCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partsOrderId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "partNumber": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "unitPriceCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "totalCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                "onHand": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Current stock of the part, for the quote builder"
                }
              },
              "required": [
                "id",
                "partsOrderId",
                "partId",
                "partNumber",
                "description",
                "quantity",
                "unitPriceCents",
                "totalCents",
                "onHand"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "orderNumber",
          "accountId",
          "contactId",
          "machineId",
          "ticketId",
          "status",
          "subtotalCents",
          "shippingCents",
          "taxCents",
          "totalCents",
          "quotedOn",
          "quoteValidUntil",
          "orderedOn",
          "shippedOn",
          "deliveredOn",
          "carrier",
          "trackingNumber",
          "shipToName",
          "shipToAddress",
          "customerPo",
          "notes",
          "createdAt",
          "updatedAt",
          "accountName",
          "lineCount",
          "lines"
        ],
        "additionalProperties": false
      },
      "movements": {
        "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": [
      "order",
      "movements"
    ],
    "additionalProperties": false
  }
}
            

parts_orders.export

Export a parts quote or order

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

Produce a parts quote or order as a printable HTML document, CSV of the lines, or JSON.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
format"json" | "csv" | "html"default "html"

Output (object)

FieldTypeDescription
filenamerequiredstring
contentTyperequiredstring
contentrequiredstringThe exported file as text (JSON, CSV or printable HTML)
Example request
                curl https://api.cemco.app/v1/ops/parts_orders.export \
  -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)"
      },
      "format": {
        "default": "html",
        "type": "string",
        "enum": [
          "json",
          "csv",
          "html"
        ]
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "filename": {
        "type": "string"
      },
      "contentType": {
        "type": "string"
      },
      "content": {
        "type": "string",
        "description": "The exported file as text (JSON, CSV or printable HTML)"
      }
    },
    "required": [
      "filename",
      "contentType",
      "content"
    ],
    "additionalProperties": false
  }
}