# InvenTree

> Keep stock right in InvenTree from workflows: look up parts and their stock, add parts, add, remove, count and move stock, make purchase orders and receive them, and make and ship sales orders. Start a workflow when a part drops below its minimum stock, or a sales or purchase order is added.

App · 17 actions. Web page: https://docs.lodol.com/docs/integrations/inventree

## Actions

### Add line to purchase order

Add a part to a purchase order that isn't complete or cancelled.

**Inputs**

- Purchase order (`order`, text, required): The order's reference (such as PO-0001), ID or link.
- Part (`part`, text, required): The part: picked, or its IPN, ID, exact name or barcode.
- Quantity (`quantity`, number, required): How many. At least 0.
- Unit price (`unit_price`, number): The price of one. At least 0.
- Supplier SKU (`sku`, text): The supplier's SKU. Leave blank for the one InvenTree has.
- Notes (`notes`, text): A note on the line.

**Outputs**

- `complete_date` (text): The day it was completed; blank if not
- `completed_lines` (number): How many lines are done
- `created` (text): The day it was made (YYYY-MM-DD)
- `currency` (text): Its currency, such as USD
- `description` (text): Its description
- `id` (number): The order's ID, for other InvenTree steps
- `issue_date` (text): The day it was placed or issued; blank while pending
- `line` (object): The line just added
- `line_count` (number): How many lines it has
- `lines` (list): Its lines, in order
- `link` (text): A link to it in InvenTree
- `reference` (text): Its reference, such as PO-0001
- `status` (text): pending, placed, on_hold, complete, cancelled, lost or returned
- `supplier` (text): The supplier's name
- `supplier_id` (number): The supplier's company ID
- `supplier_reference` (text): The supplier's own reference for it
- `target_date` (text): The day it's due; blank if none
- `total` (number): Its total price

**Example output**

```json
{
  "complete_date": "",
  "completed_lines": 0,
  "created": "2026-11-06",
  "currency": "USD",
  "description": "Restock screws",
  "id": 3,
  "issue_date": "2026-11-06",
  "line": {
    "id": 4,
    "ipn": "M3-10",
    "part": "M3 screw 10mm",
    "part_id": 2,
    "quantity": 500.0,
    "received": 0.0,
    "sku": "BN-M3-10",
    "unit_price": 0.02
  },
  "line_count": 1,
  "lines": [
    {
      "id": 4,
      "ipn": "M3-10",
      "part": "M3 screw 10mm",
      "part_id": 2,
      "quantity": 500.0,
      "received": 0.0,
      "sku": "BN-M3-10",
      "unit_price": 0.02
    }
  ],
  "link": "https://inventree.example.com/web/purchasing/purchase-order/3",
  "reference": "PO-0003",
  "status": "placed",
  "supplier": "Bolt & Nut Co",
  "supplier_id": 2,
  "supplier_reference": "",
  "target_date": "",
  "total": 10.0
}
```

### Add stock

Add stock of a part at a location, such as after a delivery or a production run. It joins the part's stock already there.

**Inputs**

- Part (`part`, text): The part: picked, or its IPN, ID, exact name or barcode. Leave blank when you give a stock item.
- Quantity (`quantity`, number, required): How many to add. At least 0.
- Location (`location`, text): Where it goes. Leave blank for the part's default location.
- Stock item (`stock_item`, text): One stock item's ID or barcode, instead of a part, to change that item only.
- Batch (`batch`, text): The batch code, kept apart from other batches.
- Notes (`notes`, text): Why, kept in the stock item's history.

**Outputs**

- `below_minimum` (true/false): Whether the part is now below its minimum
- `in_stock` (number): How many of the part are in stock now, everywhere
- `ipn` (text): The part's IPN
- `items` (list): The stock items changed, as they are now (0 for an item emptied and removed)
- `link` (text): A link to the part in InvenTree
- `location` (text): That location's path
- `location_id` (number): The location it happened at; 0 if not one place
- `minimum_stock` (number): The part's minimum stock; 0 if none
- `part` (text): The part's name
- `part_id` (number): The part's ID
- `quantity` (number): How many were added, removed, counted or moved

**Example output**

```json
{
  "below_minimum": false,
  "in_stock": 200.0,
  "ipn": "M3-10",
  "items": [
    {
      "id": 5,
      "location": "Warehouse/Shelf B",
      "quantity": 200.0
    }
  ],
  "link": "https://inventree.example.com/web/part/2",
  "location": "Warehouse/Shelf B",
  "location_id": 3,
  "minimum_stock": 200.0,
  "part": "M3 screw 10mm",
  "part_id": 2,
  "quantity": 50.0
}
```

### Count stock

Record a stock count: set how many of a part are at a location, as a stocktake.

**Inputs**

- Part (`part`, text): The part: picked, or its IPN, ID, exact name or barcode. Leave blank when you give a stock item.
- Counted (`quantity`, number, required): How many were counted. At least 0.
- Location (`location`, text): Where it was counted. Leave blank for the part's default location, or its only one.
- Stock item (`stock_item`, text): One stock item's ID or barcode, instead of a part, to change that item only.
- Notes (`notes`, text): Why, kept in the stock item's history.

**Outputs**

- `below_minimum` (true/false): Whether the part is now below its minimum
- `in_stock` (number): How many of the part are in stock now, everywhere
- `ipn` (text): The part's IPN
- `items` (list): The stock items changed, as they are now (0 for an item emptied and removed)
- `link` (text): A link to the part in InvenTree
- `location` (text): That location's path
- `location_id` (number): The location it happened at; 0 if not one place
- `minimum_stock` (number): The part's minimum stock; 0 if none
- `part` (text): The part's name
- `part_id` (number): The part's ID
- `quantity` (number): How many were added, removed, counted or moved

**Example output**

```json
{
  "below_minimum": false,
  "in_stock": 200.0,
  "ipn": "M3-10",
  "items": [
    {
      "id": 5,
      "location": "Warehouse/Shelf B",
      "quantity": 200.0
    }
  ],
  "link": "https://inventree.example.com/web/part/2",
  "location": "Warehouse/Shelf B",
  "location_id": 3,
  "minimum_stock": 200.0,
  "part": "M3 screw 10mm",
  "part_id": 2,
  "quantity": 50.0
}
```

### Create part

Add a part, with its minimum stock and any stock on hand. If a part already has the IPN, it's returned instead, unchanged.

**Inputs**

- Name (`name`, text, required): The part's name.
- Category (`category`, text): Its category.
- IPN (`ipn`, text): Its internal part number, such as M3-10. A part with this IPN already there is returned instead.
- Description (`description`, text): What it is.
- Units (`units`, text): Its units, such as m or kg. Leave blank for pieces.
- Minimum stock (`minimum_stock`, number): The least you want in stock. Below it, the part shows as low stock. At least 0.
- Default location (`default_location`, text): Where it's normally kept.
- Purchaseable (`purchaseable`, true/false): It's bought from suppliers. Default: `true`.
- Salable (`salable`, true/false): It's sold to customers. Default: `false`.
- Component (`component`, true/false): It's used to build other parts. Default: `true`.
- Assembly (`assembly`, true/false): It's built from other parts. Default: `false`.
- Stock on hand (`initial_quantity`, number): How many you have now, added as its first stock. At least 0.
- Stock location (`initial_location`, text): Where the stock on hand is. Leave blank for the default location.

**Outputs**

- `active` (true/false): Whether it's active
- `allocated` (number): How many are set aside for sales orders and builds
- `assembly` (true/false): Whether it's built from other parts
- `available` (number): How many are in stock and not set aside for orders or builds
- `below_minimum` (true/false): Whether stock is below its minimum
- `category` (text): Its category's name
- `category_id` (number): Its category's ID; 0 if none
- `component` (true/false): Whether it's used to build other parts
- `created` (true/false): False when a part with that IPN was already there
- `created_on` (text): The day it was added (YYYY-MM-DD)
- `description` (text): Its description
- `id` (number): The part's ID, for other InvenTree steps
- `in_stock` (number): How many are in stock, everywhere
- `ipn` (text): Its internal part number (IPN)
- `link` (text): A link to it in InvenTree
- `minimum_stock` (number): The minimum it should have in stock; 0 if none is set
- `name` (text): Its name
- `on_order` (number): How many are on open purchase orders
- `purchaseable` (true/false): Whether it can be bought from suppliers
- `salable` (true/false): Whether it can be sold to customers
- `shortfall` (number): How many short of its minimum it is; 0 if not short
- `units` (text): Its units of measure, such as m or kg; blank for pieces

**Example output**

```json
{
  "active": true,
  "allocated": 0.0,
  "assembly": false,
  "available": 150.0,
  "below_minimum": true,
  "category": "Fasteners",
  "category_id": 4,
  "component": true,
  "created": true,
  "created_on": "2026-11-06",
  "description": "M3 x 10 mm pan head screw",
  "id": 2,
  "in_stock": 150.0,
  "ipn": "M3-10",
  "link": "https://inventree.example.com/web/part/2",
  "minimum_stock": 200.0,
  "name": "M3 screw 10mm",
  "on_order": 0.0,
  "purchaseable": true,
  "salable": false,
  "shortfall": 50.0,
  "units": ""
}
```

### Create purchase order

Make a purchase order to a supplier with its lines, pending or placed.

**Inputs**

- Supplier (`supplier`, text, required): Who it's to: picked, or their ID, exact name or email address.
- Lines (`lines`, list, required): One row per part: the part and how many, with a price and the supplier's SKU if you have them.
- Place order (`place_order`, true/false): Place it straight away. Otherwise it stays pending, to check in InvenTree. Default: `false`.
- Supplier reference (`supplier_reference`, text): The supplier's reference, such as their quote number.
- Description (`description`, text): What it's for.
- Target date (`target_date`, date): When it's due.
- Destination (`destination`, text): Where the stock goes when it arrives.

**Outputs**

- `complete_date` (text): The day it was completed; blank if not
- `completed_lines` (number): How many lines are done
- `created` (text): The day it was made (YYYY-MM-DD)
- `currency` (text): Its currency, such as USD
- `description` (text): Its description
- `id` (number): The order's ID, for other InvenTree steps
- `issue_date` (text): The day it was placed or issued; blank while pending
- `line_count` (number): How many lines it has
- `lines` (list): Its lines, in order
- `link` (text): A link to it in InvenTree
- `reference` (text): Its reference, such as PO-0001
- `status` (text): pending, placed, on_hold, complete, cancelled, lost or returned
- `supplier` (text): The supplier's name
- `supplier_id` (number): The supplier's company ID
- `supplier_reference` (text): The supplier's own reference for it
- `target_date` (text): The day it's due; blank if none
- `total` (number): Its total price

**Example output**

```json
{
  "complete_date": "",
  "completed_lines": 0,
  "created": "2026-11-06",
  "currency": "USD",
  "description": "Restock screws",
  "id": 3,
  "issue_date": "2026-11-06",
  "line_count": 1,
  "lines": [
    {
      "id": 4,
      "ipn": "M3-10",
      "part": "M3 screw 10mm",
      "part_id": 2,
      "quantity": 500.0,
      "received": 0.0,
      "sku": "BN-M3-10",
      "unit_price": 0.02
    }
  ],
  "link": "https://inventree.example.com/web/purchasing/purchase-order/3",
  "reference": "PO-0003",
  "status": "placed",
  "supplier": "Bolt & Nut Co",
  "supplier_id": 2,
  "supplier_reference": "",
  "target_date": "",
  "total": 10.0
}
```

### Create sales order

Make a sales order for a customer with its lines, pending or issued.

**Inputs**

- Customer (`customer`, text, required): Who it's for: picked, or their ID, exact name or email address.
- Lines (`lines`, list, required): One row per part: the part and how many, with a price if you have one.
- Issue order (`issue`, true/false): Issue it straight away, ready to ship. Otherwise it stays pending. Default: `false`.
- Customer reference (`customer_reference`, text): The customer's own reference, such as their order number.
- Description (`description`, text): What it's for.
- Target date (`target_date`, date): When it's due.

**Outputs**

- `completed_lines` (number): How many lines are done
- `created` (text): The day it was made (YYYY-MM-DD)
- `currency` (text): Its currency, such as USD
- `customer` (text): The customer's name
- `customer_id` (number): The customer's company ID
- `customer_reference` (text): The customer's own reference, such as their PO number
- `description` (text): Its description
- `id` (number): The order's ID, for other InvenTree steps
- `issue_date` (text): The day it was placed or issued; blank while pending
- `line_count` (number): How many lines it has
- `lines` (list): Its lines, in order
- `link` (text): A link to it in InvenTree
- `reference` (text): Its reference, such as SO-0001
- `shipment_date` (text): The day it was shipped; blank if not
- `status` (text): pending, in_progress, shipped, on_hold, complete, cancelled, lost or returned
- `target_date` (text): The day it's due; blank if none
- `total` (number): Its total price

**Example output**

```json
{
  "completed_lines": 0,
  "created": "2026-11-06",
  "currency": "USD",
  "customer": "Acme Robotics",
  "customer_id": 3,
  "customer_reference": "ACME-PO-881",
  "description": "",
  "id": 4,
  "issue_date": "",
  "line_count": 1,
  "lines": [
    {
      "allocated": 0.0,
      "id": 7,
      "ipn": "ARD-UNO",
      "part": "Arduino Uno R3",
      "part_id": 3,
      "quantity": 2.0,
      "shipped": 0.0,
      "unit_price": 27.5
    }
  ],
  "link": "https://inventree.example.com/web/sales/sales-order/4",
  "reference": "SO-0004",
  "shipment_date": "",
  "status": "pending",
  "target_date": "2026-11-20",
  "total": 55.0
}
```

### Find companies

Find suppliers, customers and manufacturers by words in their name.

**Inputs**

- Search (`search`, text): Words in the name, description or website.
- Type (`type`, text): Which companies. One of: `any`, `suppliers`, `customers`, `manufacturers`. Default: `any`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `companies` (list): The companies, by name
- `count` (number): How many are listed
- `total` (number): How many match in all

**Example output**

```json
{
  "companies": [
    {
      "active": true,
      "currency": "USD",
      "description": "Electronics supplier",
      "email": "orders@northwind.example.com",
      "id": 1,
      "is_customer": false,
      "is_manufacturer": false,
      "is_supplier": true,
      "link": "https://inventree.example.com/web/company/1",
      "name": "Northwind Components",
      "phone": "",
      "website": ""
    }
  ],
  "count": 1,
  "total": 1
}
```

### Find parts

Find parts by words in their name, IPN or description, or only those below their minimum stock, with how many are in stock.

**Inputs**

- Search (`search`, text): Words in the name, IPN or description.
- Category (`category`, text): Only parts in this category or the ones inside it.
- Only below minimum (`below_minimum_only`, true/false): Only parts with less in stock than their minimum, to reorder. Default: `false`.
- Include inactive (`include_inactive`, true/false): Include parts marked inactive. Default: `false`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `parts` (list): The parts found, by name
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "parts": [
    {
      "active": true,
      "allocated": 0.0,
      "assembly": false,
      "available": 150.0,
      "below_minimum": true,
      "category": "Fasteners",
      "category_id": 4,
      "component": true,
      "created_on": "2026-11-06",
      "description": "M3 x 10 mm pan head screw",
      "id": 2,
      "in_stock": 150.0,
      "ipn": "M3-10",
      "link": "https://inventree.example.com/web/part/2",
      "minimum_stock": 200.0,
      "name": "M3 screw 10mm",
      "on_order": 0.0,
      "purchaseable": true,
      "salable": false,
      "shortfall": 50.0,
      "units": ""
    }
  ],
  "total": 1
}
```

### Find purchase orders

Find purchase orders by status, supplier or reference, newest first.

**Inputs**

- Status (`status`, text): Which orders. One of: `any`, `open` (Open (not yet done)), `pending`, `placed`, `on_hold` (On hold), `complete`, `cancelled`, `lost`, `returned`. Default: `any`.
- Supplier (`supplier`, text): Only this supplier's orders.
- Search (`search`, text): Words in the reference, description or other reference.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `purchase_orders` (list): The purchase orders found, newest first
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "purchase_orders": [
    {
      "complete_date": "",
      "completed_lines": 0,
      "created": "2026-11-06",
      "currency": "USD",
      "description": "Restock screws",
      "id": 3,
      "issue_date": "2026-11-06",
      "line_count": 1,
      "link": "https://inventree.example.com/web/purchasing/purchase-order/3",
      "reference": "PO-0003",
      "status": "placed",
      "supplier": "Bolt & Nut Co",
      "supplier_id": 2,
      "supplier_reference": "",
      "target_date": "",
      "total": 10.0
    }
  ],
  "total": 1
}
```

### Find sales orders

Find sales orders by status, customer or reference, newest first.

**Inputs**

- Status (`status`, text): Which orders. One of: `any`, `open` (Open (not yet done)), `pending`, `in_progress` (In progress), `shipped`, `on_hold` (On hold), `complete`, `cancelled`, `lost`, `returned`. Default: `any`.
- Customer (`customer`, text): Only this customer's orders.
- Search (`search`, text): Words in the reference, description or other reference.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `sales_orders` (list): The sales orders found, newest first
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "sales_orders": [
    {
      "completed_lines": 0,
      "created": "2026-11-06",
      "currency": "USD",
      "customer": "Acme Robotics",
      "customer_id": 3,
      "customer_reference": "ACME-PO-881",
      "description": "",
      "id": 4,
      "issue_date": "",
      "line_count": 1,
      "link": "https://inventree.example.com/web/sales/sales-order/4",
      "reference": "SO-0004",
      "shipment_date": "",
      "status": "pending",
      "target_date": "2026-11-20",
      "total": 55.0
    }
  ],
  "total": 1
}
```

### Find stock items

List the stock items in stock: of a part, at a location, or matching words, with how many each holds.

**Inputs**

- Part (`part`, text): Only this part's stock.
- Location (`location`, text): Only stock at this location.
- Include sublocations (`include_sublocations`, true/false): With a location, include the locations inside it. Default: `true`.
- Search (`search`, text): Words in the part's name, IPN or description, the batch or the location.
- Batch (`batch`, text): Only this batch code.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `quantity` (number): How many the listed items hold in all
- `stock_items` (list): The stock items found, most recently changed first
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "quantity": 150.0,
  "stock_items": [
    {
      "allocated": 0.0,
      "available": 150.0,
      "batch": "",
      "id": 5,
      "ipn": "M3-10",
      "link": "https://inventree.example.com/web/stock/item/5",
      "location": "Warehouse/Shelf B",
      "location_id": 3,
      "part": "M3 screw 10mm",
      "part_id": 2,
      "quantity": 150.0,
      "serial": "",
      "status": "OK",
      "updated": "2026-11-06 01:00"
    }
  ],
  "total": 1
}
```

### Get part

Look up a part by IPN, ID, name or barcode: its stock total, minimum, how many are on order, where it's kept and who sells it.

**Inputs**

- Part (`part`, text, required): The part: picked, or its IPN, ID, exact name or barcode.

**Outputs**

- `active` (true/false): Whether it's active
- `allocated` (number): How many are set aside for sales orders and builds
- `assembly` (true/false): Whether it's built from other parts
- `available` (number): How many are in stock and not set aside for orders or builds
- `below_minimum` (true/false): Whether stock is below its minimum
- `category` (text): Its category's name
- `category_id` (number): Its category's ID; 0 if none
- `component` (true/false): Whether it's used to build other parts
- `created_on` (text): The day it was added (YYYY-MM-DD)
- `description` (text): Its description
- `id` (number): The part's ID, for other InvenTree steps
- `in_stock` (number): How many are in stock, everywhere
- `ipn` (text): Its internal part number (IPN)
- `link` (text): A link to it in InvenTree
- `locations` (list): Where it's kept, with how many in each place
- `minimum_stock` (number): The minimum it should have in stock; 0 if none is set
- `name` (text): Its name
- `on_order` (number): How many are on open purchase orders
- `purchaseable` (true/false): Whether it can be bought from suppliers
- `salable` (true/false): Whether it can be sold to customers
- `shortfall` (number): How many short of its minimum it is; 0 if not short
- `suppliers` (list): The suppliers it can be bought from
- `units` (text): Its units of measure, such as m or kg; blank for pieces

**Example output**

```json
{
  "active": true,
  "allocated": 0.0,
  "assembly": false,
  "available": 150.0,
  "below_minimum": true,
  "category": "Fasteners",
  "category_id": 4,
  "component": true,
  "created_on": "2026-11-06",
  "description": "M3 x 10 mm pan head screw",
  "id": 2,
  "in_stock": 150.0,
  "ipn": "M3-10",
  "link": "https://inventree.example.com/web/part/2",
  "locations": [
    {
      "items": 1,
      "location": "Warehouse/Shelf B",
      "location_id": 3,
      "quantity": 150.0
    }
  ],
  "minimum_stock": 200.0,
  "name": "M3 screw 10mm",
  "on_order": 0.0,
  "purchaseable": true,
  "salable": false,
  "shortfall": 50.0,
  "suppliers": [
    {
      "sku": "BN-M3-10",
      "supplier": "Bolt & Nut Co",
      "supplier_id": 2
    }
  ],
  "units": ""
}
```

### List locations

List the stock locations, by path, with how many stock items each holds.

**Inputs**

- Search (`search`, text): Words in the name or description.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `locations` (list): The stock locations, by path
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "locations": [
    {
      "description": "",
      "id": 2,
      "items": 1,
      "link": "https://inventree.example.com/web/stock/location/2",
      "name": "Shelf A",
      "parent_id": 1,
      "path": "Warehouse/Shelf A"
    }
  ],
  "total": 1
}
```

### Receive purchase order

Book what arrived on a purchase order into stock: everything still to come, or some of one part.

**Inputs**

- Purchase order (`order`, text, required): The order's reference (such as PO-0001), ID or link.
- Location (`location`, text): Where it goes. Leave blank for the order's destination or each part's default location.
- Part (`part`, text): Only this part. Leave blank for everything.
- Quantity (`quantity`, number): With a part, how many arrived. Leave blank for all still to come. At least 0.
- Batch (`batch`, text): The batch code for what arrived.

**Outputs**

- `complete_date` (text): The day it was completed; blank if not
- `completed_lines` (number): How many lines are done
- `created` (text): The day it was made (YYYY-MM-DD)
- `currency` (text): Its currency, such as USD
- `description` (text): Its description
- `id` (number): The order's ID, for other InvenTree steps
- `issue_date` (text): The day it was placed or issued; blank while pending
- `line_count` (number): How many lines it has
- `lines` (list): Its lines, in order
- `link` (text): A link to it in InvenTree
- `received` (list): The stock items made from what arrived
- `reference` (text): Its reference, such as PO-0001
- `status` (text): pending, placed, on_hold, complete, cancelled, lost or returned
- `supplier` (text): The supplier's name
- `supplier_id` (number): The supplier's company ID
- `supplier_reference` (text): The supplier's own reference for it
- `target_date` (text): The day it's due; blank if none
- `total` (number): Its total price

**Example output**

```json
{
  "complete_date": "2026-11-06",
  "completed_lines": 1,
  "created": "2026-11-06",
  "currency": "USD",
  "description": "Restock screws",
  "id": 3,
  "issue_date": "2026-11-06",
  "line_count": 1,
  "lines": [
    {
      "id": 4,
      "ipn": "M3-10",
      "part": "M3 screw 10mm",
      "part_id": 2,
      "quantity": 500.0,
      "received": 500.0,
      "sku": "BN-M3-10",
      "unit_price": 0.02
    }
  ],
  "link": "https://inventree.example.com/web/purchasing/purchase-order/3",
  "received": [
    {
      "location_id": 3,
      "part_id": 2,
      "quantity": 500.0,
      "stock_item_id": 12
    }
  ],
  "reference": "PO-0003",
  "status": "complete",
  "supplier": "Bolt & Nut Co",
  "supplier_id": 2,
  "supplier_reference": "",
  "target_date": "",
  "total": 10.0
}
```

### Remove stock

Take stock of a part out, such as when it's used or sold elsewhere. It comes from the oldest stock first, and is refused if there isn't enough.

**Inputs**

- Part (`part`, text): The part: picked, or its IPN, ID, exact name or barcode. Leave blank when you give a stock item.
- Quantity (`quantity`, number, required): How many to take out. At least 0.
- Location (`location`, text): Take it from this location (or one inside it). Leave blank for anywhere.
- Stock item (`stock_item`, text): One stock item's ID or barcode, instead of a part, to change that item only.
- Notes (`notes`, text): Why, kept in the stock item's history.

**Outputs**

- `below_minimum` (true/false): Whether the part is now below its minimum
- `in_stock` (number): How many of the part are in stock now, everywhere
- `ipn` (text): The part's IPN
- `items` (list): The stock items changed, as they are now (0 for an item emptied and removed)
- `link` (text): A link to the part in InvenTree
- `location` (text): That location's path
- `location_id` (number): The location it happened at; 0 if not one place
- `minimum_stock` (number): The part's minimum stock; 0 if none
- `part` (text): The part's name
- `part_id` (number): The part's ID
- `quantity` (number): How many were added, removed, counted or moved

**Example output**

```json
{
  "below_minimum": false,
  "in_stock": 200.0,
  "ipn": "M3-10",
  "items": [
    {
      "id": 5,
      "location": "Warehouse/Shelf B",
      "quantity": 200.0
    }
  ],
  "link": "https://inventree.example.com/web/part/2",
  "location": "Warehouse/Shelf B",
  "location_id": 3,
  "minimum_stock": 200.0,
  "part": "M3 screw 10mm",
  "part_id": 2,
  "quantity": 50.0
}
```

### Ship sales order

Send a sales order: take what's left to ship out of stock (oldest first), ship it with its tracking number, and mark the order shipped. Refused if there isn't enough stock.

**Inputs**

- Sales order (`order`, text, required): The order's reference (such as SO-0001), ID or link.
- Tracking number (`tracking_number`, text): The carrier's tracking number.
- Invoice number (`invoice_number`, text): The invoice it went with.
- Ship from (`location`, text): Take the stock from this location (or one inside it). Leave blank for anywhere.
- Mark order shipped (`mark_shipped`, true/false): Mark the order shipped once every line has gone. Default: `true`.

**Outputs**

- `completed_lines` (number): How many lines are done
- `created` (text): The day it was made (YYYY-MM-DD)
- `currency` (text): Its currency, such as USD
- `customer` (text): The customer's name
- `customer_id` (number): The customer's company ID
- `customer_reference` (text): The customer's own reference, such as their PO number
- `description` (text): Its description
- `id` (number): The order's ID, for other InvenTree steps
- `issue_date` (text): The day it was placed or issued; blank while pending
- `line_count` (number): How many lines it has
- `lines` (list): Its lines, in order
- `link` (text): A link to it in InvenTree
- `reference` (text): Its reference, such as SO-0001
- `shipment` (object): The shipment just sent
- `shipment_date` (text): The day it was shipped; blank if not
- `status` (text): pending, in_progress, shipped, on_hold, complete, cancelled, lost or returned
- `target_date` (text): The day it's due; blank if none
- `total` (number): Its total price

**Example output**

```json
{
  "completed_lines": 1,
  "created": "2026-11-06",
  "currency": "USD",
  "customer": "Acme Robotics",
  "customer_id": 3,
  "customer_reference": "ACME-PO-881",
  "description": "",
  "id": 4,
  "issue_date": "2026-11-06",
  "line_count": 1,
  "lines": [
    {
      "allocated": 0.0,
      "id": 7,
      "ipn": "ARD-UNO",
      "part": "Arduino Uno R3",
      "part_id": 3,
      "quantity": 2.0,
      "shipped": 2.0,
      "unit_price": 27.5
    }
  ],
  "link": "https://inventree.example.com/web/sales/sales-order/4",
  "reference": "SO-0004",
  "shipment": {
    "id": 2,
    "invoice_number": "",
    "items": 1,
    "reference": "2",
    "shipment_date": "2026-11-06",
    "tracking_number": "1Z999AA10123456784"
  },
  "shipment_date": "2026-11-06",
  "status": "shipped",
  "target_date": "2026-11-20",
  "total": 55.0
}
```

### Transfer stock

Move stock of a part to another location. It joins the part's stock already there.

**Inputs**

- To location (`to_location`, text, required): Where it goes.
- Part (`part`, text): The part: picked, or its IPN, ID, exact name or barcode. Leave blank when you give a stock item.
- Quantity (`quantity`, number): How many to move. Leave blank for all of it. At least 0.
- From location (`from_location`, text): Take it from this location (or one inside it). Leave blank for anywhere else.
- Stock item (`stock_item`, text): One stock item's ID or barcode, instead of a part, to change that item only.
- Notes (`notes`, text): Why, kept in the stock item's history.

**Outputs**

- `below_minimum` (true/false): Whether the part is now below its minimum
- `in_stock` (number): How many of the part are in stock now, everywhere
- `ipn` (text): The part's IPN
- `items` (list): The stock items changed, as they are now (0 for an item emptied and removed)
- `link` (text): A link to the part in InvenTree
- `location` (text): That location's path
- `location_id` (number): The location it happened at; 0 if not one place
- `minimum_stock` (number): The part's minimum stock; 0 if none
- `part` (text): The part's name
- `part_id` (number): The part's ID
- `quantity` (number): How many were added, removed, counted or moved

**Example output**

```json
{
  "below_minimum": false,
  "in_stock": 200.0,
  "ipn": "M3-10",
  "items": [
    {
      "id": 5,
      "location": "Warehouse/Shelf B",
      "quantity": 200.0
    }
  ],
  "link": "https://inventree.example.com/web/part/2",
  "location": "Warehouse/Shelf B",
  "location_id": 3,
  "minimum_stock": 200.0,
  "part": "M3 screw 10mm",
  "part_id": 2,
  "quantity": 50.0
}
```
