KosmoKrator

ecommerce

Gumroad Lua API for KosmoKrator Agents

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

7 functions 7 read 0 write Bearer token auth

Lua Namespace

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

Gumroad — Lua API Reference

list_products

List all digital products in your Gumroad account.

Parameters

None.

Examples

local result = app.integrations.gumroad.list_products()

for _, product in ipairs(result.products) do
  print(product.name .. " — $" .. product.price .. " (" .. product.id .. ")")
end

get_product

Get detailed information about a single Gumroad product.

Parameters

NameTypeRequiredDescription
product_idstringyesThe ID of the product to retrieve

Example

local result = app.integrations.gumroad.get_product({
  product_id = "ABC123"
})

print(result.product.name)
print(result.product.description)
print(result.product.short_url)

list_sales

List sales from your Gumroad account with optional filters.

Parameters

NameTypeRequiredDescription
product_idstringnoFilter by product ID
beforestringnoOnly sales before this ISO 8601 timestamp
afterstringnoOnly sales after this ISO 8601 timestamp
pageintegernoPage number for pagination (default: 1)

Examples

All recent sales

local result = app.integrations.gumroad.list_sales()

for _, sale in ipairs(result.sales) do
  print(sale.email .. " — $" .. sale.price .. " — " .. sale.product_name)
end

Sales for a specific product

local result = app.integrations.gumroad.list_sales({
  product_id = "ABC123"
})

print("Total sales: " .. result.totalCount)

Sales in a date range

local result = app.integrations.gumroad.list_sales({
  after = "2026-01-01T00:00:00Z",
  before = "2026-01-31T23:59:59Z"
})

list_subscribers

List all subscribers, optionally filtered by product.

Parameters

NameTypeRequiredDescription
product_idstringnoFilter by product ID (e.g., a membership)
pageintegernoPage number for pagination (default: 1)

Examples

All subscribers

local result = app.integrations.gumroad.list_subscribers()

for _, sub in ipairs(result.subscribers) do
  print(sub.email .. " — " .. sub.status .. " — " .. sub.product_id)
end

Subscribers for a specific membership

local result = app.integrations.gumroad.list_subscribers({
  product_id = "MEMBERSHIP123"
})

get_subscriber

Get details for a single subscriber.

Parameters

NameTypeRequiredDescription
subscriber_idstringyesThe ID of the subscriber

Example

local result = app.integrations.gumroad.get_subscriber({
  subscriber_id = "SUB123"
})

print(result.subscriber.email)
print(result.subscriber.status)
print(result.subscriber.charged_price)

list_offers

List all offers (discount codes) in your Gumroad account.

Parameters

None.

Example

local result = app.integrations.gumroad.list_offers()

for _, offer in ipairs(result.offers) do
  print(offer.name .. " — " .. offer.code .. " — " .. offer.amount_cents .. " cents off")
end

get_current_user

Get the profile of the currently authenticated Gumroad user.

Parameters

None.

Example

local result = app.integrations.gumroad.get_current_user()

print("Connected as: " .. result.user.name)
print("Email: " .. result.user.email)

Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.gumroad.main_store.function_name({...})
app.integrations.gumroad.side_project.function_name({...})

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

Raw agent markdown
# Gumroad — Lua API Reference

## list_products

List all digital products in your Gumroad account.

### Parameters

None.

### Examples

```lua
local result = app.integrations.gumroad.list_products()

for _, product in ipairs(result.products) do
  print(product.name .. " — $" .. product.price .. " (" .. product.id .. ")")
end
```

---

## get_product

Get detailed information about a single Gumroad product.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `product_id` | string | yes | The ID of the product to retrieve |

### Example

```lua
local result = app.integrations.gumroad.get_product({
  product_id = "ABC123"
})

print(result.product.name)
print(result.product.description)
print(result.product.short_url)
```

---

## list_sales

List sales from your Gumroad account with optional filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `product_id` | string | no | Filter by product ID |
| `before` | string | no | Only sales before this ISO 8601 timestamp |
| `after` | string | no | Only sales after this ISO 8601 timestamp |
| `page` | integer | no | Page number for pagination (default: 1) |

### Examples

#### All recent sales

```lua
local result = app.integrations.gumroad.list_sales()

for _, sale in ipairs(result.sales) do
  print(sale.email .. " — $" .. sale.price .. " — " .. sale.product_name)
end
```

#### Sales for a specific product

```lua
local result = app.integrations.gumroad.list_sales({
  product_id = "ABC123"
})

print("Total sales: " .. result.totalCount)
```

#### Sales in a date range

```lua
local result = app.integrations.gumroad.list_sales({
  after = "2026-01-01T00:00:00Z",
  before = "2026-01-31T23:59:59Z"
})
```

---

## list_subscribers

List all subscribers, optionally filtered by product.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `product_id` | string | no | Filter by product ID (e.g., a membership) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Examples

#### All subscribers

```lua
local result = app.integrations.gumroad.list_subscribers()

for _, sub in ipairs(result.subscribers) do
  print(sub.email .. " — " .. sub.status .. " — " .. sub.product_id)
end
```

#### Subscribers for a specific membership

```lua
local result = app.integrations.gumroad.list_subscribers({
  product_id = "MEMBERSHIP123"
})
```

---

## get_subscriber

Get details for a single subscriber.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `subscriber_id` | string | yes | The ID of the subscriber |

### Example

```lua
local result = app.integrations.gumroad.get_subscriber({
  subscriber_id = "SUB123"
})

print(result.subscriber.email)
print(result.subscriber.status)
print(result.subscriber.charged_price)
```

---

## list_offers

List all offers (discount codes) in your Gumroad account.

### Parameters

None.

### Example

```lua
local result = app.integrations.gumroad.list_offers()

for _, offer in ipairs(result.offers) do
  print(offer.name .. " — " .. offer.code .. " — " .. offer.amount_cents .. " cents off")
end
```

---

## get_current_user

Get the profile of the currently authenticated Gumroad user.

### Parameters

None.

### Example

```lua
local result = app.integrations.gumroad.get_current_user()

print("Connected as: " .. result.user.name)
print("Email: " .. result.user.email)
```

---

## Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.gumroad.main_store.function_name({...})
app.integrations.gumroad.side_project.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.gumroad.gumroad_list_products({})
print(result)

Functions

gumroad_list_products

List all digital products in your Gumroad account. Returns product names, IDs, prices, and metadata.

Operation
Read read
Full name
gumroad.gumroad_list_products
ParameterTypeRequiredDescription
No parameters.

gumroad_get_product

Get detailed information about a single Gumroad product by its ID. Returns full product data including description, price, variants, and purchase URL.

Operation
Read read
Full name
gumroad.gumroad_get_product
ParameterTypeRequiredDescription
product_id string yes The ID of the product to retrieve.

gumroad_list_sales

List sales from your Gumroad account. Optionally filter by product ID, date range, or page. Returns sale details including buyer info, amount, and product.

Operation
Read read
Full name
gumroad.gumroad_list_sales
ParameterTypeRequiredDescription
product_id string no Filter sales by a specific product ID.
before string no Only return sales before this ISO 8601 timestamp (e.g., "2026-01-01T00:00:00Z").
after string no Only return sales after this ISO 8601 timestamp (e.g., "2026-01-01T00:00:00Z").
page integer no Page number for pagination (default: 1).

gumroad_list_subscribers

List all subscribers in your Gumroad account. Optionally filter by product ID to get subscribers for a specific membership or product.

Operation
Read read
Full name
gumroad.gumroad_list_subscribers
ParameterTypeRequiredDescription
product_id string no Filter subscribers by a specific product ID (e.g., a membership product).
page integer no Page number for pagination (default: 1).

gumroad_get_subscriber

Get detailed information about a single Gumroad subscriber by their ID. Returns subscriber status, email, and subscription details.

Operation
Read read
Full name
gumroad.gumroad_get_subscriber
ParameterTypeRequiredDescription
subscriber_id string yes The ID of the subscriber to retrieve.

gumroad_list_offers

List all offers (discount codes) in your Gumroad account. Returns offer codes, discount amounts, and associated products.

Operation
Read read
Full name
gumroad.gumroad_list_offers
ParameterTypeRequiredDescription
No parameters.

gumroad_get_current_user

Get the profile of the currently authenticated Gumroad user. Useful to verify the connection and see account details.

Operation
Read read
Full name
gumroad.gumroad_get_current_user
ParameterTypeRequiredDescription
No parameters.