KosmoKrator

other

Mollie Lua API for KosmoKrator Agents

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

9 functions 6 read 3 write Bearer token auth

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.

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

NameTypeRequiredDescription
limitintegernoNumber of payments to return (default: 50, max: 250)
fromstringnoPayment ID to start from (for pagination)
profileIdstringnoFilter 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

NameTypeRequiredDescription
idstringyesThe 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

NameTypeRequiredDescription
amountobjectyesAmount object with currency (e.g., "EUR") and value (e.g., "10.00")
descriptionstringyesPayment description shown to the customer
redirectUrlstringyesURL to redirect the customer to after payment
metadataobjectnoCustom metadata to store with the payment
methodstringnoPayment method (e.g., "ideal", "creditcard")
localestringnoLocale 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

NameTypeRequiredDescription
limitintegernoNumber of customers to return (default: 50, max: 250)
fromstringnoCustomer 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

NameTypeRequiredDescription
namestringyesFull name of the customer
emailstringyesEmail address of the customer
localestringnoPreferred locale (e.g., "nl_NL")
metadataobjectnoCustom metadata to store with the customer

Example

local result = app.integrations.mollie.create_customer({
  name = "Jane Smith",
  email = "[email protected]"
})

print("Customer ID: " .. result.id)

list_subscriptions

List all subscriptions for a specific customer.

Parameters

NameTypeRequiredDescription
customer_idstringyesThe customer ID (e.g., "cst_abc123")
limitintegernoNumber of subscriptions to return (default: 50, max: 250)
fromstringnoSubscription 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

NameTypeRequiredDescription
customer_idstringyesThe customer ID (e.g., "cst_abc123")
amountobjectyesAmount object with currency and value
intervalstringyesInterval (e.g., "1 month", "1 year")
descriptionstringyesDescription of the subscription
methodstringnoPayment method (e.g., "ideal", "creditcard")
webhookUrlstringnoURL to receive webhook notifications
metadataobjectnoCustom metadata
startDatestringnoStart date (ISO 8601, e.g., "2026-05-01")
timesintegernoNumber 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

NameTypeRequiredDescription
limitintegernoNumber of invoices to return (default: 50, max: 250)
fromstringnoInvoice ID to start from (for pagination)
referencestringnoFilter by invoice reference
yearintegernoFilter by year
monthintegernoFilter 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 = "[email protected]"
})

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.

Metadata-Derived Lua Example

local result = app.integrations.mollie.mollie_list_payments({
  limit = 1,
  from = "example_from",
  profileId = "example_profileId"
})
print(result)

Functions

mollie_list_payments

List payments from Mollie. Returns payment resources with status, amount, and metadata. Use filters like profileId to narrow results.

Operation
Read read
Full name
mollie.mollie_list_payments
ParameterTypeRequiredDescription
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.

mollie_get_payment

Retrieve a single Mollie payment by its ID. Returns the full payment resource with status, amount, and checkout links.

Operation
Read read
Full name
mollie.mollie_get_payment
ParameterTypeRequiredDescription
id string yes The payment ID (e.g., "tr_abc123").

mollie_create_payment

Create a new Mollie payment. Requires amount (currency and value), description, and a redirectUrl. Returns the payment resource with a checkout link.

Operation
Write write
Full name
mollie.mollie_create_payment
ParameterTypeRequiredDescription
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").

mollie_list_customers

List all customers from Mollie. Returns customer resources with name, email, and metadata.

Operation
Read read
Full name
mollie.mollie_list_customers
ParameterTypeRequiredDescription
limit integer no Number of customers to return (default: 50, max: 250).
from string no Customer ID to start from for pagination.

mollie_create_customer

Create a new Mollie customer. Requires name and email. Returns the customer resource with an ID for creating subscriptions.

Operation
Write write
Full name
mollie.mollie_create_customer
ParameterTypeRequiredDescription
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.

mollie_list_subscriptions

List all subscriptions for a specific Mollie customer. Requires a customer ID (e.g., "cst_abc123"). Returns subscription resources with status, amount, and interval.

Operation
Read read
Full name
mollie.mollie_list_subscriptions
ParameterTypeRequiredDescription
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.

mollie_create_subscription

Create a subscription for a Mollie customer. Requires customer ID, amount (currency and value), interval (e.g., "1 month"), and description.

Operation
Write write
Full name
mollie.mollie_create_subscription
ParameterTypeRequiredDescription
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.

mollie_list_invoices

List invoices for the authenticated Mollie account. Supports filtering by year, month, and reference.

Operation
Read read
Full name
mollie.mollie_list_invoices
ParameterTypeRequiredDescription
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).

mollie_get_current_user

Retrieve the enabled payment methods for the authenticated Mollie account. Returns a list of available payment methods (e.g., iDEAL, credit card, PayPal).

Operation
Read read
Full name
mollie.mollie_get_current_user
ParameterTypeRequiredDescription
No parameters.