KosmoKrator

productivity

Gumroad Lua API for KosmoKrator Agents

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

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.

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 Gumroad workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.gumroad.api_get({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("gumroad"))' --json
kosmo integrations:lua --eval 'print(docs.read("gumroad.api_get"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local gumroad = app.integrations.gumroad
local result = gumroad.api_get({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.gumroad, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.gumroad.default.* or app.integrations.gumroad.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Gumroad, use the narrower mcp:lua command.

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.

Gumroad Lua Reference

Namespace: app.integrations.gumroad

Gumroad tools use API v2 with OAuth bearer-token authentication. Configure access_token; leave url as https://api.gumroad.com/v2 unless using a mock server.

Examples

local products = app.integrations.gumroad.list_products({})

local sales = app.integrations.gumroad.list_sales({
  product_id = "prod_123",
  after = "2026-01-01T00:00:00Z"
})

local verified = app.integrations.gumroad.verify_license({
  product_permalink = "my-product",
  license_key = "AAAA-BBBB-CCCC",
  increment_uses_count = true
})

local webhook = app.integrations.gumroad.create_resource_subscription({
  resource_name = "sale",
  post_url = "https://example.test/gumroad/webhook"
})

Coverage Notes

  • Product tools cover list/get plus custom fields, variants, offer codes, and product subscribers.
  • Sales tools cover list/get, refund, and mark-as-shipped actions.
  • License tools cover verify, enable, disable, and decrement uses count.
  • Resource subscription tools cover webhook list/create/delete for sale, refund, cancellation, dispute, and subscription events.
  • Raw api_get, api_post, api_put, and api_delete accept a v2 path such as /sales/{id} when a niche endpoint is needed.

Responses are decoded Gumroad JSON exactly as returned by the API.

Raw agent markdown
# Gumroad Lua Reference

Namespace: `app.integrations.gumroad`

Gumroad tools use API v2 with OAuth bearer-token authentication. Configure `access_token`; leave `url` as `https://api.gumroad.com/v2` unless using a mock server.

## Examples

```lua
local products = app.integrations.gumroad.list_products({})

local sales = app.integrations.gumroad.list_sales({
  product_id = "prod_123",
  after = "2026-01-01T00:00:00Z"
})

local verified = app.integrations.gumroad.verify_license({
  product_permalink = "my-product",
  license_key = "AAAA-BBBB-CCCC",
  increment_uses_count = true
})

local webhook = app.integrations.gumroad.create_resource_subscription({
  resource_name = "sale",
  post_url = "https://example.test/gumroad/webhook"
})
```

## Coverage Notes

- Product tools cover list/get plus custom fields, variants, offer codes, and product subscribers.
- Sales tools cover list/get, refund, and mark-as-shipped actions.
- License tools cover verify, enable, disable, and decrement uses count.
- Resource subscription tools cover webhook list/create/delete for sale, refund, cancellation, dispute, and subscription events.
- Raw `api_get`, `api_post`, `api_put`, and `api_delete` accept a v2 path such as `/sales/{id}` when a niche endpoint is needed.

Responses are decoded Gumroad JSON exactly as returned by the API.
Metadata-derived Lua example
local result = app.integrations.gumroad.api_get({})
print(result)

Functions

api_get Read

Call any Gumroad API v2 GET endpoint path.

Lua path
app.integrations.gumroad.api_get
Full name
gumroad.gumroad_api_get
ParameterTypeRequiredDescription
No parameters.
api_post Write

Call any Gumroad API v2 POST endpoint path.

Lua path
app.integrations.gumroad.api_post
Full name
gumroad.gumroad_api_post
ParameterTypeRequiredDescription
No parameters.
api_put Write

Call any Gumroad API v2 PUT endpoint path.

Lua path
app.integrations.gumroad.api_put
Full name
gumroad.gumroad_api_put
ParameterTypeRequiredDescription
No parameters.
api_delete Write

Call any Gumroad API v2 DELETE endpoint path.

Lua path
app.integrations.gumroad.api_delete
Full name
gumroad.gumroad_api_delete
ParameterTypeRequiredDescription
No parameters.
get_current_user Read

Get the authenticated Gumroad user profile.

Lua path
app.integrations.gumroad.get_current_user
Full name
gumroad.gumroad_get_current_user
ParameterTypeRequiredDescription
No parameters.
list_products Read

List all Gumroad products for the authenticated account.

Lua path
app.integrations.gumroad.list_products
Full name
gumroad.gumroad_list_products
ParameterTypeRequiredDescription
No parameters.
get_product Read

Get one Gumroad product by ID.

Lua path
app.integrations.gumroad.get_product
Full name
gumroad.gumroad_get_product
ParameterTypeRequiredDescription
No parameters.
list_product_custom_fields Read

List custom fields for a product.

Lua path
app.integrations.gumroad.list_product_custom_fields
Full name
gumroad.gumroad_list_product_custom_fields
ParameterTypeRequiredDescription
No parameters.
list_product_variants Read

List variants for a product.

Lua path
app.integrations.gumroad.list_product_variants
Full name
gumroad.gumroad_list_product_variants
ParameterTypeRequiredDescription
No parameters.
list_product_offer_codes Read

List offer codes for a product.

Lua path
app.integrations.gumroad.list_product_offer_codes
Full name
gumroad.gumroad_list_product_offer_codes
ParameterTypeRequiredDescription
No parameters.
create_product_offer_code Write

Create an offer code for a product.

Lua path
app.integrations.gumroad.create_product_offer_code
Full name
gumroad.gumroad_create_product_offer_code
ParameterTypeRequiredDescription
No parameters.
delete_product_offer_code Write

Delete an offer code for a product.

Lua path
app.integrations.gumroad.delete_product_offer_code
Full name
gumroad.gumroad_delete_product_offer_code
ParameterTypeRequiredDescription
No parameters.
list_sales Read

List successful sales with optional filters.

Lua path
app.integrations.gumroad.list_sales
Full name
gumroad.gumroad_list_sales
ParameterTypeRequiredDescription
No parameters.
get_sale Read

Get one sale by ID.

Lua path
app.integrations.gumroad.get_sale
Full name
gumroad.gumroad_get_sale
ParameterTypeRequiredDescription
No parameters.
mark_sale_shipped Write

Mark a physical sale as shipped.

Lua path
app.integrations.gumroad.mark_sale_shipped
Full name
gumroad.gumroad_mark_sale_as_shipped
ParameterTypeRequiredDescription
No parameters.
refund_sale Write

Refund a sale.

Lua path
app.integrations.gumroad.refund_sale
Full name
gumroad.gumroad_refund_sale
ParameterTypeRequiredDescription
No parameters.
list_subscribers Read

List subscribers, optionally filtered by product.

Lua path
app.integrations.gumroad.list_subscribers
Full name
gumroad.gumroad_list_subscribers
ParameterTypeRequiredDescription
No parameters.
get_subscriber Read

Get one subscriber by ID.

Lua path
app.integrations.gumroad.get_subscriber
Full name
gumroad.gumroad_get_subscriber
ParameterTypeRequiredDescription
No parameters.
list_product_subscribers Read

List subscribers for a specific product.

Lua path
app.integrations.gumroad.list_product_subscribers
Full name
gumroad.gumroad_list_product_subscribers
ParameterTypeRequiredDescription
No parameters.
list_offers Read

List account-level offers when available.

Lua path
app.integrations.gumroad.list_offers
Full name
gumroad.gumroad_list_offers
ParameterTypeRequiredDescription
No parameters.
verify_license Write

Verify a Gumroad license key.

Lua path
app.integrations.gumroad.verify_license
Full name
gumroad.gumroad_verify_license
ParameterTypeRequiredDescription
No parameters.
enable_license Write

Enable a Gumroad license key.

Lua path
app.integrations.gumroad.enable_license
Full name
gumroad.gumroad_enable_license
ParameterTypeRequiredDescription
No parameters.
disable_license Write

Disable a Gumroad license key.

Lua path
app.integrations.gumroad.disable_license
Full name
gumroad.gumroad_disable_license
ParameterTypeRequiredDescription
No parameters.
decrement_license_uses Write

Decrement the uses count for a Gumroad license key.

Lua path
app.integrations.gumroad.decrement_license_uses
Full name
gumroad.gumroad_decrement_license_uses
ParameterTypeRequiredDescription
No parameters.
list_resource_subscriptions Read

List webhook resource subscriptions by resource name.

Lua path
app.integrations.gumroad.list_resource_subscriptions
Full name
gumroad.gumroad_list_resource_subscriptions
ParameterTypeRequiredDescription
No parameters.
create_resource_subscription Write

Subscribe a URL to Gumroad resource notifications.

Lua path
app.integrations.gumroad.create_resource_subscription
Full name
gumroad.gumroad_create_resource_subscription
ParameterTypeRequiredDescription
No parameters.
delete_resource_subscription Write

Delete a Gumroad resource subscription.

Lua path
app.integrations.gumroad.delete_resource_subscription
Full name
gumroad.gumroad_delete_resource_subscription
ParameterTypeRequiredDescription
No parameters.