---
title: "Unit Action"
method: POST
path: "/api/inventory/units/{unit_id}/action"
tags: ["inventory"]
---

# Unit Action

`POST /api/inventory/units/{unit_id}/action`

## Request

- Base URL: `https://api.electricair.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.electricair.io/api/inventory/units/{unit_id}/action`
- Auth: none declared

## Path parameters

- `unit_id` integer, required

## Request body

- UnitActionRequest
  - `action` 'allocate' | 'install' | 'back_to_stock' | 'return' | 'scrap' | 'serial' | 'note' | 'move' | 'pack' | 'cost', required
  - `job_id` integer, nullable
  - `job_item_id` integer, nullable
  - `location_id` integer, nullable
  - `location_code` string
  - `reference` string
  - `reason` string
  - `serial_number` string
  - `unit_cost` union
    - number
    - string
  - `notes` string

## Response `200`

OK

- StockUnitDetailSchema
  - `unit` StockUnitSchema, required
    - `id` integer, required
    - `product_id` integer, required
    - `product_name` string, required
    - `serial_number` string, required
    - `status` string, required
    - `status_label` string, required
    - `location` LocationRefSchema
      - `id` integer, required
      - `code` string, required
      - `name` string, required
      - `path` string, required
      - `kind` string, required
    - `unit_cost` number, nullable
    - `cost_source` string
    - `received_on` string, date, nullable
    - `receipt_reference` string
    - `supplier` string
    - `job` UnitJobSchema
      - `id` integer, required
      - `number` string, required
      - `customer_name` string, required
    - `installed_at` string, date-time, nullable
    - `packed_at` string, date-time, nullable
    - `disposition_reference` string, required
    - `notes` string, required
  - `movements` MovementSchema[], required
    - `id` integer, required
    - `created_at` string, date-time, required
    - `from_status` string, required
    - `to_status` string, required
    - `to_label` string, required
    - `from_location` string, nullable
    - `to_location` string, nullable
    - `job_number` string, nullable
    - `user_name` string, nullable
    - `notes` string, required
  - `cost_changes` CostChangeSchema[], required
    - `id` integer, required
    - `created_at` string, date-time, required
    - `unit_id` integer, required
    - `product_name` string, required
    - `serial_number` string, required
    - `old_cost` union
      - number
      - string
    - `old_source` string, required
    - `new_cost` union, required
      - number
      - string
    - `new_source` string, required
    - `change` union, required
      - number
      - string
    - `receipt_reference` string, required
    - `user_name` string, nullable
    - `notes` string, required
  - `photos` StockPhotoSchema[], required
    - `id` integer, required
    - `url` string, required
    - `caption` string, required
    - `created_at` string, date-time, required
    - `taken_by` string, nullable
    - `ready` boolean, required

## Changes

> 22 revisions in range; 1 not diffed.

- **2026-10-31** `1b3bacde7088`: 4 info
  - added the new optional request property `unit_cost`
  - added the new `cost` enum value to the request property `action`
  - added the optional property `unit/cost_source` to the response with the `200` status
  - added the required property `cost_changes` to the response with the `200` status
- **2026-10-28** `558d42db3b2e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/electricair/apis/electric-air-autoquote-api/changes/api/inventory/units/:unit_id/action/post.md)

---

[API](https://skmtc.dev/electricair/apis/electric-air-autoquote-api.md) - [All operations](https://skmtc.dev/electricair/apis/electric-air-autoquote-api/llms.txt) - [OpenAPI document](https://skmtc.dev/electricair/apis/electric-air-autoquote-api/revisions/a13d832a5676?raw)
