Cost Categories
Cost Categories are used to breakdown purchase order costs into different categories (i.e. Material, Labor, etc). Cost Categories can defined per-phase for phase codes related to jobs. They can also be defined per-job or globally for the organization
Schema​
Cost Category
​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The unique ID | "ckmnpybisiy5x08abky4g2d1f" |
createdAt | DateTime | When this cost category was created | "2021-03-24 17:26:46.983Z" |
code | string | The human-readable code to identify this cost category | "M" |
phase.id | ID | The ID of the associated phase | See Phases docs |
phase.code | string | The code of the associated phase | See Phases docs |
description | string | A description of this cost category | "Material" |
job.id | ID | The id of the job this cost category is associated with | See Jobs docs |
job.code | string | The code of the job this cost category is associated with | See Jobs docs |
updatedAt | DateTime | When this cost category was last modified | "2021-03-24 17:26:46.983Z" |
REST Endpoints (Global Categories)​
GET /global-categories
​
Reads all global categories (without associated phase)
Parameters​
Accepts all standard pagination parameters
Allowed orderBy fields: code
, createdAt
, description
, id
, updatedAt
.
Allowed filter fields: code
, createdAt
, description
, id
, updatedAt
.
Response​
A list of CostCategory[]
objects
Example Request​
GET https://api.kojo.tech/global-categories?limit=10
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
POST /global-categories
​
Creates a global cost category
Parameters​
Name | Type | Description | Example |
---|---|---|---|
code | string | A unique human-readable code to represent this cost category | "L" |
description | string | A description of the cost category | "Lighting" |
Example Request​
POST https://api.kojo.tech/global-categories
{
"code": "M",
"description": "Material",
}
Response​
The created CostCategory
object
Example Response​
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
GET /global-categories/:idOrCode
​
Reads a single global cost category
Parameters​
Name | Type | Description | Example |
---|---|---|---|
code | string | A unique human-readable code to represent this cost category | "M" |
id | ID | The cost category ID | "ckmnpybisiy5x08abky4g2d1f" |
Response​
A single CostCategory
object
Example Request​
GET https://api.kojo.tech/global-categories/ckmnpybisiy5x08abky4g2d1f
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
PATCH /global-categories/:idOrCode
​
Updates a single global cost category
Parameters​
Name | Type | Description | Example |
---|---|---|---|
code | string | A unique human-readable code to represent this cost category | "M" |
id | ID | The cost category ID | "ckmnpybisiy5x08abky4g2d1f" |
description | string | The cost category ID | "Material" |
Response​
A single CostCategory
object
Example Request​
PATCH https://api.kojo.tech/global-categories/ckmnpybisiy5x08abky4g2d1f
{
"description": "Material",
}
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-29 20:26:46.983Z"
}
]
DELETE /global-categories/:id
​
Deletes a single global cost category
Response​
A single CostCategory
object
Example Request​
DELETE https://api.kojo.tech/global-categories/ckmnpybisiy5x08abky4g2d1f
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-29 20:26:46.983Z",
"deletedAt": "2021-03-29 20:26:46.983Z"
}
]
REST Endpoints (Phase-Related Categories)​
Cost cateogories related to phase codes and thus jobs are accessed via a nested URL structure which includes the associated Phase
and Job
information in the URL. All phase-related cost categories can be queried and filtered via the /phase-categories
endpoint
GET /phase-categories
​
Reads all phase-related cost categories
Parameters​
Accepts all standard pagination parameters
Allowed orderBy fields: code
, createdAt
, description
, id
, updatedAt
Allowed filter fields: code
, createdAt
, description
, id
, updatedAt
Response​
A list of CostCategory[]
objects
Example Request​
GET https://api.kojo.tech/phase-categories?limit=10
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
GET /jobs/:jobIdOrCode/phases/:phaseIdOrCode/categories
​
Reads all cost categories associated with the provided phase and job
Parameters​
Accepts all standard pagination parameters
Allowed orderBy fields: code
, createdAt
, description
, id
, updatedAt
Allowed filter fields: code
, createdAt
, description
, id
, updatedAt
Response​
A list of CostCategory[]
objects
Example Request​
GET https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/phases/ckmnpasdfzc5y081fasdf425da/categories
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
POST /jobs/:jobIdOrCode/phases/:phaseIdOrCode/categories
​
Creates a phase-related cost category.
Parameters​
Name | Type | Description | Example |
---|---|---|---|
code | string | A unique human-readable code to represent this cost category | "L" |
description | string | A description of the cost category | "Lighting" |
phaseCode | string | The code of the phase this cost category is linked to | "01-300" |
phaseId | ID | The ID of the phase this cost category is linked to | "ckmnpybisiy5x08abky4g2d1f" |
jobCode | string | The code of the job this cost category is linked to | "01-300" |
jobId | ID | The ID of the job this cost category is linked to | "ckmnpybisiy5x08abky4g2d1f" |
Example Request​
POST https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/phases/ckmnpasdfzc5y081fasdf425da/categories
{
"code": "M",
"description": "Material",
}
Response​
The created CostCategory
object.
Example Response​
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
GET /jobs/:jobIdOrCode/phases/:phaseIdOrCode/categories/:categoryIdOrCode
​
Reads a single cost category associated with a phase
Parameters​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The cost category ID | "ckmnpybisiy5x08abky4g2d1f" |
Response​
A single CostCategory
object.
Example Request​
GET https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/phases/ckmnpasdfzc5y081fasdf425da/categories/dxxnpybisiy5x08abky4g5dag
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
PATCH /jobs/:jobIdOrCode/phases/:phaseIdOrCode/categories/:categoryIdOrCode
​
Updates a single cost category
Parameters​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The cost category ID | "ckmnpybisiy5x08abky4g2d1f" |
Response​
The updated CostCategory
object.
Example Request​
PATCH https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/phases/ckmnpasdfzc5y081fasdf425da/categories/dxxnpybisiy5x08abky4g5dag
{
"description": "Material",
}
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-29 20:26:46.983Z"
}
]
DELETE /jobs/:jobIdOrCode/phases/:phaseIdOrCode/categories/:id
​
Deletes a single cost category
Response​
The deleted CostCategory
object.
Example Request​
DELETE https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/phases/ckmnpasdfzc5y081fasdf425da/categories/dxxnpybisiy5x08abky4g5dag
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "dxxnpybisiy5x08abky4g5dag",
"jobId": "ckmnpybixiy5y0817spfhmj78",
"phaseId": "ckmnpasdfzc5y081fasdf425da",
"updatedAt": "2021-03-29 20:26:46.983Z",
"deletedAt": "2021-03-29 20:26:46.983Z"
}
]
REST Endpoints (Job-Related Categories)​
Cost cateogories related directly to jobs (and not to a phase code) are accessed via a nested URL structure which includes the associated Job
information in the URL. All job-related cost categories can be queried and filtered via the /job-categories
endpoint
GET /job-categories
​
Reads all job-related cost categories
Parameters​
Accepts all standard pagination parameters
Allowed orderBy fields: code
, createdAt
, description
, id
, updatedAt
Allowed filter fields: code
, createdAt
, description
, id
, updatedAt
Response​
A list of CostCategory[]
objects
Example Request​
GET https://api.kojo.tech/job-categories?limit=10
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
GET /jobs/:jobIdOrCode/categories
​
Reads all cost categories associated with the provided job
Parameters​
Accepts all standard pagination parameters
Allowed orderBy fields: code
, createdAt
, description
, id
, updatedAt
Allowed filter fields: code
, createdAt
, description
, id
, updatedAt
Response​
A list of CostCategory[]
objects
Example Request​
GET https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/categories
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
POST /jobs/:jobIdOrCode/categories
​
Creates a job-related cost category.
Parameters​
Name | Type | Description | Example |
---|---|---|---|
code | string | A unique human-readable code to represent this cost category | "L" |
description | string | A description of the cost category | "Lighting" |
Example Request​
POST https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/categories
{
"code": "M",
"description": "Material",
}
Response​
The created CostCategory
object.
Example Response​
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
GET /jobs/:jobIdOrCode/categories/:categoryIdOrCode
​
Reads a single cost category associated with a job
Parameters​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The cost category ID | "ckmnpybisiy5x08abky4g2d1f" |
Response​
A single CostCategory
object.
Example Request​
GET https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/categories/dxxnpybisiy5x08abky4g5dag
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]
PATCH /jobs/:jobIdOrCode/categories/:categoryIdOrCode
​
Updates a single cost category associated with a job
Parameters​
Name | Type | Description | Example |
---|---|---|---|
description | string | The cost category ID | "Material" |
Response​
The updated CostCategory
object.
Example Request​
PATCH https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/categories/dxxnpybisiy5x08abky4g5dag
{
"description": "Material",
}
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "dxxnpybisiy5x08abky4g5dag",
"jobId": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-29 20:26:46.983Z"
}
]
DELETE /jobs/:jobIdOrCode/categories/:id
​
Deletes a single cost category associated with a job
Response​
The deleted CostCategory
object.
Example Request​
DELETE https://api.kojo.tech/jobs/ckmnpybixiy5y0817spfhmj78/categories/dxxnpybisiy5x08abky4g5dag
Example Response​
[
{
"code": "M",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Material",
"id": "ckmnpybixiy5y0817spfhmj78",
"jobId": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-29 20:26:46.983Z",
"deletedAt": "2021-03-29 20:26:46.983Z"
}
]