KosmoKrator

finance

Wise Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write API key auth

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.

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.

Example

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

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.
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
source_accountintegeryesSource account ID (borderless account balance to debit from).
target_accountintegeryesTarget account ID (recipient account to credit).
amountnumberyesAmount to transfer in the source currency.
referencestringnoPayment reference or description for the transfer.

Example

local result = app.integrations.wise.create_transfer({
  source_account = 111111,
  target_account = 222222,
  amount = 100.00,
  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. |

### Example

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

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. |
| `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 |
|------|------|----------|-------------|
| `source_account` | integer | yes | Source account ID (borderless account balance to debit from). |
| `target_account` | integer | yes | Target account ID (recipient account to credit). |
| `amount` | number | yes | Amount to transfer in the source currency. |
| `reference` | string | no | Payment reference or description for the transfer. |

### Example

```lua
local result = app.integrations.wise.create_transfer({
  source_account = 111111,
  target_account = 222222,
  amount = 100.00,
  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.wise_list_profiles({})
print(result)

Functions

wise_list_profiles

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

Operation
Read read
Full name
wise.wise_list_profiles
ParameterTypeRequiredDescription
No parameters.

wise_get_profile

Get details of a specific Wise profile by ID.

Operation
Read read
Full name
wise.wise_get_profile
ParameterTypeRequiredDescription
profile_id integer yes The Wise profile ID.

wise_list_balances

List multi-currency account balances for a Wise profile.

Operation
Read read
Full name
wise.wise_list_balances
ParameterTypeRequiredDescription
profile_id integer yes The Wise profile ID to list balances for.

wise_list_transfers

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

Operation
Read read
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).

wise_get_transfer

Get details of a specific Wise transfer by ID.

Operation
Read read
Full name
wise.wise_get_transfer
ParameterTypeRequiredDescription
transfer_id integer yes The Wise transfer ID.

wise_create_transfer

Create a new money transfer on Wise.

Operation
Write write
Full name
wise.wise_create_transfer
ParameterTypeRequiredDescription
source_account integer yes Source account ID (borderless account balance to debit from).
target_account integer yes Target account ID (recipient account to credit).
amount number yes Amount to transfer in the source currency.
reference string no Payment reference or description for the transfer.

wise_get_current_user

Get details of the currently authenticated Wise user.

Operation
Read read
Full name
wise.wise_get_current_user
ParameterTypeRequiredDescription
No parameters.