---
title: "Create new cost on a work order"
method: POST
path: "/workorders/{id}/costs"
tags: ["Work Orders"]
---

# Create new cost on a work order

`POST /workorders/{id}/costs`

## Path parameters

- `id` integer, required

## Query parameters

- `skipWebhook` boolean

## Request body

- union
  - object
    - `type` 'EXPENSE', required — Type of the entry
    - `costType` 'LABOR' | 'OTHER' | 'TRAVEL', required — Cost type
    - `costPerUnit` number, nullable, required — Cost per unit in cents.
    - `description` string, nullable — Description of the expense or the time cost
  - object
    - `type` 'TIME', required — Type of the entry
    - `costType` 'INSPECTION' | 'OTHER' | 'WORK', required — Cost type.
    - `durationTotal` number, nullable, required — Total duration, in seconds.
    - `hourlyRate` number, nullable — Hourly rate, in cents
    - `description` string, nullable — Description of the expense or the time cost

## Response `201`

Successfully created the cost

- object
  - `type` 'EXPENSE' | 'PART' | 'TIME' — Type of the entry
  - `costPerUnit` number, nullable — Cost per part in cents or cents per hour
  - `description` string, nullable — Description of the expense or part description
  - `quantity` number — Number of parts or number of hours
  - `rowTotal` number — Total cost in cents
  - `durationTotal` number — Total duration in seconds
  - `userId` integer, nullable — ID of the user who logged the time entry
  - `partId` integer, nullable — ID of the part used in this cost entry
  - `total` number, required — Total cost in cents of the Work order
  - `id` number, required — Created cost Id

## Other responses

- `400` — Failed to create the cost
- `401` — Invalid token
- `404` — Could not find the specified Work Order.

---

[API](https://skmtc.net/getmaintainx/apis/maintainx-api.md) · [All operations](https://skmtc.net/getmaintainx/apis/maintainx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getmaintainx/maintainx-api/revisions/ef9153fcac7c/schema)
