data
Mollie Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Mollie KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.mollie.*.
Use lua_read_doc("integrations.mollie") 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
Mollie workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.mollie.list_payments({limit = 1, from = "example_from", profileId = "example_profileId"}))' --json kosmo integrations:lua --eval 'print(docs.read("mollie"))' --json
kosmo integrations:lua --eval 'print(docs.read("mollie.list_payments"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local mollie = app.integrations.mollie
local result = mollie.list_payments({limit = 1, from = "example_from", profileId = "example_profileId"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.mollie, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.mollie.default.* or app.integrations.mollie.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Mollie, 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.
Mollie — Lua API Reference
list_payments
List payments with optional filters.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of payments to return (default: 50, max: 250) |
from | string | no | Payment ID to start from (for pagination) |
profileId | string | no | Filter by profile ID |
Example
local result = app.integrations.mollie.list_payments({
limit = 10
})
for _, payment in ipairs(result.payments) do
print(payment.id .. ": " .. payment.description .. " - " .. payment.amount.value .. " " .. payment.amount.currency)
end
get_payment
Retrieve a single payment by its ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The payment ID (e.g., "tr_abc123") |
Example
local result = app.integrations.mollie.get_payment({
id = "tr_abc123"
})
print("Status: " .. result.status)
print("Amount: " .. result.amount.value .. " " .. result.amount.currency)
create_payment
Create a new payment.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
amount | object | yes | Amount object with currency (e.g., "EUR") and value (e.g., "10.00") |
description | string | yes | Payment description shown to the customer |
redirectUrl | string | yes | URL to redirect the customer to after payment |
metadata | object | no | Custom metadata to store with the payment |
method | string | no | Payment method (e.g., "ideal", "creditcard") |
locale | string | no | Locale for the payment screen (e.g., "nl_NL") |
Example
local result = app.integrations.mollie.create_payment({
amount = { currency = "EUR", value = "29.99" },
description = "Order #12345",
redirectUrl = "https://example.com/return"
})
print("Payment ID: " .. result.id)
print("Checkout URL: " .. result._links.checkout.href)
list_customers
List all customers.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of customers to return (default: 50, max: 250) |
from | string | no | Customer ID to start from (for pagination) |
Example
local result = app.integrations.mollie.list_customers({
limit = 10
})
for _, customer in ipairs(result.customers) do
print(customer.id .. ": " .. customer.name .. " (" .. customer.email .. ")")
end
create_customer
Create a new customer.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | Full name of the customer |
email | string | yes | Email address of the customer |
locale | string | no | Preferred locale (e.g., "nl_NL") |
metadata | object | no | Custom metadata to store with the customer |
Example
local result = app.integrations.mollie.create_customer({
name = "Jane Smith",
email = "jane@example.com"
})
print("Customer ID: " .. result.id)
list_subscriptions
List all subscriptions for a specific customer.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | The customer ID (e.g., "cst_abc123") |
limit | integer | no | Number of subscriptions to return (default: 50, max: 250) |
from | string | no | Subscription ID to start from (for pagination) |
Example
local result = app.integrations.mollie.list_subscriptions({
customer_id = "cst_abc123"
})
for _, sub in ipairs(result.subscriptions) do
print(sub.id .. ": " .. sub.description .. " - " .. sub.amount.value .. " " .. sub.amount.currency .. " / " .. sub.interval)
end
create_subscription
Create a subscription for a customer.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | The customer ID (e.g., "cst_abc123") |
amount | object | yes | Amount object with currency and value |
interval | string | yes | Interval (e.g., "1 month", "1 year") |
description | string | yes | Description of the subscription |
method | string | no | Payment method (e.g., "ideal", "creditcard") |
webhookUrl | string | no | URL to receive webhook notifications |
metadata | object | no | Custom metadata |
startDate | string | no | Start date (ISO 8601, e.g., "2026-05-01") |
times | integer | no | Number of billing cycles (null = indefinite) |
Example
local result = app.integrations.mollie.create_subscription({
customer_id = "cst_abc123",
amount = { currency = "EUR", value = "9.99" },
interval = "1 month",
description = "Pro plan monthly"
})
print("Subscription ID: " .. result.id)
print("Status: " .. result.status)
list_invoices
List invoices for the authenticated account.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of invoices to return (default: 50, max: 250) |
from | string | no | Invoice ID to start from (for pagination) |
reference | string | no | Filter by invoice reference |
year | integer | no | Filter by year |
month | integer | no | Filter by month |
Example
local result = app.integrations.mollie.list_invoices({
year = 2026
})
for _, invoice in ipairs(result.invoices) do
print(invoice.id .. ": " .. invoice.reference .. " - " .. invoice.grossAmount.value .. " " .. invoice.grossAmount.currency)
end
get_current_user
Retrieve the enabled payment methods for the authenticated account.
Parameters
None.
Example
local result = app.integrations.mollie.get_current_user({})
for _, method in ipairs(result.methods) do
print(method.id .. ": " .. method.description)
end
Multi-Account Usage
If you have multiple Mollie accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.mollie.function_name({...})
-- Explicit default (portable across setups)
app.integrations.mollie.default.function_name({...})
-- Named accounts
app.integrations.mollie.production.function_name({...})
app.integrations.mollie.test.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Mollie — Lua API Reference
## list_payments
List payments with optional filters.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of payments to return (default: 50, max: 250) |
| `from` | string | no | Payment ID to start from (for pagination) |
| `profileId` | string | no | Filter by profile ID |
### Example
```lua
local result = app.integrations.mollie.list_payments({
limit = 10
})
for _, payment in ipairs(result.payments) do
print(payment.id .. ": " .. payment.description .. " - " .. payment.amount.value .. " " .. payment.amount.currency)
end
```
---
## get_payment
Retrieve a single payment by its ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The payment ID (e.g., `"tr_abc123"`) |
### Example
```lua
local result = app.integrations.mollie.get_payment({
id = "tr_abc123"
})
print("Status: " .. result.status)
print("Amount: " .. result.amount.value .. " " .. result.amount.currency)
```
---
## create_payment
Create a new payment.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `amount` | object | yes | Amount object with `currency` (e.g., `"EUR"`) and `value` (e.g., `"10.00"`) |
| `description` | string | yes | Payment description shown to the customer |
| `redirectUrl` | string | yes | URL to redirect the customer to after payment |
| `metadata` | object | no | Custom metadata to store with the payment |
| `method` | string | no | Payment method (e.g., `"ideal"`, `"creditcard"`) |
| `locale` | string | no | Locale for the payment screen (e.g., `"nl_NL"`) |
### Example
```lua
local result = app.integrations.mollie.create_payment({
amount = { currency = "EUR", value = "29.99" },
description = "Order #12345",
redirectUrl = "https://example.com/return"
})
print("Payment ID: " .. result.id)
print("Checkout URL: " .. result._links.checkout.href)
```
---
## list_customers
List all customers.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of customers to return (default: 50, max: 250) |
| `from` | string | no | Customer ID to start from (for pagination) |
### Example
```lua
local result = app.integrations.mollie.list_customers({
limit = 10
})
for _, customer in ipairs(result.customers) do
print(customer.id .. ": " .. customer.name .. " (" .. customer.email .. ")")
end
```
---
## create_customer
Create a new customer.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | string | yes | Full name of the customer |
| `email` | string | yes | Email address of the customer |
| `locale` | string | no | Preferred locale (e.g., `"nl_NL"`) |
| `metadata` | object | no | Custom metadata to store with the customer |
### Example
```lua
local result = app.integrations.mollie.create_customer({
name = "Jane Smith",
email = "jane@example.com"
})
print("Customer ID: " .. result.id)
```
---
## list_subscriptions
List all subscriptions for a specific customer.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `customer_id` | string | yes | The customer ID (e.g., `"cst_abc123"`) |
| `limit` | integer | no | Number of subscriptions to return (default: 50, max: 250) |
| `from` | string | no | Subscription ID to start from (for pagination) |
### Example
```lua
local result = app.integrations.mollie.list_subscriptions({
customer_id = "cst_abc123"
})
for _, sub in ipairs(result.subscriptions) do
print(sub.id .. ": " .. sub.description .. " - " .. sub.amount.value .. " " .. sub.amount.currency .. " / " .. sub.interval)
end
```
---
## create_subscription
Create a subscription for a customer.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `customer_id` | string | yes | The customer ID (e.g., `"cst_abc123"`) |
| `amount` | object | yes | Amount object with `currency` and `value` |
| `interval` | string | yes | Interval (e.g., `"1 month"`, `"1 year"`) |
| `description` | string | yes | Description of the subscription |
| `method` | string | no | Payment method (e.g., `"ideal"`, `"creditcard"`) |
| `webhookUrl` | string | no | URL to receive webhook notifications |
| `metadata` | object | no | Custom metadata |
| `startDate` | string | no | Start date (ISO 8601, e.g., `"2026-05-01"`) |
| `times` | integer | no | Number of billing cycles (null = indefinite) |
### Example
```lua
local result = app.integrations.mollie.create_subscription({
customer_id = "cst_abc123",
amount = { currency = "EUR", value = "9.99" },
interval = "1 month",
description = "Pro plan monthly"
})
print("Subscription ID: " .. result.id)
print("Status: " .. result.status)
```
---
## list_invoices
List invoices for the authenticated account.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of invoices to return (default: 50, max: 250) |
| `from` | string | no | Invoice ID to start from (for pagination) |
| `reference` | string | no | Filter by invoice reference |
| `year` | integer | no | Filter by year |
| `month` | integer | no | Filter by month |
### Example
```lua
local result = app.integrations.mollie.list_invoices({
year = 2026
})
for _, invoice in ipairs(result.invoices) do
print(invoice.id .. ": " .. invoice.reference .. " - " .. invoice.grossAmount.value .. " " .. invoice.grossAmount.currency)
end
```
---
## get_current_user
Retrieve the enabled payment methods for the authenticated account.
### Parameters
None.
### Example
```lua
local result = app.integrations.mollie.get_current_user({})
for _, method in ipairs(result.methods) do
print(method.id .. ": " .. method.description)
end
```
---
## Multi-Account Usage
If you have multiple Mollie accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.mollie.function_name({...})
-- Explicit default (portable across setups)
app.integrations.mollie.default.function_name({...})
-- Named accounts
app.integrations.mollie.production.function_name({...})
app.integrations.mollie.test.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.mollie.list_payments({limit = 1, from = "example_from", profileId = "example_profileId"})
print(result) Functions
list_payments Read
List payments from Mollie. Returns payment resources with status, amount, and metadata. Use filters like profileId to narrow results.
- Lua path
app.integrations.mollie.list_payments- Full name
mollie.mollie_list_payments
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of payments to return (default: 50, max: 250). |
from | string | no | Payment ID to start from for pagination. |
profileId | string | no | Filter by profile ID. |
get_payment Read
Retrieve a single Mollie payment by its ID. Returns the full payment resource with status, amount, and checkout links.
- Lua path
app.integrations.mollie.get_payment- Full name
mollie.mollie_get_payment
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The payment ID (e.g., "tr_abc123"). |
create_payment Write
Create a new Mollie payment. Requires amount (currency and value), description, and a redirectUrl. Returns the payment resource with a checkout link.
- Lua path
app.integrations.mollie.create_payment- Full name
mollie.mollie_create_payment
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | object | yes | Amount object with "currency" (e.g., "EUR") and "value" (e.g., "10.00"). |
description | string | yes | Description shown to the customer (e.g., "Order #123"). |
redirectUrl | string | yes | URL to redirect the customer to after payment completion. |
metadata | object | no | Custom metadata to attach to the payment. |
method | string | no | Payment method (e.g., "ideal", "creditcard", "paypal"). |
locale | string | no | Locale for the payment screen (e.g., "nl_NL", "en_US"). |
list_customers Read
List all customers from Mollie. Returns customer resources with name, email, and metadata.
- Lua path
app.integrations.mollie.list_customers- Full name
mollie.mollie_list_customers
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of customers to return (default: 50, max: 250). |
from | string | no | Customer ID to start from for pagination. |
create_customer Write
Create a new Mollie customer. Requires name and email. Returns the customer resource with an ID for creating subscriptions.
- Lua path
app.integrations.mollie.create_customer- Full name
mollie.mollie_create_customer
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Full name of the customer. |
email | string | yes | Email address of the customer. |
locale | string | no | Preferred locale (e.g., "nl_NL", "en_US"). |
metadata | object | no | Custom metadata to attach to the customer. |
list_subscriptions Read
List all subscriptions for a specific Mollie customer. Requires a customer ID (e.g., "cst_abc123"). Returns subscription resources with status, amount, and interval.
- Lua path
app.integrations.mollie.list_subscriptions- Full name
mollie.mollie_list_subscriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | The customer ID (e.g., "cst_abc123"). |
limit | integer | no | Number of subscriptions to return (default: 50, max: 250). |
from | string | no | Subscription ID to start from for pagination. |
create_subscription Write
Create a subscription for a Mollie customer. Requires customer ID, amount (currency and value), interval (e.g., "1 month"), and description.
- Lua path
app.integrations.mollie.create_subscription- Full name
mollie.mollie_create_subscription
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | The customer ID (e.g., "cst_abc123"). |
amount | object | yes | Amount object with "currency" (e.g., "EUR") and "value" (e.g., "9.99"). |
interval | string | yes | Billing interval (e.g., "1 month", "1 year", "2 weeks"). |
description | string | yes | Description of the subscription shown to the customer. |
method | string | no | Payment method (e.g., "ideal", "creditcard"). |
webhookUrl | string | no | URL to receive webhook notifications for subscription events. |
metadata | object | no | Custom metadata to attach to the subscription. |
startDate | string | no | Start date for the subscription (ISO 8601, e.g., "2026-05-01"). |
times | integer | no | Number of billing cycles. Omit for indefinite. |
list_invoices Read
List invoices for the authenticated Mollie account. Supports filtering by year, month, and reference.
- Lua path
app.integrations.mollie.list_invoices- Full name
mollie.mollie_list_invoices
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of invoices to return (default: 50, max: 250). |
from | string | no | Invoice ID to start from for pagination. |
reference | string | no | Filter by invoice reference. |
year | integer | no | Filter by year (e.g., 2026). |
month | integer | no | Filter by month (1-12). |
get_payment_methods Read
Retrieve the enabled payment methods for the authenticated Mollie account. Returns a list of available payment methods (e.g., iDEAL, credit card, PayPal).
- Lua path
app.integrations.mollie.get_payment_methods- Full name
mollie.mollie_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||