KosmoKrator

ecommerce

Zoho Inventory Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Zoho Inventory KosmoKrator integration.

7 functions 7 read 0 write Manual OAuth token auth

Lua Namespace

Agents call this integration through app.integrations.zoho_inventory.*. Use lua_read_doc("integrations.zoho_inventory") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Zoho Inventory — Lua API Reference

list_items

List inventory items (products) from Zoho Inventory.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
per_pageintegernoResults per page, max 200 (default: 25)
statusstringnoFilter by status: active, inactive, all

Examples

-- List first page of active items
local result = app.integrations.zoho_inventory.list_items({
  page = 1,
  per_page = 25,
  status = "active"
})

for _, item in ipairs(result.items or {}) do
  print(item.name .. " — " .. item.sku .. " — stock: " .. (item.actual_available_stock or "0"))
end
-- Paginate through all items
local page = 1
repeat
  local result = app.integrations.zoho_inventory.list_items({ page = page, per_page = 200 })
  for _, item in ipairs(result.items or {}) do
    print(item.item_id .. ": " .. item.name)
  end
  page = (result.page_context or {}).page + 1
until not result.items or #result.items == 0

get_item

Get details of a specific inventory item.

Parameters

NameTypeRequiredDescription
item_idstringyesThe Zoho Inventory item ID

Example

local result = app.integrations.zoho_inventory.get_item({ item_id = "4815162342" })
local item = result.item
print(item.name .. " — " .. item.unit .. " — $" .. item.rate)

list_orders

List sales orders from Zoho Inventory.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
per_pageintegernoResults per page, max 200 (default: 25)
statusstringnoFilter by status: draft, confirmed, void, open, invoiced, partially_invoiced, all

Example

-- List open sales orders
local result = app.integrations.zoho_inventory.list_orders({
  page = 1,
  per_page = 25,
  status = "open"
})

for _, order in ipairs(result.salesorders or {}) do
  print(order.salesorder_number .. " — " .. order.customer_name .. " — $" .. order.total)
end

get_order

Get details of a specific sales order.

Parameters

NameTypeRequiredDescription
order_idstringyesThe Zoho Inventory sales order ID

Example

local result = app.integrations.zoho_inventory.get_order({ order_id = "4815162342" })
local order = result.salesorder
print("Order: " .. order.salesorder_number)
print("Customer: " .. order.customer_name)
print("Total: $" .. order.total)
for _, line in ipairs(order.line_items or {}) do
  print("  " .. line.name .. " x" .. line.quantity .. " = $" .. line.item_total)
end

list_shipments

List shipments from Zoho Inventory.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
per_pageintegernoResults per page, max 200 (default: 25)

Example

local result = app.integrations.zoho_inventory.list_shipments({ page = 1, per_page = 25 })

for _, shipment in ipairs(result.shipments or {}) do
  print(shipment.shipment_id .. " — " .. (shipment.status or "unknown"))
end

list_packages

List packages from Zoho Inventory.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
per_pageintegernoResults per page, max 200 (default: 25)

Example

local result = app.integrations.zoho_inventory.list_packages({ page = 1, per_page = 25 })

for _, pkg in ipairs(result.packages or {}) do
  print(pkg.package_id .. " — " .. (pkg.status or "unknown"))
end

get_current_user

Get the currently authenticated Zoho Inventory user.

Parameters

None.

Example

local result = app.integrations.zoho_inventory.get_current_user({})
local user = result.user
print("Logged in as: " .. user.name .. " (" .. user.email .. ")")

Multi-Account Usage

If you have multiple Zoho Inventory accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.zoho_inventory.list_items({...})

-- Explicit default (portable across setups)
app.integrations.zoho_inventory.default.list_items({...})

-- Named accounts
app.integrations.zoho_inventory.warehouse_us.list_items({...})
app.integrations.zoho_inventory.warehouse_eu.list_orders({...})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Zoho Inventory — Lua API Reference

## list_items

List inventory items (products) from Zoho Inventory.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `per_page` | integer | no | Results per page, max 200 (default: 25) |
| `status` | string | no | Filter by status: `active`, `inactive`, `all` |

### Examples

```lua
-- List first page of active items
local result = app.integrations.zoho_inventory.list_items({
  page = 1,
  per_page = 25,
  status = "active"
})

for _, item in ipairs(result.items or {}) do
  print(item.name .. " — " .. item.sku .. " — stock: " .. (item.actual_available_stock or "0"))
end
```

```lua
-- Paginate through all items
local page = 1
repeat
  local result = app.integrations.zoho_inventory.list_items({ page = page, per_page = 200 })
  for _, item in ipairs(result.items or {}) do
    print(item.item_id .. ": " .. item.name)
  end
  page = (result.page_context or {}).page + 1
until not result.items or #result.items == 0
```

---

## get_item

Get details of a specific inventory item.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `item_id` | string | yes | The Zoho Inventory item ID |

### Example

```lua
local result = app.integrations.zoho_inventory.get_item({ item_id = "4815162342" })
local item = result.item
print(item.name .. " — " .. item.unit .. " — $" .. item.rate)
```

---

## list_orders

List sales orders from Zoho Inventory.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `per_page` | integer | no | Results per page, max 200 (default: 25) |
| `status` | string | no | Filter by status: `draft`, `confirmed`, `void`, `open`, `invoiced`, `partially_invoiced`, `all` |

### Example

```lua
-- List open sales orders
local result = app.integrations.zoho_inventory.list_orders({
  page = 1,
  per_page = 25,
  status = "open"
})

for _, order in ipairs(result.salesorders or {}) do
  print(order.salesorder_number .. " — " .. order.customer_name .. " — $" .. order.total)
end
```

---

## get_order

Get details of a specific sales order.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `order_id` | string | yes | The Zoho Inventory sales order ID |

### Example

```lua
local result = app.integrations.zoho_inventory.get_order({ order_id = "4815162342" })
local order = result.salesorder
print("Order: " .. order.salesorder_number)
print("Customer: " .. order.customer_name)
print("Total: $" .. order.total)
for _, line in ipairs(order.line_items or {}) do
  print("  " .. line.name .. " x" .. line.quantity .. " = $" .. line.item_total)
end
```

---

## list_shipments

List shipments from Zoho Inventory.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `per_page` | integer | no | Results per page, max 200 (default: 25) |

### Example

```lua
local result = app.integrations.zoho_inventory.list_shipments({ page = 1, per_page = 25 })

for _, shipment in ipairs(result.shipments or {}) do
  print(shipment.shipment_id .. " — " .. (shipment.status or "unknown"))
end
```

---

## list_packages

List packages from Zoho Inventory.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `per_page` | integer | no | Results per page, max 200 (default: 25) |

### Example

```lua
local result = app.integrations.zoho_inventory.list_packages({ page = 1, per_page = 25 })

for _, pkg in ipairs(result.packages or {}) do
  print(pkg.package_id .. " — " .. (pkg.status or "unknown"))
end
```

---

## get_current_user

Get the currently authenticated Zoho Inventory user.

### Parameters

None.

### Example

```lua
local result = app.integrations.zoho_inventory.get_current_user({})
local user = result.user
print("Logged in as: " .. user.name .. " (" .. user.email .. ")")
```

---

## Multi-Account Usage

If you have multiple Zoho Inventory accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.zoho_inventory.list_items({...})

-- Explicit default (portable across setups)
app.integrations.zoho_inventory.default.list_items({...})

-- Named accounts
app.integrations.zoho_inventory.warehouse_us.list_items({...})
app.integrations.zoho_inventory.warehouse_eu.list_orders({...})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.zoho_inventory.zoho_inventory_list_items({
  page = 1,
  per_page = 1,
  status = "example_status"
})
print(result)

Functions

zoho_inventory_list_items

List inventory items (products) from Zoho Inventory. Supports pagination and optional filtering by status (active, inactive, all).

Operation
Read read
Full name
zoho_inventory.zoho_inventory_list_items
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of items per page, max 200 (default: 25).
status string no Filter by item status: active, inactive, all.

zoho_inventory_get_item

Get detailed information about a specific inventory item (product) by its Zoho Inventory ID.

Operation
Read read
Full name
zoho_inventory.zoho_inventory_get_item
ParameterTypeRequiredDescription
item_id string yes The Zoho Inventory item ID.

zoho_inventory_list_orders

List sales orders from Zoho Inventory. Supports pagination and optional filtering by status (draft, confirmed, void, open, invoiced, partially_invoiced, all).

Operation
Read read
Full name
zoho_inventory.zoho_inventory_list_orders
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of orders per page, max 200 (default: 25).
status string no Filter by order status: draft, confirmed, void, open, invoiced, partially_invoiced, all.

zoho_inventory_get_order

Get detailed information about a specific sales order by its Zoho Inventory ID.

Operation
Read read
Full name
zoho_inventory.zoho_inventory_get_order
ParameterTypeRequiredDescription
order_id string yes The Zoho Inventory sales order ID.

zoho_inventory_list_shipments

List shipments from Zoho Inventory. Supports pagination to browse through shipment records.

Operation
Read read
Full name
zoho_inventory.zoho_inventory_list_shipments
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of shipments per page, max 200 (default: 25).

zoho_inventory_list_packages

List packages from Zoho Inventory. Supports pagination to browse through package records.

Operation
Read read
Full name
zoho_inventory.zoho_inventory_list_packages
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of packages per page, max 200 (default: 25).

zoho_inventory_get_current_user

Get details of the currently authenticated Zoho Inventory user. Useful for verifying credentials and checking permissions.

Operation
Read read
Full name
zoho_inventory.zoho_inventory_get_current_user
ParameterTypeRequiredDescription
No parameters.