# Cakto — how to use (mcp.ai)

Cakto payment gateway and checkout for course/infoproduct sellers, read orders, sales analytics, subscriptions, churn, customers and products via the official API. Generate your credentials (Client ID + Client Secret) with the read scopes under API in the Cakto dashboard.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_cakto?ms=1787529960000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `cakto_customers_get`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/cakto`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/cakto/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/cakto/customers/get` — Leitura de clientes na Cakto (para análise/CRM).
  - body: { customer_id?: string, search?: string, page?: integer, account?: string, customer_ids?: string[] }
- `POST https://api.mcp.ai/api/cakto/customers/list` — Leitura de clientes na Cakto (para análise/CRM).
  - body: { customer_id?: string, search?: string, page?: integer, account?: string, customer_ids?: string[] }
- `POST https://api.mcp.ai/api/cakto/list/accounts` — Lista contas Cakto (apps do painel) vinculadas a este install — id, label e apelido.
  - body: { account?: string }
- `POST https://api.mcp.ai/api/cakto/orders/analytics` — Analytics de vendas na Cakto: métricas financeiras agregadas por canal/campanha.
  - body: { group_by?: string, start_date?: string, end_date?: string, product?: string, offer?: string, account?: string }
- `POST https://api.mcp.ai/api/cakto/orders/get` — Leitura de pedidos na Cakto.
  - body: { order_id?: string, status?: string, type?: string, offer_type?: string, payment_method?: string, customer?: string, product?: string, paid_at_gte?: string, paid_at_lt?: string, page?: integer, account?: string, order_ids?: string[] }
- `POST https://api.mcp.ai/api/cakto/orders/list` — Leitura de pedidos na Cakto.
  - body: { order_id?: string, status?: string, type?: string, offer_type?: string, payment_method?: string, customer?: string, product?: string, paid_at_gte?: string, paid_at_lt?: string, page?: integer, account?: string, order_ids?: string[] }
- `POST https://api.mcp.ai/api/cakto/products` — Lista produtos da conta na Cakto (filtros opcionais: search, page).
  - body: { search?: string, page?: integer, account?: string }
- `POST https://api.mcp.ai/api/cakto/subscription/churn` — Assinaturas perdidas: lista canceladas/inativas do negócio + métricas agregadas (valor em risco, nº de clientes afetados). Filtros de período opcionais.
  - body: { start_date?: string, end_date?: string, page?: integer, account?: string }
- `POST https://api.mcp.ai/api/cakto/subscriptions/get` — Leitura de assinaturas na Cakto.
  - body: { subscription_id?: string, status?: string, payment_method?: string, current_situation?: string, search?: string, ordering?: string, limit?: integer, page?: integer, account?: string, subscription_ids?: string[] }
- `POST https://api.mcp.ai/api/cakto/subscriptions/list` — Leitura de assinaturas na Cakto.
  - body: { subscription_id?: string, status?: string, payment_method?: string, current_situation?: string, search?: string, ordering?: string, limit?: integer, page?: integer, account?: string, subscription_ids?: string[] }

## Example prompts
- "How much did I sell on Cakto in the last 30 days?"
- "Which channels (utm_source) drove the most net revenue?"
- "List my active subscriptions and this month's churn"

## More
- Page: https://mcp.ai/cakto
- Agent spec (llms.txt): https://mcp.ai/cakto/llms.txt
- Postman collection: https://mcp.ai/cakto/postman.json
