Skip to main content

Change Orders

Each time you create a Change Order on a Purchase Order in Kojo, a new Order Version is created. These versions are numbered sequentially, with the initial Order being defined as Version 0. A Change Order is considered to be a Draft until the Complete this Change Order button is pressed. Drafts will be ignored unless explicitly requested in the endpoint parameters.

Schema​

ChangeOrder​

NameTypeDescriptionExample
idIDUnique identifier for Change Order"ckmnpybisiy5x08abky4g2d1f"
createdAtDateTimeWhen this Change Order was created"2024-03-24 17:26:46.983Z"
createdByIdIDThe user id who created this Change Order"clsntgbse000008l46x9h2kme"
orderIdIDUnique identifier for Order"cldccq7ah0003lg6jnh8xhl01"
labelstring?Label given to Change Order"Adjust Unit Price"
notestring?Note applied to Change Order"The vendor told us that we could take 10% off the unit price."
versionNumberintNumber assigned to Change Order4
modifiedOrderValuesJSON - Subset of OrderDiffOrder values that have been mutated in this Change Order.See below.
addedItemsJSON Array - ItemDiffAny order items that been added within this Change Order.See below.
deletedItemsJSON Array - ItemDiffAny order items that have been deleted in this Change Order.See below.
modifiedItemsJSON Array - Subset of ItemDiffValues from already existing order items that have been mutated in this Change Order.See below.

OrderDiff​

The modifiedOrderValues JSON object will only return order values that have changed in this Change Order compared to the prior Change Order. If a key in the modifiedOrderValues JSON is assigned a null, it can be assumed that the field's value was deleted in this Change Order.

NameTypeDescriptionExample
idIDUnique identifier for the order"ckmnpybisiy5x08abky4g2d1f"
createdAtDateTimeWhen the order was created"2024-03-24 17:26:46.983Z"
customColumnValuestring?Value associated with the custom column"438076873"
deliveryInstructionsstring?Additional instructions for how to deliver the items"Gate code is 1234"
deliveryLocationIdID?Delivery location ID for this orderSee Location docs
discountfloat?The dollar amount of discounts to subtract from the order total125.60
fieldContactNamestring?Name of the field contact receiving the order"John Doe"
fieldContactPhonestring?Phone number of the field contact receiving the order"8001854367"
flaggedboolean?Tracks whether the order has been flagged with an issuetrue
flaggedAtDateTime?The date/time this order was flagged"2021-03-24 17:26:46.983Z"
flagMessagestring?User's description of the flagged issue with this order"Missing items"
glCodeIdID?The ID of the default GL code to use for items in this orderSee GL Code docs
integrationLastSyncDateTime?(Read-only) Last time the order's integrationState was updated to LINKED"2021-03-24 17:26:46.983Z"
integrationStateIntegrationState?The status of the order's sync to another integrated systemNOT_LINKED
jobIdID?The id for the job this order belongs toSee Job docs
modeOrderMode?The mode the order originated inREQUEST_FOR_QUOTE
needByDateDayDateTime?The date the order is needed by"2021-03-24 17:26:46.983Z"
needByWindowNeedByWindow?Window the order should be delivered byPMLate
notesstring?Additional handwritten details attached to this order"Call when arrives"
purchaseOrderNumberstring?User-defined value to identify this order"1234"
receivedStateReceivedState?
The state of the deliveries associated with the PO
"FULLY_RECEIVED"
shippingCostfloat?The dollar amount of shipping costs to add to the order total1200.30
stateOrderState?The current state of the orderBID_ACTIVE
taxCodeIdID?The ID of the default tax code to use for items in this orderSee Tax Code docs
taxExemptboolean?Indicates that the order is exempt from any and all tax rates entered on line itemstrue
totalfloat?The total due for the order184.33
updatedAtDateTimeWhen the order was last updated"2024-03-24 17:26:46.983Z"
typeOrderType?Type of order, either STANDARD or HOLD_FOR_RELEASESTANDARD
vendorIdID?The vendorId associated with this orderSee Vendor docs

ItemDiff​

The modifiedItems JSON array will only return item values that have been mutated in this Change Order. If a key in modifiedItems is assigned a null value, it can be assumed that the corresponding value was deleted in this Change Order. modifiedItems will always contain id, lineNumber, createdAt, and updatedAt.

The addedItems and deletedItems arrays will always contain all of the keys listed in this schema.

NameTypeDescriptionExample
idIDUnique identifier for this item"ckmnpybisiy5x08abky4g2d1f"
backorderLeadTimeDateTime?Lead time for a backordered item"2024-03-24 17:26:46.983Z"
backorderQuantityfloat?Amount on backorder for a backordered item20.0
costCategorystring?Cost Category code of the item"M" - See Cost Category docs
createdAtDateTimeWhen the item was created"2024-03-24 17:26:46.983Z"
customColumnValuestring?Value associated with the custom column"438076873"
descriptionstring?Description of the item"3/4" EMT"
extPricefloat?EXT Price of the item125.00
itemCodeIdID?ID of the Item Code for the item"ckmnpybisiy5x08abky4g2d1f"
lineNumberintNumber representing the index of the line item within it's order3
manufacturerstring?Name of the manufacturer for this item"Marcus Manufacturing"
manufacturerPartNumberstring?Manufacturer part number for this item (MPN)"267254567"
needByDateDateTime?When this item is needed by"2024-03-24 17:26:46.983Z"
notesstring?Additional handwritten details attached to this item"Requested ASAP"
phasestring?Phase Code of the item"Rough-in" - See Phase docs
quantityfloat?Quantity of this item100.0
taxCodestring?Tax code of the item"NYC" - See Tax Code docs
taxRatefloat?Tax rate of the item0.025 - See Tax Code docs
unitDiscountfloat?Discount being applied to the item (precision of 13)1.25
unitPricefloat?Unit price of the item1.25
unitsOfMeasurestring?Unit of measurement for this item"EA"
universalProductCodestring?Universal product code for this item (UPC)"037000282525"
updatedAtDateTimeWhen this item was last updated"2024-03-24 17:26:46.983Z"
vendorPartNumberstring?Part number for this item in the vendor's catalog"73595677"

REST Endpoints​

GET /changeOrders/:changeOrderId​

This endpoint provides a single Change Order by its ID.

Query Parameters​

NameDescriptionExample
changeOrderIdThe ID of the Change Order to fetch"ckmnpybisiy5x08abky4g2d1f"

Response​

The ChangeOrder object.

Example Request​

GET https://api.kojo.tech/changeOrders/ckmnpybisiy5x08aasdf13242

Example Response​

{
"id": "ckmnpybisiy5x08aasdf13242",
"createdAt": "2024-01-25 17:26:46.983Z",
"orderId": "cls0zixkq004jjc1pjy8bwvt5",
"label": "Marcus's Change Order",
"note": "This was requested by Phillip.",
"versionNumber": "5",
"modifiedOrderValues": {
"shippingCost": 123.45,
"notes": "Please process ASAP",
"glCodeId": null
},
"addedItems": [
{
"id": "cls9lapp1000oa17uwim720lz",
"createdAt": "2024-02-06T00:06:59.632Z",
"updatedAt": "2024-02-06T00:06:59.632Z",
"backorderLeadTime": null,
"backorderQuantity": null,
"costCategory": "L",
"customColumnValue": null,
"description": "RT EMT CONN",
"extPrice": 40,
"itemCodeId": null,
"lineNumber": 5,
"manufacturer": null,
"manufacturerPartNumber": null,
"needByDate": null,
"notes": null,
"phase": "1-002",
"quantity": 2,
"taxCode": "OR",
"taxRate": 0.025,
"unitDiscount": null,
"unitPrice": 20,
"unitsOfMeasure": "EA",
"universalProductCode": null,
"vendorPartNumber": null
}
],
"deletedItems": [],
"modifiedItems": [
{
"id": "cjzu0wx37o1cs0985gp2y4qn2",
"lineNumber": 3,
"createdAt": "2024-01-06 17:26:46.983Z",
"updatedAt": "2024-01-25 17:26:46.983Z",
"description": "CHANNEL SUPPORT"
},
{
"id": "cjzu2j4n0pnt30985f1o18rfa",
"lineNumber": 4,
"createdAt": "2024-01-06 17:26:46.983Z",
"updatedAt": "2024-01-26 17:26:46.983Z",
"quantity": 15,
"extPrice": 376.12
},
],
}

GET /changeOrders​

This endpoint provides a feed of any Change Orders that have been created for a given organization. This endpoint only returns up to 10 ChangeOrders at a time.

Each time you create a Change Order on a Purchase Order in Kojo, a new Order Version is created. These versions are numbered sequentially, with the initial Order being defined as Version 0. A Change Order is considered to be a Draft until the Complete this Change Order button is pressed. Drafts will be ignored unless explicitly requested in the endpoint parameters.

Query Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: createdAt, updatedAt.

Allowed filter fields: createdAt, draft, id, orderId, updatedAt.

Response​

A list of ChangeOrder objects.

Example Request​

GET https://api.kojo.tech/changeOrders

Example Response​

[
{
"id": "ckmnpybisiy5x08aasdf13242",
"createdAt": "2024-01-25 17:26:46.983Z",
"orderId": "cls0zixkq004jjc1pjy8bwvt5",
"label": "Marcus's Change Order",
"note": "This was requested by Phillip.",
"versionNumber": "5",
"modifiedOrderValues": {
"shippingCost": 123.45,
"notes": "Please process ASAP",
"glCodeId": null
},
"addedItems": [
{
"id": "cls9lapp1000oa17uwim720lz",
"createdAt": "2024-02-06T00:06:59.632Z",
"updatedAt": "2024-02-06T00:06:59.632Z",
"backorderLeadTime": null,
"backorderQuantity": null,
"costCategory": "L",
"customColumnValue": null,
"description": "RT EMT CONN",
"extPrice": 40,
"itemCodeId": null,
"lineNumber": 5,
"manufacturer": null,
"manufacturerPartNumber": null,
"needByDate": null,
"notes": null,
"phase": "1-002",
"quantity": 2,
"taxCode": "OR",
"taxRate": 0.025,
"unitDiscount": null,
"unitPrice": 20,
"unitsOfMeasure": "EA",
"universalProductCode": null,
"vendorPartNumber": null
}
],
"deletedItems": [],
"modifiedItems": [
{
"id": "cjzu0wx37o1cs0985gp2y4qn2",
"lineNumber": 3,
"createdAt": "2024-01-06 17:26:46.983Z",
"updatedAt": "2024-01-25 17:26:46.983Z",
"description": "CHANNEL SUPPORT"
},
{
"id": "cjzu2j4n0pnt30985f1o18rfa",
"lineNumber": 4,
"createdAt": "2024-01-06 17:26:46.983Z",
"updatedAt": "2024-01-26 17:26:46.983Z",
"quantity": 15,
"extPrice": 376.12
},
],
},
{
"id": "cls9l9hxy0007c73h4o4desrz",
"createdAt": "2024-01-30 17:26:46.983Z",
"orderId": "cls9l9vph000na17ucnn8h72s",
"label": "Bob's Change Order",
"note": "This was requested by Henderson.",
"versionNumber": "3",
"modifiedOrderValues": {
"shippingCost": 123.45,
"notes": "Please process ASAP",
"glCodeId": null
},
"addedItems": [],
"deletedItems": [
{
"id": "cls9lapp1000oa17uwim720lz",
"createdAt": "2024-02-06T00:06:59.632Z",
"updatedAt": "2024-02-06T00:06:59.632Z",
"backorderLeadTime": null,
"backorderQuantity": null,
"costCategory": "L",
"customColumnValue": null,
"description": "Junction Boxes",
"extPrice": 2,
"itemCodeId": null,
"lineNumber": 5,
"manufacturer": null,
"manufacturerPartNumber": null,
"needByDate": null,
"notes": null,
"phase": "1-005",
"quantity": 2,
"taxCode": "OR",
"taxRate": 0.025,
"unitDiscount": null,
"unitPrice": 4,
"unitsOfMeasure": "EA",
"universalProductCode": null,
"vendorPartNumber": null
}
],
"modifiedItems": [
{
"id": "cjzu0wx37o1cs0985gp2y4qn2",
"lineNumber": 10,
"createdAt": "2024-01-06 17:26:46.983Z",
"updatedAt": "2024-01-25 17:26:46.983Z",
"description": "Putty"
},
{
"id": "cjzu2j4n0pnt30985f1o18rfa",
"lineNumber": 11,
"createdAt": "2024-01-06 17:26:46.983Z",
"updatedAt": "2024-01-26 17:26:46.983Z",
"quantity": 6,
"extPrice": 76.12
},
],
}
]

POST /changeOrders/:changeOrderId/integrationState​

This endpoint allows you to update the integrationState of a Change Order.

Query Parameters​

NameTypeDescriptionExample
changeOrderIdIDUnique identifier for change orders"ckmnpybisiy5x08abky4g2d1f"
integrationMessagestring?A message about the status of the integration's sync"PO number already exists"
integrationStateIntegrationStateThe new status of the change order's sync to your integrated systemNOT_LINKED

Response​

A boolean indicating success.

Example Request​

POST https://api.kojo.tech/changeOrders/ckmnpybisiy5x08abky4g2d1f/integrationState
{
"integrationState": "LINKED",
"integrationMessage": ""
}

Example Response​

true