KosmoKrator

data

Wise Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.wise.*. Use lua_read_doc("integrations.wise") 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 Wise workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.wise.list_profiles({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("wise"))' --json
kosmo integrations:lua --eval 'print(docs.read("wise.list_profiles"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local wise = app.integrations.wise
local result = wise.list_profiles({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.wise, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.wise.default.* or app.integrations.wise.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Wise, use the narrower mcp:lua command.

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.

Wise — Lua API Reference

list_profiles

List all Wise profiles (personal and business) for the authenticated user.

Parameters

None.

Example

local result = app.integrations.wise.list_profiles({})

for _, profile in ipairs(result) do
  print(profile.id .. ": " .. profile.type .. " — " .. profile.firstName .. " " .. profile.lastName)
end

get_profile

Get details of a specific Wise profile by ID.

Parameters

NameTypeRequiredDescription
profile_idintegeryesThe Wise profile ID.

Example

local result = app.integrations.wise.get_profile({
  profile_id = 123456
})

print("Type: " .. result.type)
print("Name: " .. result.firstName .. " " .. result.lastName)

list_balances

List multi-currency account balances for a Wise profile.

Parameters

NameTypeRequiredDescription
profile_idintegeryesThe Wise profile ID to list balances for.
typesstringnoComma-separated balance types. Defaults to STANDARD,SAVINGS.

Example

local result = app.integrations.wise.list_balances({
  profile_id = 123456,
  types = "STANDARD,SAVINGS"
})

for _, account in ipairs(result) do
  for _, balance in ipairs(account.balances) do
    print(balance.currency .. ": " .. balance.amount.value)
  end
end

list_transfers

List Wise transfers with optional filtering by profile, status, and pagination.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of transfers to return.
offsetintegernoNumber of transfers to skip for pagination.
profile_idintegernoFilter transfers by profile ID. Sent to Wise as profile.
statusstringnoFilter by transfer status (e.g. incoming_payment_waiting, processing, funds_converted, funds_refunded, outgoing_payment_sent).

Example

-- List recent transfers
local result = app.integrations.wise.list_transfers({
  limit = 10
})

for _, transfer in ipairs(result) do
  print(transfer.id .. ": " .. transfer.sourceCurrency .. " " .. transfer.sourceAmount .. " -> " .. transfer.targetCurrency)
end
-- Filter by status
local result = app.integrations.wise.list_transfers({
  status = "outgoing_payment_sent",
  profile_id = 123456
})

get_transfer

Get details of a specific Wise transfer by ID.

Parameters

NameTypeRequiredDescription
transfer_idintegeryesThe Wise transfer ID.

Example

local result = app.integrations.wise.get_transfer({
  transfer_id = 789012
})

print("Status: " .. result.status)
print("Amount: " .. result.sourceCurrency .. " " .. result.sourceAmount)
print("Rate: " .. result.rate)

create_transfer

Create a new money transfer on Wise.

Parameters

NameTypeRequiredDescription
target_accountintegeryesTarget account ID (recipient account to credit).
quote_uuidstringyesV2 quote UUID for this transfer.
customer_transaction_idstringyesUUID used by Wise for idempotency. Reuse it when retrying the same create request.
source_accountintegernoOptional refund recipient source account ID.
referencestringnoPayment reference or description for the transfer.
detailsobjectnoAdditional transfer details returned by Wise transfer-requirements.

Example

local result = app.integrations.wise.create_transfer({
  target_account = 222222,
  quote_uuid = "11111111-2222-3333-4444-555555555555",
  customer_transaction_id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  reference = "Invoice #1234"
})

print("Transfer ID: " .. result.id)
print("Status: " .. result.status)

get_current_user

Get details of the currently authenticated Wise user.

Parameters

None.

Example

local result = app.integrations.wise.get_current_user({})

print("Name: " .. result.firstName .. " " .. result.lastName)
print("Email: " .. result.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.wise.function_name({...})

-- Explicit default (portable across setups)
app.integrations.wise.default.function_name({...})

-- Named accounts
app.integrations.wise.business.function_name({...})
app.integrations.wise.personal.function_name({...})

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

Raw agent markdown
# Wise — Lua API Reference

## list_profiles

List all Wise profiles (personal and business) for the authenticated user.

### Parameters

None.

### Example

```lua
local result = app.integrations.wise.list_profiles({})

for _, profile in ipairs(result) do
  print(profile.id .. ": " .. profile.type .. " — " .. profile.firstName .. " " .. profile.lastName)
end
```

---

## get_profile

Get details of a specific Wise profile by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `profile_id` | integer | yes | The Wise profile ID. |

### Example

```lua
local result = app.integrations.wise.get_profile({
  profile_id = 123456
})

print("Type: " .. result.type)
print("Name: " .. result.firstName .. " " .. result.lastName)
```

---

## list_balances

List multi-currency account balances for a Wise profile.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `profile_id` | integer | yes | The Wise profile ID to list balances for. |
| `types` | string | no | Comma-separated balance types. Defaults to `STANDARD,SAVINGS`. |

### Example

```lua
local result = app.integrations.wise.list_balances({
  profile_id = 123456,
  types = "STANDARD,SAVINGS"
})

for _, account in ipairs(result) do
  for _, balance in ipairs(account.balances) do
    print(balance.currency .. ": " .. balance.amount.value)
  end
end
```

---

## list_transfers

List Wise transfers with optional filtering by profile, status, and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of transfers to return. |
| `offset` | integer | no | Number of transfers to skip for pagination. |
| `profile_id` | integer | no | Filter transfers by profile ID. Sent to Wise as `profile`. |
| `status` | string | no | Filter by transfer status (e.g. `incoming_payment_waiting`, `processing`, `funds_converted`, `funds_refunded`, `outgoing_payment_sent`). |

### Example

```lua
-- List recent transfers
local result = app.integrations.wise.list_transfers({
  limit = 10
})

for _, transfer in ipairs(result) do
  print(transfer.id .. ": " .. transfer.sourceCurrency .. " " .. transfer.sourceAmount .. " -> " .. transfer.targetCurrency)
end
```

```lua
-- Filter by status
local result = app.integrations.wise.list_transfers({
  status = "outgoing_payment_sent",
  profile_id = 123456
})
```

---

## get_transfer

Get details of a specific Wise transfer by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `transfer_id` | integer | yes | The Wise transfer ID. |

### Example

```lua
local result = app.integrations.wise.get_transfer({
  transfer_id = 789012
})

print("Status: " .. result.status)
print("Amount: " .. result.sourceCurrency .. " " .. result.sourceAmount)
print("Rate: " .. result.rate)
```

---

## create_transfer

Create a new money transfer on Wise.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `target_account` | integer | yes | Target account ID (recipient account to credit). |
| `quote_uuid` | string | yes | V2 quote UUID for this transfer. |
| `customer_transaction_id` | string | yes | UUID used by Wise for idempotency. Reuse it when retrying the same create request. |
| `source_account` | integer | no | Optional refund recipient source account ID. |
| `reference` | string | no | Payment reference or description for the transfer. |
| `details` | object | no | Additional transfer details returned by Wise transfer-requirements. |

### Example

```lua
local result = app.integrations.wise.create_transfer({
  target_account = 222222,
  quote_uuid = "11111111-2222-3333-4444-555555555555",
  customer_transaction_id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  reference = "Invoice #1234"
})

print("Transfer ID: " .. result.id)
print("Status: " .. result.status)
```

---

## get_current_user

Get details of the currently authenticated Wise user.

### Parameters

None.

### Example

```lua
local result = app.integrations.wise.get_current_user({})

print("Name: " .. result.firstName .. " " .. result.lastName)
print("Email: " .. result.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.wise.function_name({...})

-- Explicit default (portable across setups)
app.integrations.wise.default.function_name({...})

-- Named accounts
app.integrations.wise.business.function_name({...})
app.integrations.wise.personal.function_name({...})
```

All functions are identical across accounts — only the credentials differ.
Metadata-derived Lua example
local result = app.integrations.wise.list_profiles({})
print(result)

Functions

list_profiles Read

List all Wise profiles (personal and business) for the authenticated user.

Lua path
app.integrations.wise.list_profiles
Full name
wise.wise_list_profiles
ParameterTypeRequiredDescription
No parameters.
get_profile Read

Get details of a specific Wise profile by ID.

Lua path
app.integrations.wise.get_profile
Full name
wise.wise_get_profile
ParameterTypeRequiredDescription
profile_id integer yes The Wise profile ID.
list_balances Read

List multi-currency account balances for a Wise profile.

Lua path
app.integrations.wise.list_balances
Full name
wise.wise_list_balances
ParameterTypeRequiredDescription
profile_id integer yes The Wise profile ID to list balances for.
types string no Comma-separated balance types to return. Defaults to STANDARD,SAVINGS.
list_transfers Read

List Wise transfers with optional filtering by profile, status, and pagination.

Lua path
app.integrations.wise.list_transfers
Full name
wise.wise_list_transfers
ParameterTypeRequiredDescription
limit integer no Maximum number of transfers to return.
offset integer no Number of transfers to skip for pagination.
profile_id integer no Filter transfers by profile ID.
status string no Filter by transfer status (e.g. incoming_payment_waiting, processing, funds_converted, funds_refunded, outgoing_payment_sent).
get_transfer Read

Get details of a specific Wise transfer by ID.

Lua path
app.integrations.wise.get_transfer
Full name
wise.wise_get_transfer
ParameterTypeRequiredDescription
transfer_id integer yes The Wise transfer ID.
create_transfer Write

Create a new money transfer on Wise.

Lua path
app.integrations.wise.create_transfer
Full name
wise.wise_create_transfer
ParameterTypeRequiredDescription
source_account integer no Optional refund recipient source account ID.
target_account integer yes Target account ID (recipient account to credit).
quote_uuid string yes V2 quote UUID for this transfer.
customer_transaction_id string yes UUID used for idempotency when creating the transfer.
reference string no Payment reference or description for the transfer.
details object no Additional transfer details returned by Wise transfer-requirements.
get_current_user Read

Get details of the currently authenticated Wise user.

Lua path
app.integrations.wise.get_current_user
Full name
wise.wise_get_current_user
ParameterTypeRequiredDescription
No parameters.