data
Zuora Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Zuora KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.zuora.*.
Use lua_read_doc("integrations.zuora") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Zuora workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.zuora.list_accounts({page_size = 1, cursor = "example_cursor", filter = "example_filter"}))' --json kosmo integrations:lua --eval 'print(docs.read("zuora"))' --json
kosmo integrations:lua --eval 'print(docs.read("zuora.list_accounts"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local zuora = app.integrations.zuora
local result = zuora.list_accounts({page_size = 1, cursor = "example_cursor", filter = "example_filter"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.zuora, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.zuora.default.* or app.integrations.zuora.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Zuora, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Zuora — Lua API Reference
zuora_list_accounts
List Zuora customer accounts with filtering and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100) |
cursor | string | no | Pagination cursor from a previous response |
filter | string | no | Filter expression, e.g. "name.EQ:Acme" or "status.EQ:Active" |
Filter Syntax
Zuora v2 filters use the format: field.OPERATOR:value
Common operators: EQ, NE, GT, GTE, LT, LTE, LIKE, IN, ISNULL
Multiple filters: ["field1.EQ:value1","field2.EQ:value2"]
Example
local result = app.integrations.zuora.zuora_list_accounts({
page_size = 10,
filter = "status.EQ:Active"
})
for _, account in ipairs(result.data) do
print(account.name .. " (" .. account.account_number .. ")")
end
zuora_get_account
Get details of a specific Zuora account by its ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id | string | yes | The Zuora account ID |
Example
local result = app.integrations.zuora.zuora_get_account({
account_id = "8a90b89a8a..."
})
print("Account: " .. result.name)
print("Balance: " .. result.balance)
print("Status: " .. result.status)
zuora_list_subscriptions
List Zuora subscriptions with filtering and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100) |
cursor | string | no | Pagination cursor from a previous response |
filter | string | no | Filter expression, e.g. "status.EQ:Active" or "account_id.EQ:8a90b89a..." |
Example
local result = app.integrations.zuora.zuora_list_subscriptions({
page_size = 20,
filter = "status.EQ:Active"
})
for _, sub in ipairs(result.data) do
print(sub.subscription_number .. " - " .. sub.status)
end
zuora_get_subscription
Get details of a specific Zuora subscription by its ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
subscription_id | string | yes | The Zuora subscription ID |
Example
local result = app.integrations.zuora.zuora_get_subscription({
subscription_id = "8a90b89a8a..."
})
print("Subscription: " .. result.subscription_number)
print("Status: " .. result.status)
print("Start: " .. result.start_date)
print("End: " .. result.end_date)
zuora_list_invoices
List Zuora invoices with filtering and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100) |
cursor | string | no | Pagination cursor from a previous response |
filter | string | no | Filter expression, e.g. "status.EQ:Posted" or "account_id.EQ:8a90b89a..." |
Example
local result = app.integrations.zuora.zuora_list_invoices({
page_size = 10,
filter = "status.EQ:Posted"
})
for _, inv in ipairs(result.data) do
print(inv.invoice_number .. ": $" .. inv.amount .. " (" .. inv.status .. ")")
end
zuora_list_payments
List Zuora payments with filtering and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100) |
cursor | string | no | Pagination cursor from a previous response |
filter | string | no | Filter expression, e.g. "status.EQ:Processed" or "account_id.EQ:8a90b89a..." |
Example
local result = app.integrations.zuora.zuora_list_payments({
page_size = 10,
filter = "status.EQ:Processed"
})
for _, pay in ipairs(result.data) do
print(pay.payment_number .. ": $" .. pay.amount .. " via " .. pay.method)
end
zuora_get_current_user
Get the profile of the currently authenticated Zuora user.
Parameters
None.
Example
local result = app.integrations.zuora.zuora_get_current_user({})
print("User: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)
Multi-Account Usage
If you have multiple Zuora tenants configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.zuora.zuora_list_accounts({...})
-- Explicit default (portable across setups)
app.integrations.zuora.default.zuora_list_accounts({...})
-- Named accounts (e.g., production vs. sandbox)
app.integrations.zuora.production.zuora_list_accounts({...})
app.integrations.zuora.sandbox.zuora_list_accounts({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Zuora — Lua API Reference
## zuora_list_accounts
List Zuora customer accounts with filtering and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of results per page (default: 20, max: 100) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `filter` | string | no | Filter expression, e.g. `"name.EQ:Acme"` or `"status.EQ:Active"` |
### Filter Syntax
Zuora v2 filters use the format: `field.OPERATOR:value`
Common operators: `EQ`, `NE`, `GT`, `GTE`, `LT`, `LTE`, `LIKE`, `IN`, `ISNULL`
Multiple filters: `["field1.EQ:value1","field2.EQ:value2"]`
### Example
```lua
local result = app.integrations.zuora.zuora_list_accounts({
page_size = 10,
filter = "status.EQ:Active"
})
for _, account in ipairs(result.data) do
print(account.name .. " (" .. account.account_number .. ")")
end
```
---
## zuora_get_account
Get details of a specific Zuora account by its ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `account_id` | string | yes | The Zuora account ID |
### Example
```lua
local result = app.integrations.zuora.zuora_get_account({
account_id = "8a90b89a8a..."
})
print("Account: " .. result.name)
print("Balance: " .. result.balance)
print("Status: " .. result.status)
```
---
## zuora_list_subscriptions
List Zuora subscriptions with filtering and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of results per page (default: 20, max: 100) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `filter` | string | no | Filter expression, e.g. `"status.EQ:Active"` or `"account_id.EQ:8a90b89a..."` |
### Example
```lua
local result = app.integrations.zuora.zuora_list_subscriptions({
page_size = 20,
filter = "status.EQ:Active"
})
for _, sub in ipairs(result.data) do
print(sub.subscription_number .. " - " .. sub.status)
end
```
---
## zuora_get_subscription
Get details of a specific Zuora subscription by its ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `subscription_id` | string | yes | The Zuora subscription ID |
### Example
```lua
local result = app.integrations.zuora.zuora_get_subscription({
subscription_id = "8a90b89a8a..."
})
print("Subscription: " .. result.subscription_number)
print("Status: " .. result.status)
print("Start: " .. result.start_date)
print("End: " .. result.end_date)
```
---
## zuora_list_invoices
List Zuora invoices with filtering and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of results per page (default: 20, max: 100) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `filter` | string | no | Filter expression, e.g. `"status.EQ:Posted"` or `"account_id.EQ:8a90b89a..."` |
### Example
```lua
local result = app.integrations.zuora.zuora_list_invoices({
page_size = 10,
filter = "status.EQ:Posted"
})
for _, inv in ipairs(result.data) do
print(inv.invoice_number .. ": $" .. inv.amount .. " (" .. inv.status .. ")")
end
```
---
## zuora_list_payments
List Zuora payments with filtering and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of results per page (default: 20, max: 100) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `filter` | string | no | Filter expression, e.g. `"status.EQ:Processed"` or `"account_id.EQ:8a90b89a..."` |
### Example
```lua
local result = app.integrations.zuora.zuora_list_payments({
page_size = 10,
filter = "status.EQ:Processed"
})
for _, pay in ipairs(result.data) do
print(pay.payment_number .. ": $" .. pay.amount .. " via " .. pay.method)
end
```
---
## zuora_get_current_user
Get the profile of the currently authenticated Zuora user.
### Parameters
None.
### Example
```lua
local result = app.integrations.zuora.zuora_get_current_user({})
print("User: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)
```
---
## Multi-Account Usage
If you have multiple Zuora tenants configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.zuora.zuora_list_accounts({...})
-- Explicit default (portable across setups)
app.integrations.zuora.default.zuora_list_accounts({...})
-- Named accounts (e.g., production vs. sandbox)
app.integrations.zuora.production.zuora_list_accounts({...})
app.integrations.zuora.sandbox.zuora_list_accounts({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.zuora.list_accounts({page_size = 1, cursor = "example_cursor", filter = "example_filter"})
print(result) Functions
list_accounts Read
List Zuora customer accounts. Returns account IDs, names, numbers, and status. Supports filtering and pagination.
- Lua path
app.integrations.zuora.list_accounts- Full name
zuora.zuora_list_accounts
| Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100). |
cursor | string | no | Pagination cursor from a previous response to get the next page. |
filter | string | no | Filter expression, e.g. "name.EQ:Acme" or "status.EQ:Active". |
get_account Read
Get details of a specific Zuora account by its ID. Returns account name, number, status, balance, and billing information.
- Lua path
app.integrations.zuora.get_account- Full name
zuora.zuora_get_account
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | yes | The Zuora account ID (e.g., "8a90b89a8a..."). |
list_subscriptions Read
List Zuora subscriptions. Returns subscription IDs, numbers, status, and key dates. Supports filtering by account, status, and more.
- Lua path
app.integrations.zuora.list_subscriptions- Full name
zuora.zuora_list_subscriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100). |
cursor | string | no | Pagination cursor from a previous response to get the next page. |
filter | string | no | Filter expression, e.g. "status.EQ:Active" or "account_id.EQ:8a90b89a...". |
get_subscription Read
Get details of a specific Zuora subscription by its ID. Returns subscription status, rate plans, charges, and key dates.
- Lua path
app.integrations.zuora.get_subscription- Full name
zuora.zuora_get_subscription
| Parameter | Type | Required | Description |
|---|---|---|---|
subscription_id | string | yes | The Zuora subscription ID (e.g., "8a90b89a8a..."). |
list_invoices Read
List Zuora invoices. Returns invoice IDs, numbers, amounts, status, and dates. Supports filtering by account, status, and date.
- Lua path
app.integrations.zuora.list_invoices- Full name
zuora.zuora_list_invoices
| Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100). |
cursor | string | no | Pagination cursor from a previous response to get the next page. |
filter | string | no | Filter expression, e.g. "status.EQ:Posted" or "account_id.EQ:8a90b89a...". |
list_payments Read
List Zuora payments. Returns payment IDs, numbers, amounts, status, and methods. Supports filtering by account, status, and date.
- Lua path
app.integrations.zuora.list_payments- Full name
zuora.zuora_list_payments
| Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 100). |
cursor | string | no | Pagination cursor from a previous response to get the next page. |
filter | string | no | Filter expression, e.g. "status.EQ:Processed" or "account_id.EQ:8a90b89a...". |
get_current_user Read
Get the profile of the currently authenticated Zuora user. Returns user name, email, and tenant information.
- Lua path
app.integrations.zuora.get_current_user- Full name
zuora.zuora_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||