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
Parts quotes and parts orders with filters for account, status and machine. A quote is a parts order with status quote.
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
machineId | string | Record id (UUID)min length 1, max length 64 |
ticketId | string | Record id (UUID)min length 1, max length 64 |
status | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
open | boolean | true for quote, ordered and shipped; false for delivered and cancelled |
query | string | Matches order number, tracking number, customer PO or account namemax length 200 |
limit | integer | Maximum rows to return (default 50, max 500)default 50, min 1, max 500 |
offset | integer | Rows to skip, for pagingdefault 0, min 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
totalrequired | integer | Total rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991 |
limitrequired | integer | min -9007199254740991, max 9007199254740991 |
offsetrequired | integer | min -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
One parts order by id or order number with its lines, totals, status dates, carrier and tracking number.
Input (object)
| Field | Type | Description |
|---|---|---|
id | string | Record id (UUID)min length 1, max length 64 |
orderNumber | string | max length 40 |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
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)
| Field | Type | Description |
|---|---|---|
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactId | string | null | Record id (UUID)min length 1, max length 64 |
machineId | string | null | Record id (UUID)min length 1, max length 64 |
ticketId | string | null | Record id (UUID)min length 1, max length 64 |
quoteValidUntil | string (date) | null | Defaults to 30 days from today |
shippingCents | integer | Amount in integer US cents (zero or more)default 0, min 0, max 9007199254740991 |
taxCents | integer | Amount in integer US cents (zero or more)default 0, min 0, max 9007199254740991 |
shipToName | string | null | max length 200 |
shipToAddress | string | null | max length 500 |
customerPo | string | null | max length 60 |
notes | string | null | max length 5000 |
lines | object[] | default [] |
partId | string | Record id (UUID)min length 1, max length 64 |
partNumber | string | max length 60 |
quantity | integer | default 1, min 1, max 9007199254740991 |
unitPriceCents | integer | Defaults to the catalog pricemin 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
Change the contact, machine, ticket, shipping, tax, ship-to, customer PO, validity date or notes of a parts order. Totals are recalculated.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
contactId | string | null | Record id (UUID)min length 1, max length 64 |
machineId | string | null | Record id (UUID)min length 1, max length 64 |
ticketId | string | null | Record id (UUID)min length 1, max length 64 |
quoteValidUntil | string (date) | null | Date as YYYY-MM-DD |
shippingCents | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCents | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shipToName | string | null | max length 200 |
shipToAddress | string | null | max length 500 |
customerPo | string | null | max length 60 |
notes | string | null | max length 5000 |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
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)
| Field | Type | Description |
|---|---|---|
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partId | string | Record id (UUID)min length 1, max length 64 |
partNumber | string | max length 60 |
quantity | integer | default 1, min 1, max 9007199254740991 |
unitPriceCents | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
Change the quantity or unit price of a line on a parts order that has not shipped. Totals are recalculated.
Input (object)
| Field | Type | Description |
|---|---|---|
lineIdrequired | string | Record id (UUID)min length 1, max length 64 |
quantity | integer | min 1, max 9007199254740991 |
unitPriceCents | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
Delete a line from a parts order that has not shipped. Totals are recalculated.
Input (object)
| Field | Type | Description |
|---|---|---|
lineIdrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
okrequired | true | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
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)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderedOn | string (date) | Defaults to today |
customerPo | string | null | max length 60 |
Output (object)
| Field | Type | Description |
|---|---|---|
orderrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991 |
shortagesrequired | object[] | |
partNumberrequired | string | |
orderedrequired | integer | min -9007199254740991, max 9007199254740991 |
onHandrequired | integer | min -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
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)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
carrierrequired | string | min length 1, max length 100 |
trackingNumberrequired | string | min length 1, max length 100 |
shippedOn | string (date) | Defaults to today |
allowNegativeStock | boolean | default false |
notifyCustomer | boolean | default true |
Output (object)
| Field | Type | Description |
|---|---|---|
orderrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991 |
movementsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
typerequired | "receive" | "adjust" | "ship" | "return" | |
quantityrequired | integer | Signed change: positive adds stock, negative removes itmin -9007199254740991, max 9007199254740991 |
balanceAfterrequired | integer | Stock on hand after this movementmin -9007199254740991, max 9007199254740991 |
reasonrequired | string | null | |
partsOrderIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
unitCostCentsrequired | integer | null | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
actorNamerequired | string | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
lowStockPartNumbersrequired | string[] | Parts now at or below their reorder point |
emailQueuedrequired | boolean |
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
Record that a shipped parts order arrived.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
deliveredOn | string (date) | Defaults to today |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current 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
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)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
reason | string | null | max length 2000 |
restock | boolean | default true |
Output (object)
| Field | Type | Description |
|---|---|---|
orderrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partsOrderIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
onHandrequired | integer | Current stock of the part, for the quote buildermin -9007199254740991, max 9007199254740991 |
movementsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
typerequired | "receive" | "adjust" | "ship" | "return" | |
quantityrequired | integer | Signed change: positive adds stock, negative removes itmin -9007199254740991, max 9007199254740991 |
balanceAfterrequired | integer | Stock on hand after this movementmin -9007199254740991, max 9007199254740991 |
reasonrequired | string | null | |
partsOrderIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
unitCostCentsrequired | integer | null | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
actorNamerequired | string | |
createdAtrequired | string (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
Produce a parts quote or order as a printable HTML document, CSV of the lines, or JSON.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
format | "json" | "csv" | "html" | default "html" |
Output (object)
| Field | Type | Description |
|---|---|---|
filenamerequired | string | |
contentTyperequired | string | |
contentrequired | string | The 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
}
}