Orders
Generated at build time from packages/core/src/operations/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.
orders.list
List orders
List production orders with filters for account, stage and validity. Each row says whether the order is valid and, if not, which of the three requirements are missing (signed quote, its received date, balance remaining).
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
stage | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stages | ("received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed")[] | Several stages at once |
open | boolean | true for orders not yet closed, false for closed orders |
valid | boolean | false returns only orders that are not yet valid |
query | string | Matches order number, PO number, title or account namemax length 200 |
sort | "newest" | "oldest" | "order_number" | "expected_ship" | default "newest" |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
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 | |
siteNamerequired | string | null | |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | |
nextStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
machineCountrequired | 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/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)"
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stages": {
"description": "Several stages at once",
"type": "array",
"items": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
}
},
"open": {
"description": "true for orders not yet closed, false for closed orders",
"type": "boolean"
},
"valid": {
"description": "false returns only orders that are not yet valid",
"type": "boolean"
},
"query": {
"description": "Matches order number, PO number, title or account name",
"type": "string",
"maxLength": 200
},
"sort": {
"default": "newest",
"type": "string",
"enum": [
"newest",
"oldest",
"order_number",
"expected_ship"
]
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
},
"siteName": {
"type": [
"string",
"null"
]
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
}
},
"nextStage": {
"anyOf": [
{
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
{
"type": "null"
}
]
},
"lineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt",
"accountName",
"siteName",
"missing",
"nextStage",
"lineCount",
"machineCount"
],
"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
}
}
orders.board
Get the order board by stage
Every order grouped into the nine lifecycle stages in order (received, in_build, ready_to_ship, shipped, delivered, set_up, commissioned, trained, closed), with a count and dollar total per stage. Orders that are not valid are flagged with what is missing. Closed orders are left out unless includeClosed is true.
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
includeClosed | boolean | default false |
Output (object)
| Field | Type | Description |
|---|---|---|
columnsrequired | object[] | One column per stage, in lifecycle order |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
labelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
ordersrequired | 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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
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 | |
siteNamerequired | string | null | |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | |
nextStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openCountrequired | integer | min -9007199254740991, max 9007199254740991 |
invalidCountrequired | integer | Open orders that are not yet validmin -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/orders.board \
-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)"
},
"includeClosed": {
"default": false,
"type": "boolean"
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"columns": {
"type": "array",
"items": {
"type": "object",
"properties": {
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"label": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"orders": {
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
},
"siteName": {
"type": [
"string",
"null"
]
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
}
},
"nextStage": {
"anyOf": [
{
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
{
"type": "null"
}
]
},
"lineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt",
"accountName",
"siteName",
"missing",
"nextStage",
"lineCount",
"machineCount"
],
"additionalProperties": false
}
}
},
"required": [
"stage",
"label",
"count",
"totalCents",
"orders"
],
"additionalProperties": false
},
"description": "One column per stage, in lifecycle order"
},
"openCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"invalidCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Open orders that are not yet valid"
}
},
"required": [
"columns",
"openCount",
"invalidCount"
],
"additionalProperties": false
}
}
orders.get
Get an order
One order by id or order number: the valid-order checklist, the nine-stage timeline with dates and who moved it, balance remaining, financing, line items, linked documents, the machines built for it, and its account and site.
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
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 | |
siteNamerequired | string | null | |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | |
nextStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
validityrequired | object | |
isValidrequired | boolean | True when the order has the signed quote, its received date and the balance remaining |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | Requirements still missing; empty when valid |
missingLabelsrequired | string[] | Human-readable names of the missing requirements |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
skurequired | string | null | |
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 |
positionrequired | integer | min -9007199254740991, max 9007199254740991 |
eventsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
fromStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
toStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
occurredOnrequired | string (date) | Date as YYYY-MM-DD |
noterequired | string | null | |
actorUserIdrequired | string | null | |
actorNamerequired | string | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
timelinerequired | object[] | All nine stages in order with state and date |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
labelrequired | string | |
staterequired | "done" | "current" | "upcoming" | |
daterequired | string (date) | null | Date as YYYY-MM-DD |
ownerNamerequired | string | null | Who moved the order into this stage |
documentsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
kindrequired | "signed_quote" | "quote" | "purchase_order" | "drawing" | "manual" | "inspection_report" | "photo" | "training_record" | "invoice" | "email_attachment" | "export" | "other" | |
titlerequired | string | |
filenamerequired | string | |
contentTyperequired | string | |
sizeBytesrequired | integer | min 0, max 9007199254740991 |
statusrequired | "pending" | "stored" | pending until the file bytes are stored |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
customerVisiblerequired | boolean | Whether the customer can open it in the portal |
sourcerequired | "upload" | "email" | "portal" | "system" | "import" | |
linksrequired | object[] | |
entityTyperequired | "account" | "contact" | "site" | "order" | "machine" | "ticket" | "warranty_claim" | "parts_order" | "part" | "opportunity" | "check_in" | |
entityIdrequired | string | Record id (UUID)min length 1, max length 64 |
uploadedByNamerequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
machinesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
serialNumberrequired | string | |
typerequired | "plant" | "mixer" | "silo" | "feeder" | "power_pack" | |
modelrequired | string | |
configurationrequired | string | null | |
optionsrequired | string[] | |
accountIdrequired | string | Current ownermin length 1, max length 64 |
siteIdrequired | string | null | Current sitemin length 1, max length 64 |
orderIdrequired | string | null | Order the machine was built formin length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "in_build" | "in_transit" | "operating" | "down" | "idle" | "retired" | |
builtOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
commissionedOnrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStartrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyEndrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStaterequired | "none" | "active" | "expiring" | "expired" | Computed from the warranty dates and today's date |
warrantyDaysLeftrequired | integer | null | Days until the warranty ends; negative once expired; null if not startedmin -9007199254740991, max 9007199254740991 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
siterequired | object | null | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
line1required | string | null | |
line2required | string | null | |
cityrequired | string | null | |
staterequired | string | null | |
postalCoderequired | string | null | |
countryrequired | string | null | |
latituderequired | number | null | min -90, max 90 |
longituderequired | number | null | min -180, max 180 |
powerSourcerequired | string | null | For example utility 480V three-phase, or generator |
waterSourcerequired | string | null | For example municipal, well, hauled |
activeFromrequired | string (date) | null | Date as YYYY-MM-DD |
activeTorequired | string (date) | null | Set when the site is no longer used |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
},
"siteName": {
"type": [
"string",
"null"
]
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
}
},
"nextStage": {
"anyOf": [
{
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
{
"type": "null"
}
]
},
"lineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"validity": {
"type": "object",
"properties": {
"isValid": {
"type": "boolean",
"description": "True when the order has the signed quote, its received date and the balance remaining"
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
},
"description": "Requirements still missing; empty when valid"
},
"missingLabels": {
"type": "array",
"items": {
"type": "string"
},
"description": "Human-readable names of the missing requirements"
}
},
"required": [
"isValid",
"missing",
"missingLabels"
],
"additionalProperties": false
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"sku": {
"type": [
"string",
"null"
]
},
"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)"
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderId",
"productId",
"sku",
"description",
"quantity",
"unitPriceCents",
"totalCents",
"position"
],
"additionalProperties": false
}
},
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"fromStage": {
"anyOf": [
{
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
{
"type": "null"
}
]
},
"toStage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"occurredOn": {
"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"
},
"note": {
"type": [
"string",
"null"
]
},
"actorUserId": {
"type": [
"string",
"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",
"orderId",
"fromStage",
"toStage",
"occurredOn",
"note",
"actorUserId",
"actorName",
"createdAt"
],
"additionalProperties": false
}
},
"timeline": {
"type": "array",
"items": {
"type": "object",
"properties": {
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"label": {
"type": "string"
},
"state": {
"type": "string",
"enum": [
"done",
"current",
"upcoming"
]
},
"date": {
"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"
}
]
},
"ownerName": {
"description": "Who moved the order into this stage",
"type": [
"string",
"null"
]
}
},
"required": [
"stage",
"label",
"state",
"date",
"ownerName"
],
"additionalProperties": false
},
"description": "All nine stages in order with state and date"
},
"documents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"kind": {
"type": "string",
"enum": [
"signed_quote",
"quote",
"purchase_order",
"drawing",
"manual",
"inspection_report",
"photo",
"training_record",
"invoice",
"email_attachment",
"export",
"other"
]
},
"title": {
"type": "string"
},
"filename": {
"type": "string"
},
"contentType": {
"type": "string"
},
"sizeBytes": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"status": {
"type": "string",
"enum": [
"pending",
"stored"
],
"description": "pending until the file bytes are stored"
},
"accountId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"customerVisible": {
"type": "boolean",
"description": "Whether the customer can open it in the portal"
},
"source": {
"type": "string",
"enum": [
"upload",
"email",
"portal",
"system",
"import"
]
},
"links": {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityType": {
"type": "string",
"enum": [
"account",
"contact",
"site",
"order",
"machine",
"ticket",
"warranty_claim",
"parts_order",
"part",
"opportunity",
"check_in"
]
},
"entityId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"entityType",
"entityId"
],
"additionalProperties": false
}
},
"uploadedByName": {
"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"
}
},
"required": [
"id",
"kind",
"title",
"filename",
"contentType",
"sizeBytes",
"status",
"accountId",
"customerVisible",
"source",
"links",
"uploadedByName",
"createdAt"
],
"additionalProperties": false
}
},
"machines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"serialNumber": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"plant",
"mixer",
"silo",
"feeder",
"power_pack"
]
},
"model": {
"type": "string"
},
"configuration": {
"type": [
"string",
"null"
]
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Current owner"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Current site"
},
"orderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Order the machine was built for"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"in_build",
"in_transit",
"operating",
"down",
"idle",
"retired"
]
},
"builtOn": {
"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"
}
]
},
"commissionedOn": {
"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"
}
]
},
"warrantyStart": {
"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"
}
]
},
"warrantyEnd": {
"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"
}
]
},
"warrantyState": {
"type": "string",
"enum": [
"none",
"active",
"expiring",
"expired"
],
"description": "Computed from the warranty dates and today's date"
},
"warrantyDaysLeft": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Days until the warranty ends; negative once expired; null if not started"
},
"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"
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"account": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"name": {
"type": "string"
},
"normalizedName": {
"type": "string",
"description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
},
"segment": {
"type": "string",
"enum": [
"concrete_producer",
"multiservice"
]
},
"status": {
"type": "string",
"enum": [
"active",
"prospect",
"inactive"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"website": {
"type": [
"string",
"null"
]
},
"hqLine1": {
"type": [
"string",
"null"
]
},
"hqLine2": {
"type": [
"string",
"null"
]
},
"hqCity": {
"type": [
"string",
"null"
]
},
"hqState": {
"description": "Two-letter US state or region code",
"type": [
"string",
"null"
]
},
"hqPostalCode": {
"type": [
"string",
"null"
]
},
"hqCountry": {
"type": [
"string",
"null"
]
},
"hubspotCompanyId": {
"type": [
"string",
"null"
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Staff user who owns the account"
},
"notes": {
"type": [
"string",
"null"
]
},
"lastContactedAt": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
],
"description": "Most recent call, email, text or visit"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
}
},
"required": [
"id",
"name",
"normalizedName",
"segment",
"status",
"phone",
"website",
"hqLine1",
"hqLine2",
"hqCity",
"hqState",
"hqPostalCode",
"hqCountry",
"hubspotCompanyId",
"ownerUserId",
"notes",
"lastContactedAt",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"site": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"name": {
"type": "string"
},
"line1": {
"type": [
"string",
"null"
]
},
"line2": {
"type": [
"string",
"null"
]
},
"city": {
"type": [
"string",
"null"
]
},
"state": {
"type": [
"string",
"null"
]
},
"postalCode": {
"type": [
"string",
"null"
]
},
"country": {
"type": [
"string",
"null"
]
},
"latitude": {
"anyOf": [
{
"type": "number",
"minimum": -90,
"maximum": 90
},
{
"type": "null"
}
]
},
"longitude": {
"anyOf": [
{
"type": "number",
"minimum": -180,
"maximum": 180
},
{
"type": "null"
}
]
},
"powerSource": {
"description": "For example utility 480V three-phase, or generator",
"type": [
"string",
"null"
]
},
"waterSource": {
"description": "For example municipal, well, hauled",
"type": [
"string",
"null"
]
},
"activeFrom": {
"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"
}
]
},
"activeTo": {
"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"
}
],
"description": "Set when the site is no longer used"
},
"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"
}
},
"required": [
"id",
"accountId",
"name",
"line1",
"line2",
"city",
"state",
"postalCode",
"country",
"latitude",
"longitude",
"powerSource",
"waterSource",
"activeFrom",
"activeTo",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt",
"accountName",
"siteName",
"missing",
"nextStage",
"lineCount",
"machineCount",
"validity",
"lines",
"events",
"timeline",
"documents",
"machines",
"account",
"site"
],
"additionalProperties": false
}
}
orders.create
Create a production order
Open a production order for an account at stage received. The order number is assigned automatically unless given. Lines can be added now or later. The order stays not valid, and cannot leave received, until it has the signed quote document, the date it was received and the balance remaining.
Input (object)
| Field | Type | Description |
|---|---|---|
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
siteId | string | null | Delivery sitemin length 1, max length 64 |
orderNumber | string | min length 1, max length 40 |
title | string | null | max length 200 |
receivedOn | string (date) | Date the production order arrived; defaults to today |
poNumber | string | null | max length 60 |
expectedShipOn | string (date) | null | Date as YYYY-MM-DD |
balanceRemainingCents | integer | null | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
signedQuoteReceivedOn | string (date) | null | Date as YYYY-MM-DD |
financingPartner | "none" | "commercial_capital" | "northland_capital" | "other" | default "none" |
financingStatus | "not_applicable" | "pending" | "approved" | "declined" | "funded" | default "not_applicable" |
ownerUserId | string | null | Defaults to the callermin length 1, max length 64 |
notes | string | null | max length 20000 |
lines | object[] | default [] |
productId | string | Product from the 2026.11 price list; fills sku, description and price when givenmin length 1, max length 64 |
description | string | Required when there is no productIdmin length 1, max length 500 |
quantity | integer | default 1, min 1, max 9007199254740991 |
unitPriceCents | integer | Overrides the list pricemin 0, max 9007199254740991 |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
linesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
skurequired | string | null | |
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 |
positionrequired | integer | min -9007199254740991, max 9007199254740991 |
validityrequired | object | |
isValidrequired | boolean | True when the order has the signed quote, its received date and the balance remaining |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | Requirements still missing; empty when valid |
missingLabelsrequired | string[] | Human-readable names of the missing requirements |
Example request
curl https://api.cemco.app/v1/ops/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)"
},
"siteId": {
"description": "Delivery site",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"orderNumber": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"title": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"receivedOn": {
"description": "Date the production order arrived; 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])))$"
},
"poNumber": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
]
},
"expectedShipOn": {
"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"
}
]
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"financingPartner": {
"default": "none",
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"default": "not_applicable",
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"ownerUserId": {
"description": "Defaults to the caller",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
},
"lines": {
"default": [],
"type": "array",
"items": {
"type": "object",
"properties": {
"productId": {
"description": "Product from the 2026.11 price list; fills sku, description and price when given",
"type": "string",
"minLength": 1,
"maxLength": 64
},
"description": {
"description": "Required when there is no productId",
"type": "string",
"minLength": 1,
"maxLength": 500
},
"quantity": {
"default": 1,
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"unitPriceCents": {
"description": "Overrides the list price",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
}
}
}
},
"required": [
"accountId"
]
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"sku": {
"type": [
"string",
"null"
]
},
"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)"
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderId",
"productId",
"sku",
"description",
"quantity",
"unitPriceCents",
"totalCents",
"position"
],
"additionalProperties": false
}
},
"validity": {
"type": "object",
"properties": {
"isValid": {
"type": "boolean",
"description": "True when the order has the signed quote, its received date and the balance remaining"
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
},
"description": "Requirements still missing; empty when valid"
},
"missingLabels": {
"type": "array",
"items": {
"type": "string"
},
"description": "Human-readable names of the missing requirements"
}
},
"required": [
"isValid",
"missing",
"missingLabels"
],
"additionalProperties": false
}
},
"required": [
"order",
"lines",
"validity"
],
"additionalProperties": false
}
}
orders.update
Update an order
Change order fields: delivery site, title, PO number, expected ship date, balance remaining, the signed-quote received date, owner or notes. Only the fields you send are changed. This does not change the stage (use orders.advance) or attach the signed quote file (use orders.attach_signed_quote). Returns the new validity.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
siteId | string | null | Record id (UUID)min length 1, max length 64 |
title | string | null | max length 200 |
poNumber | string | null | max length 60 |
expectedShipOn | string (date) | null | Date as YYYY-MM-DD |
balanceRemainingCents | integer | null | 0 means paid in full; null clears itmin 0, max 9007199254740991 |
signedQuoteReceivedOn | string (date) | null | Date as YYYY-MM-DD |
ownerUserId | string | null | Record id (UUID)min length 1, max length 64 |
notes | string | null | max length 20000 |
stageDate | object | Correct the date of a stage the order has already reached |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
daterequired | string (date) | Date as YYYY-MM-DD |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
validityrequired | object | |
isValidrequired | boolean | True when the order has the signed quote, its received date and the balance remaining |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | Requirements still missing; empty when valid |
missingLabelsrequired | string[] | Human-readable names of the missing requirements |
Example request
curl https://api.cemco.app/v1/ops/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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"title": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"poNumber": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
]
},
"expectedShipOn": {
"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"
}
]
},
"balanceRemainingCents": {
"description": "0 means paid in full; null clears it",
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
},
"stageDate": {
"description": "Correct the date of a stage the order has already reached",
"type": "object",
"properties": {
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"date": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Date as YYYY-MM-DD"
}
},
"required": [
"stage",
"date"
]
}
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"validity": {
"type": "object",
"properties": {
"isValid": {
"type": "boolean",
"description": "True when the order has the signed quote, its received date and the balance remaining"
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
},
"description": "Requirements still missing; empty when valid"
},
"missingLabels": {
"type": "array",
"items": {
"type": "string"
},
"description": "Human-readable names of the missing requirements"
}
},
"required": [
"isValid",
"missing",
"missingLabels"
],
"additionalProperties": false
}
},
"required": [
"order",
"validity"
],
"additionalProperties": false
}
}
orders.add_line
Add a line item to an order
Add one line to an order, normally a product from the 2026.11 equipment price list (give productId), or a free-text line with a description and unit price. The order total is recalculated.
Input (object)
| Field | Type | Description |
|---|---|---|
productId | string | Product from the 2026.11 price list; fills sku, description and price when givenmin length 1, max length 64 |
description | string | Required when there is no productIdmin length 1, max length 500 |
quantity | integer | default 1, min 1, max 9007199254740991 |
unitPriceCents | integer | Overrides the list pricemin 0, max 9007199254740991 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
linerequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
skurequired | string | null | |
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 |
positionrequired | integer | min -9007199254740991, max 9007199254740991 |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/orders.add_line \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"orderId":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"productId": {
"description": "Product from the 2026.11 price list; fills sku, description and price when given",
"type": "string",
"minLength": 1,
"maxLength": 64
},
"description": {
"description": "Required when there is no productId",
"type": "string",
"minLength": 1,
"maxLength": 500
},
"quantity": {
"default": 1,
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"unitPriceCents": {
"description": "Overrides the list price",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"orderId"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"line": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"sku": {
"type": [
"string",
"null"
]
},
"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)"
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderId",
"productId",
"sku",
"description",
"quantity",
"unitPriceCents",
"totalCents",
"position"
],
"additionalProperties": false
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"line",
"order"
],
"additionalProperties": false
}
}
orders.update_line
Change an order line
Change the quantity, unit price or description of an order line. The order total is 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 |
description | string | min length 1, max length 500 |
Output (object)
| Field | Type | Description |
|---|---|---|
linerequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
skurequired | string | null | |
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 |
positionrequired | integer | min -9007199254740991, max 9007199254740991 |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/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)"
},
"description": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
},
"required": [
"lineId"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"line": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"sku": {
"type": [
"string",
"null"
]
},
"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)"
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderId",
"productId",
"sku",
"description",
"quantity",
"unitPriceCents",
"totalCents",
"position"
],
"additionalProperties": false
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"line",
"order"
],
"additionalProperties": false
}
}
orders.remove_line
Remove an order line
Delete one line from an order and recalculate the total.
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"ok",
"id",
"order"
],
"additionalProperties": false
}
}
orders.attach_signed_quote
Attach the signed quote to an order
Record the customer's signed quote on an order. Either point at a document already uploaded (documentId) or send the file inline (file). Sets the signed-quote received date (today unless receivedOn is given) and, optionally, the balance remaining, so one call can make the order valid. Returns the new validity.
Input (object)
| Field | Type | Description |
|---|---|---|
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
documentId | string | An existing document to use as the signed quotemin length 1, max length 64 |
file | object | Upload the signed quote in this call instead |
filenamerequired | string | min length 1, max length 255 |
contentType | string | default "application/pdf", max length 100 |
contentBase64required | string | File bytes, base64 encoded (max 10 MB)min length 1 |
receivedOn | string (date) | Date the signed quote was received; defaults to today |
balanceRemainingCents | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
documentIdrequired | string | Record id (UUID)min length 1, max length 64 |
validityrequired | object | |
isValidrequired | boolean | True when the order has the signed quote, its received date and the balance remaining |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | Requirements still missing; empty when valid |
missingLabelsrequired | string[] | Human-readable names of the missing requirements |
Example request
curl https://api.cemco.app/v1/ops/orders.attach_signed_quote \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"orderId":"00000000-0000-4000-8000-000000000000","documentId":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"documentId": {
"description": "An existing document to use as the signed quote",
"type": "string",
"minLength": 1,
"maxLength": 64
},
"file": {
"description": "Upload the signed quote in this call instead",
"type": "object",
"properties": {
"filename": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"contentType": {
"default": "application/pdf",
"type": "string",
"maxLength": 100
},
"contentBase64": {
"type": "string",
"minLength": 1,
"description": "File bytes, base64 encoded (max 10 MB)"
}
},
"required": [
"filename",
"contentBase64"
]
},
"receivedOn": {
"description": "Date the signed quote was received; 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])))$"
},
"balanceRemainingCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
}
},
"required": [
"orderId"
]
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"documentId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"validity": {
"type": "object",
"properties": {
"isValid": {
"type": "boolean",
"description": "True when the order has the signed quote, its received date and the balance remaining"
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
},
"description": "Requirements still missing; empty when valid"
},
"missingLabels": {
"type": "array",
"items": {
"type": "string"
},
"description": "Human-readable names of the missing requirements"
}
},
"required": [
"isValid",
"missing",
"missingLabels"
],
"additionalProperties": false
}
},
"required": [
"order",
"documentId",
"validity"
],
"additionalProperties": false
}
}
orders.advance
Advance an order to the next stage
Move an order one step along the lifecycle: received, in_build, ready_to_ship, shipped, delivered, set_up, commissioned, trained, closed. An order cannot leave received until it is valid; otherwise the call fails with an invalid_order error whose details.missing lists what is needed. Each move writes an order event, emails the customer a status update and is audited. Moving to commissioned sets warranty start and end (12 months) on every machine of the order and creates the 30, 90 and 365-day check-ins. Pass toStage to state the stage you expect to reach; the call fails with a conflict if that is not the next stage.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
toStage | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | Guard: must equal the next stage |
occurredOn | string (date) | Date the stage was reached; defaults to today |
note | string | null | max length 2000 |
notifyCustomer | boolean | Send the status email to the account's primary contactdefault 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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
eventrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
fromStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
toStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
occurredOnrequired | string (date) | Date as YYYY-MM-DD |
noterequired | string | null | |
actorUserIdrequired | string | null | |
actorNamerequired | string | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
fromStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
toStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
machinesrequired | object[] | Machines whose status or warranty changed |
idrequired | string | Record id (UUID)min length 1, max length 64 |
serialNumberrequired | string | |
typerequired | "plant" | "mixer" | "silo" | "feeder" | "power_pack" | |
modelrequired | string | |
configurationrequired | string | null | |
optionsrequired | string[] | |
accountIdrequired | string | Current ownermin length 1, max length 64 |
siteIdrequired | string | null | Current sitemin length 1, max length 64 |
orderIdrequired | string | null | Order the machine was built formin length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "in_build" | "in_transit" | "operating" | "down" | "idle" | "retired" | |
builtOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
commissionedOnrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStartrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyEndrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStaterequired | "none" | "active" | "expiring" | "expired" | Computed from the warranty dates and today's date |
warrantyDaysLeftrequired | integer | null | Days until the warranty ends; negative once expired; null if not startedmin -9007199254740991, max 9007199254740991 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
checkInsrequired | object[] | Check-ins created (only when moving to commissioned) |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
kindrequired | "day_30" | "day_90" | "day_365" | "pre_season" | "ad_hoc" | |
dueOnrequired | string (date) | Date as YYYY-MM-DD |
statusrequired | "scheduled" | "completed" | "skipped" | |
completedOnrequired | string (date) | null | Date as YYYY-MM-DD |
outcomerequired | string | null | What was learned on the call or visit |
taskIdrequired | string | null | Task that puts the check-in on the agenda and calendarmin length 1, max length 64 |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
emailQueuedrequired | boolean |
Example request
curl https://api.cemco.app/v1/ops/orders.advance \
-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)"
},
"toStage": {
"description": "Guard: must equal the next stage",
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"occurredOn": {
"description": "Date the stage was reached; 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])))$"
},
"note": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
]
},
"notifyCustomer": {
"default": true,
"description": "Send the status email to the account's primary contact",
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"event": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"fromStage": {
"anyOf": [
{
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
{
"type": "null"
}
]
},
"toStage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"occurredOn": {
"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"
},
"note": {
"type": [
"string",
"null"
]
},
"actorUserId": {
"type": [
"string",
"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",
"orderId",
"fromStage",
"toStage",
"occurredOn",
"note",
"actorUserId",
"actorName",
"createdAt"
],
"additionalProperties": false
},
"fromStage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"toStage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"machines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"serialNumber": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"plant",
"mixer",
"silo",
"feeder",
"power_pack"
]
},
"model": {
"type": "string"
},
"configuration": {
"type": [
"string",
"null"
]
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Current owner"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Current site"
},
"orderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Order the machine was built for"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"in_build",
"in_transit",
"operating",
"down",
"idle",
"retired"
]
},
"builtOn": {
"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"
}
]
},
"commissionedOn": {
"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"
}
]
},
"warrantyStart": {
"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"
}
]
},
"warrantyEnd": {
"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"
}
]
},
"warrantyState": {
"type": "string",
"enum": [
"none",
"active",
"expiring",
"expired"
],
"description": "Computed from the warranty dates and today's date"
},
"warrantyDaysLeft": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Days until the warranty ends; negative once expired; null if not started"
},
"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"
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"description": "Machines whose status or warranty changed"
},
"checkIns": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"machineId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"orderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"kind": {
"type": "string",
"enum": [
"day_30",
"day_90",
"day_365",
"pre_season",
"ad_hoc"
]
},
"dueOn": {
"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"
},
"status": {
"type": "string",
"enum": [
"scheduled",
"completed",
"skipped"
]
},
"completedOn": {
"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"
}
]
},
"outcome": {
"description": "What was learned on the call or visit",
"type": [
"string",
"null"
]
},
"taskId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Task that puts the check-in on the agenda and calendar"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
}
},
"required": [
"id",
"accountId",
"machineId",
"orderId",
"kind",
"dueOn",
"status",
"completedOn",
"outcome",
"taskId",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"description": "Check-ins created (only when moving to commissioned)"
},
"emailQueued": {
"type": "boolean"
}
},
"required": [
"order",
"event",
"fromStage",
"toStage",
"machines",
"checkIns",
"emailQueued"
],
"additionalProperties": false
}
}
orders.set_financing
Set order financing
Record the lender for an order (Commercial Capital, Northland Capital, other, or none) and the approval status (pending, approved, declined, funded). There is no link to the lender's systems; this is a record only.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotes | string | null | max length 2000 |
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 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/orders.set_financing \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000","financingPartner":"none","financingStatus":"not_applicable"}'
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)"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"financingPartner",
"financingStatus"
]
},
"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)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"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"
}
]
},
"in_build": {
"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"
}
]
},
"ready_to_ship": {
"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"
}
]
},
"shipped": {
"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"
}
]
},
"delivered": {
"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"
}
]
},
"set_up": {
"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"
}
]
},
"commissioned": {
"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"
}
]
},
"trained": {
"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"
}
]
},
"closed": {
"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"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"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"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"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"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "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"
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"order"
],
"additionalProperties": false
}
}
orders.export
Export an order
Produce one order as a file: json (all fields), csv (line items) or html (a printable order summary with the timeline). The content is returned as text.
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/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
}
}
orders.add_document
Attach a document to an order
Link an existing document (purchase order, drawing, inspection report, photo) to an order, or upload one inline. For the signed quote use orders.attach_signed_quote instead.
Input (object)
| Field | Type | Description |
|---|---|---|
orderIdrequired | string | Record id (UUID)min length 1, max length 64 |
documentId | string | Record id (UUID)min length 1, max length 64 |
file | object | |
filenamerequired | string | min length 1, max length 255 |
contentType | string | default "application/pdf", max length 100 |
contentBase64required | string | File bytes, base64 encoded (max 10 MB)min length 1 |
kind | "signed_quote" | "quote" | "purchase_order" | "drawing" | "manual" | "inspection_report" | "photo" | "training_record" | "invoice" | "email_attachment" | "export" | "other" | default "other" |
customerVisible | boolean | default true |
Output (object)
| Field | Type | Description |
|---|---|---|
documentIdrequired | string | Record id (UUID)min length 1, max length 64 |
Example request
curl https://api.cemco.app/v1/ops/orders.add_document \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"orderId":"00000000-0000-4000-8000-000000000000","documentId":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"documentId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"file": {
"type": "object",
"properties": {
"filename": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"contentType": {
"default": "application/pdf",
"type": "string",
"maxLength": 100
},
"contentBase64": {
"type": "string",
"minLength": 1,
"description": "File bytes, base64 encoded (max 10 MB)"
}
},
"required": [
"filename",
"contentBase64"
]
},
"kind": {
"default": "other",
"type": "string",
"enum": [
"signed_quote",
"quote",
"purchase_order",
"drawing",
"manual",
"inspection_report",
"photo",
"training_record",
"invoice",
"email_attachment",
"export",
"other"
]
},
"customerVisible": {
"default": true,
"type": "boolean"
}
},
"required": [
"orderId"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"documentId"
],
"additionalProperties": false
}
}