PATCH /other-costs/{otherCostId}

Update a Other Cost

This endpoint allows you to update an Other Cost. Only users with the role "admin" or "manager" can perform this operation.

Operation ID: updateOtherCost
lock This endpoint requires a Bearer token in the Authorization header.

Path Parameters

Name Type Description
otherCostId required
path
string

The Other Cost ID

Request Body

Content-Type: application/json

name string

The name (or description) of the Other Cost

Example: Contractual Labor

input_type string

The type of Other Cost. Different types of Other Costs have different associated fields. Other Costs of type resource will measure its total cost based on how long (e.g. hours, minutes) the resource is occupied. Other Costs of type distance will measure its total cost based on how many units (e.g. meters, kilometers) are needed. Other Costs of type interval and time_range will measure its total cost based on duration. Other Costs of type currency will have a fixed cost manually defined for each operation. Other Costs of type custom_unit_of_measurement will measure its total cost based on how many units (e.g. m3, liters) are needed.

currency distance interval time_range resource custom_unit_of_measurement

Example: currency

failure boolean

Indicates if the Other Cost can be included in costs for Corrective Maintenance (Work Orders)

Example: 1

schedule_work boolean | null

Indicates if the Other Cost can be included in costs for Preventive Maintenance (Planned Job Orders)

Example: 1

operator boolean | null

Indicates if the Other Cost can be included in individual costs for operators (technicians)

Example: 1

element boolean | null

Indicates if the Other Cost can be included in costs for Assets

Example: 1

icon string

The icon to be presented for the Other Cost in Infraspeak platform.

truck car clock-o bed user usd cutlery wrench

Example: truck

cost_per_unit number | null

Cost per unit of the Other Cost. Only applicable if input_type is "resource", "distance" or "custom_unit_of_measurement"

default_sell_price number | null

Default sell price of the Other Cost. Only applicable if input_type is "resource", "distance" or "custom_unit_of_measurement"

default_sell_vat number | null

Default sale VAT/IVA percentage of the Other Cost. Only applicable if input_type is "resource", "distance" or "custom_unit_of_measurement"

unit string | null

Unit of the Other Cost. Only applicable if input_type is "resource", "distance" or "custom_unit_of_measurement"

Responses

data object

Other Cost model structure details

id string required read-only

The ID of the Other Cost

Example: 123

type string required read-only

Model type

other-cost

Example: other-cost

attributes object required
other_cost_id integer read-only

The ID of the Other Cost

Example: 123

entity_id integer read-only

The ID of the Entity

Example: 123

input_type string

The type of Other Cost. Different types of Other Costs have different associated fields. Other Costs of type resource will measure its total cost based on how long (e.g. hours, minutes) the resource is occupied. Other Costs of type distance will measure its total cost based on how many units (e.g. meters, kilometers) are needed. Other Costs of type interval and time_range will measure its total cost based on duration. Other Costs of type currency will have a fixed cost manually defined for each operation. Other Costs of type custom_unit_of_measurement will measure its total cost based on how many units (e.g. m3, liters) are needed.

currency distance interval time_range resource custom_unit_of_measurement

Example: currency

name string

The name (or description) of the Other Cost

Example: Contractual Labor

failure boolean

Indicates if the Other Cost can be included in costs for Corrective Maintenance (Work Orders)

Example: 1

schedule_work boolean | null

Indicates if the Other Cost can be included in costs for Preventive Maintenance (Planned Job Orders)

Example: 1

operator boolean | null

Indicates if the Other Cost can be included in individual costs for operators (technicians)

Example: 1

icon string

The icon to be presented for the Other Cost in Infraspeak platform.

truck car clock-o bed user usd cutlery wrench

Example: truck

element boolean | null

Indicates if the Other Cost can be included in costs for Assets

Example: 1

cost_per_unit number | null

Cost per unit of the Other Cost. Specific for input_type "resource", "distance" or "custom_unit_of_measurement"

Example: 2.5

default_sell_price number | null

Default sell price of the Other Cost. Specific for input_type "resource", "distance" or "custom_unit_of_measurement"

Example: 4

default_sell_vat number | null

Default sale VAT/IVA percentage of the Other Cost. Specific for input_type "resource", "distance" or "custom_unit_of_measurement"

Example: 23

unit string | null

Unit of the Other Cost. Specific for input_type "resource", "distance" or "custom_unit_of_measurement"

relationships object

The relationships of the Other Cost (Only present when expanded in the request)

customClientPrices object

The Custom Client Prices associated with the Other Cost

entity object

The Entity where the Other Cost belongs

status string
error
error object
properties object

Only present when related to property validation error

dev_message string

Example: Property validation error. Check the "properties" section in the response.

http_code integer
400
message string

Example: Property validation error.

more_info string
status string
error
error object
http_code integer
401
message string

Example: Authentication token invalid.

more_info string
status string
error
error object
http_code integer
404
message string

Example: Resource not found

more_info string | null
status string
error
error object
http_code integer
429
message string

Example: Too Many Requests.

more_info string
status string
error
error object
http_code integer
500
message string

Example: An error has occurred during the request.

more_info string