Represents a cost that is not a material, for example subcontracting, waste disposal, or another operational charge. In the Excel templates, cost lines are registered on the Cost lines sheet.
Cost lines are used when a cost belongs to an activity but is not represented by a consumed material. Utilities such as water and electricity are registered as materials, not as cost lines.
Cost lines are a shared entity. They work the same way in every manufacturing domain model.
The Cost line object
{
"code": "CL-DISPOSAL",
"name": "Waste disposal",
"unit": "t"
}
Fields
| Field | Type | Description | Example |
|---|---|---|---|
code |
string | Unique business code used to identify the cost line in external systems and integrations. | "CL-DISPOSAL" |
name |
string | Human-readable name of the cost line. | "Waste disposal" |
unit |
string or null | Unit in which quantities of the cost line are stated. | "t" |
Important
code must be unique. Two cost lines cannot use the same code.
API resource
| Resource | Base path |
|---|---|
Cost line |
/manufacturing/v1/cost-lines |
For the operations shared by all shared entities, see Shared entities API.
API methods
Create a cost line
POST /manufacturing/v1/cost-lines/insert
Creates a new cost line and returns its Pulse identifier.
Request
POST /manufacturing/v1/cost-lines/insert
Content-Type: application/json
{
"code": "CL-DISPOSAL",
"name": "Waste disposal",
"unit": "t"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | yes | Unique business code of the cost line. |
name |
string | yes | Human-readable name of the cost line. |
unit |
string or null | no | Unit in which quantities of the cost line are stated. |
Update a cost line
PUT /manufacturing/v1/cost-lines/update
Updates an existing cost line. The cost line must already exist.
An update replaces all fields. If you leave out unit, it is removed. To change only some fields, use patch.
Request
PUT /manufacturing/v1/cost-lines/update
Content-Type: application/json
{
"code": "CL-DISPOSAL",
"name": "Industrial waste disposal",
"unit": "t"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | yes | Business code of the cost line to update. |
name |
string | yes | Human-readable name of the cost line. |
unit |
string or null | no | Unit in which quantities of the cost line are stated. |
Patch a cost line
PATCH /manufacturing/v1/cost-lines/patch
Partially updates an existing cost line.
The fields to update are supplied in the properties object. The cost line is identified by its business code, which cannot be changed. Fields you leave out keep their current values. To remove the unit, send it as null.
Request
PATCH /manufacturing/v1/cost-lines/patch
Content-Type: application/json
{
"properties": {
"code": "CL-DISPOSAL",
"unit": "kg"
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
properties |
object | yes | Fields included in the partial update. |
properties.code |
string | yes | Business code of the cost line to update. |
properties.name |
string | no | New name of the cost line. |
properties.unit |
string or null | no | New unit, or null to remove it. |
Retrieve a cost line
GET /manufacturing/v1/cost-lines/select
Returns the cost line identified by its business code. If no cost line has this code, the response is empty.
Request
GET /manufacturing/v1/cost-lines/select?id=CL-DISPOSAL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Business code of the cost line to retrieve. |
Example response
{
"code": "CL-DISPOSAL",
"name": "Waste disposal",
"unit": "t"
}
List cost lines
GET /manufacturing/v1/cost-lines/query
Returns cost lines matching the supplied filters.
Request
GET /manufacturing/v1/cost-lines/query?units=t
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
codes |
string or array of strings | no | Limits results to cost lines with the specified business codes. |
names |
string or array of strings | no | Limits results to cost lines with the specified names. Upper and lower case are not distinguished. |
units |
string or array of strings | no | Limits results to cost lines with the specified units. Upper and lower case are not distinguished. |
Example response
[
{
"code": "CL-DISPOSAL",
"name": "Waste disposal",
"unit": "t"
}
]
Delete a cost line
DELETE /manufacturing/v1/cost-lines/delete
Deletes the cost line identified by its business code. If no cost line has this code, nothing happens.
Request
DELETE /manufacturing/v1/cost-lines/delete?id=CL-DISPOSAL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Business code of the cost line to delete. |