KosmoKrator

ecommerce

Lemon Squeezy Lua API for KosmoKrator Agents

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

7 functions 7 read 0 write API key auth

Lua Namespace

Agents call this integration through app.integrations.lemon_squeezy.*. Use lua_read_doc("integrations.lemon-squeezy") 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.

Lemon Squeezy — Lua API Reference

list_products

List all digital products in your Lemon Squeezy store.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of products per page (default: 10, max: 100)
pageintegernoPage number for pagination (default: 1)

Example

local result = app.integrations["lemon-squeezy"].list_products({
  page_size = 20,
  page = 1
})

for _, product in ipairs(result.data) do
  print(product.attributes.name .. " - " .. product.attributes.price)
end

get_product

Get details for a specific product by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe product ID

Example

local result = app.integrations["lemon-squeezy"].get_product({
  id = "12345"
})

print(result.data.attributes.name)
print(result.data.attributes.status)

list_orders

List all orders in your Lemon Squeezy store.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of orders per page (default: 10, max: 100)
pageintegernoPage number for pagination (default: 1)

Example

local result = app.integrations["lemon-squeezy"].list_orders({
  page_size = 25,
  page = 1
})

for _, order in ipairs(result.data) do
  print(order.attributes.identifier .. ": " .. order.attributes.total .. " " .. order.attributes.currency)
end

get_order

Get details for a specific order by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe order ID

Example

local result = app.integrations["lemon-squeezy"].get_order({
  id = "67890"
})

print(result.data.attributes.identifier)
print(result.data.attributes.status_formatted)
print("Total: " .. result.data.attributes.total)

list_customers

List all customers in your Lemon Squeezy store.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of customers per page (default: 10, max: 100)
pageintegernoPage number for pagination (default: 1)

Example

local result = app.integrations["lemon-squeezy"].list_customers({
  page_size = 50
})

for _, customer in ipairs(result.data) do
  print(customer.attributes.name .. " (" .. customer.attributes.email .. ")")
end

list_subscriptions

List all subscriptions in your Lemon Squeezy store.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of subscriptions per page (default: 10, max: 100)
pageintegernoPage number for pagination (default: 1)

Example

local result = app.integrations["lemon-squeezy"].list_subscriptions({
  page_size = 50
})

for _, sub in ipairs(result.data) do
  print(sub.attributes.user_email .. " - " .. sub.attributes.status_formatted)
end

get_current_user

Get the currently authenticated Lemon Squeezy user profile.

Parameters

None.

Example

local result = app.integrations["lemon-squeezy"].get_current_user({})

print(result.data.attributes.name)
print(result.data.attributes.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations["lemon-squeezy"].function_name({...})

-- Explicit default (portable across setups)
app.integrations["lemon-squeezy"].default.function_name({...})

-- Named accounts
app.integrations["lemon-squeezy"].work.function_name({...})
app.integrations["lemon-squeezy"].personal.function_name({...})

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

Raw agent markdown
# Lemon Squeezy — Lua API Reference

## list_products

List all digital products in your Lemon Squeezy store.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of products per page (default: 10, max: 100) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Example

```lua
local result = app.integrations["lemon-squeezy"].list_products({
  page_size = 20,
  page = 1
})

for _, product in ipairs(result.data) do
  print(product.attributes.name .. " - " .. product.attributes.price)
end
```

---

## get_product

Get details for a specific product by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The product ID |

### Example

```lua
local result = app.integrations["lemon-squeezy"].get_product({
  id = "12345"
})

print(result.data.attributes.name)
print(result.data.attributes.status)
```

---

## list_orders

List all orders in your Lemon Squeezy store.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of orders per page (default: 10, max: 100) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Example

```lua
local result = app.integrations["lemon-squeezy"].list_orders({
  page_size = 25,
  page = 1
})

for _, order in ipairs(result.data) do
  print(order.attributes.identifier .. ": " .. order.attributes.total .. " " .. order.attributes.currency)
end
```

---

## get_order

Get details for a specific order by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The order ID |

### Example

```lua
local result = app.integrations["lemon-squeezy"].get_order({
  id = "67890"
})

print(result.data.attributes.identifier)
print(result.data.attributes.status_formatted)
print("Total: " .. result.data.attributes.total)
```

---

## list_customers

List all customers in your Lemon Squeezy store.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of customers per page (default: 10, max: 100) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Example

```lua
local result = app.integrations["lemon-squeezy"].list_customers({
  page_size = 50
})

for _, customer in ipairs(result.data) do
  print(customer.attributes.name .. " (" .. customer.attributes.email .. ")")
end
```

---

## list_subscriptions

List all subscriptions in your Lemon Squeezy store.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of subscriptions per page (default: 10, max: 100) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Example

```lua
local result = app.integrations["lemon-squeezy"].list_subscriptions({
  page_size = 50
})

for _, sub in ipairs(result.data) do
  print(sub.attributes.user_email .. " - " .. sub.attributes.status_formatted)
end
```

---

## get_current_user

Get the currently authenticated Lemon Squeezy user profile.

### Parameters

None.

### Example

```lua
local result = app.integrations["lemon-squeezy"].get_current_user({})

print(result.data.attributes.name)
print(result.data.attributes.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations["lemon-squeezy"].function_name({...})

-- Explicit default (portable across setups)
app.integrations["lemon-squeezy"].default.function_name({...})

-- Named accounts
app.integrations["lemon-squeezy"].work.function_name({...})
app.integrations["lemon-squeezy"].personal.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.lemon_squeezy.lemonsqueezy_list_products({
  page_size = 1,
  page = 1
})
print(result)

Functions

lemonsqueezy_list_products

List all digital products in your Lemon Squeezy store. Returns product names, prices, and status.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_list_products
ParameterTypeRequiredDescription
page_size integer no Number of products per page (default: 10, max: 100).
page integer no Page number for pagination (default: 1).

lemonsqueezy_get_product

Get details for a specific Lemon Squeezy product by ID. Returns full product information including pricing, variants, and status.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_get_product
ParameterTypeRequiredDescription
id string yes The product ID.

lemonsqueezy_list_orders

List all orders in your Lemon Squeezy store. Returns order details including status, totals, and customer info.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_list_orders
ParameterTypeRequiredDescription
page_size integer no Number of orders per page (default: 10, max: 100).
page integer no Page number for pagination (default: 1).

lemonsqueezy_get_order

Get details for a specific Lemon Squeezy order by ID. Returns full order information including line items, totals, and customer data.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_get_order
ParameterTypeRequiredDescription
id string yes The order ID.

lemonsqueezy_list_customers

List all customers in your Lemon Squeezy store. Returns customer names, emails, and metadata.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_list_customers
ParameterTypeRequiredDescription
page_size integer no Number of customers per page (default: 10, max: 100).
page integer no Page number for pagination (default: 1).

lemonsqueezy_list_subscriptions

List all subscriptions in your Lemon Squeezy store. Returns subscription status, billing cycle, and customer info.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_list_subscriptions
ParameterTypeRequiredDescription
page_size integer no Number of subscriptions per page (default: 10, max: 100).
page integer no Page number for pagination (default: 1).

lemonsqueezy_get_current_user

Get the currently authenticated Lemon Squeezy user profile. Useful for verifying API credentials and viewing account info.

Operation
Read read
Full name
lemon-squeezy.lemonsqueezy_get_current_user
ParameterTypeRequiredDescription
No parameters.