{"openapi":"3.1.0","info":{"title":"GrowPanel API","version":"1.0.0","description":"GrowPanel REST API. SaaS analytics for subscription businesses — MRR, customers, cashflow, retention, forecasts. All endpoints require an API key passed as `Authorization: Bearer <key>`."},"servers":[{"url":"https://api.growpanel.io","description":"Production"},{"url":"https://api-dev.growpanel.io","description":"Development"}],"tags":[{"name":"Reports — MRR","description":"MRR over time, summary KPIs, daily growth, committed MRR."},{"name":"Reports — Leads & Trials","description":"Lead acquisition, trial starts, conversion funnel."},{"name":"Reports — Cashflow","description":"Cash received, failed payments, refunds, failure rate, outstanding AR."},{"name":"Reports — Payouts","description":"Stripe accounts: payouts to your banks, every Stripe fee (by type or currency, with the effective fee rate) and your Stripe balance."},{"name":"Reports — Retention & Cohorts","description":"NRR / GRR / customer retention and cohort tracking."},{"name":"Reports — Churn","description":"Scheduled future churn and AI-summarised cancellation reasons."},{"name":"Reports — Customers & Activity","description":"Per-country metrics, customer concentration, activity feed, custom-variable values."},{"name":"Customers","description":"List and inspect customers (analytics view)."},{"name":"Plans","description":"List subscription plans configured in the billing source."},{"name":"Data — Plans","description":"Raw plan CRUD against a data source (separate from the analytics `Plans` view)."},{"name":"Data — Plan Groups","description":"Bundle plans together so reports treat them as one product."},{"name":"Data — Segments","description":"Saved filter combinations applied via the `segment` param on report endpoints."},{"name":"Data — Data Sources","description":"List connected billing systems and monitor import progress."},{"name":"Data — Customers","description":"Raw customer rows for a data source (ingestion-level view, different from the analytics `Customers` endpoints)."},{"name":"Data — Invoices","description":"Raw invoices imported from a data source."},{"name":"Profile","description":"The current user's profile (name, locale, timezone, accounts)."},{"name":"Webhooks","description":"Subscribe HTTPS URLs to event notifications."},{"name":"Settings","description":"Notification preferences (daily/weekly/monthly reports, alert thresholds)."}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"API key from /account/api-keys, passed as `Authorization: Bearer <key>`"}},"schemas":{},"parameters":{}},"paths":{"/reports/summary":{"get":{"summary":"Top-level KPIs (MRR, ARR, subscribers, ARPA)","description":"Snapshot of headline metrics now plus 30/60/180/365-day-ago values and percentage changes. The single most common dashboard endpoint. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getSummary({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_summary(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"KPI snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"mrr_current":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"mrr_30":{"type":"number","description":"MRR 30 days ago."},"mrr_60":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"mrr_180":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"mrr_365":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arr_current":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arr_30":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arr_60":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arr_180":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arr_365":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"subscribers_current":{"type":"number"},"subscribers_30":{"type":"number"},"subscribers_60":{"type":"number"},"subscribers_180":{"type":"number"},"subscribers_365":{"type":"number"},"arpa_current":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arpa_30":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arpa_60":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arpa_180":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arpa_365":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"mrr_percentage_change_30":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mrr_percentage_change_60":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mrr_percentage_change_180":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mrr_percentage_change_365":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arr_percentage_change_30":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arr_percentage_change_60":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arr_percentage_change_180":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arr_percentage_change_365":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"subscribers_percentage_change_30":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"subscribers_percentage_change_60":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"subscribers_percentage_change_180":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"subscribers_percentage_change_365":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arpa_percentage_change_30":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arpa_percentage_change_60":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arpa_percentage_change_180":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"arpa_percentage_change_365":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/mrr":{"get":{"summary":"MRR time series with movements","description":"One row per period (day/week/month/...) with the full set of MRR movements (new, expansion, contraction, churn, reactivation), totals (MRR, ARR, subscribers, ARPA, ASP, LTV), and retention metrics (NRR, GRR, churn rates). Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getMrr({\n    query: { date: \"20260101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_mrr(\n    date=\"20260101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetMrr(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","enum":["last-period","last-year"],"description":"Overlay a comparison series for the previous period or same period last year."},"required":false,"name":"compare","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Set `true` to include scheduled future movements (CMRR mode)."},"required":false,"name":"committed","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"MRR time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"end_date":{"type":"string","description":"Inclusive last date of the period.","example":"2026-01-01"},"new":{"type":"number","description":"MRR added by new customers in this period."},"expansion":{"type":"number","description":"MRR added by expansions (upgrades, quantity increases)."},"contraction":{"type":"number","description":"MRR lost to contractions (downgrades, quantity decreases)."},"churn":{"type":"number","description":"MRR lost to churn (negative)."},"reactivation":{"type":"number","description":"MRR recovered from previously-churned customers."},"paused":{"type":"number","description":"MRR of subscriptions that are paused right now (negative), dated when their paid period ran out. Pauses are not churn: churn rates, quick ratio and retention leave them out. When a pause ends the movement disappears, as if there had been no pause."},"resumed":{"type":"number","description":"Scheduled resumes of paused subscriptions (future periods, with committed=true only)."},"mrr_diff":{"type":"number","description":"Net MRR change in this period."},"customers_diff":{"type":"number","description":"Net change in customer count."},"new_customers":{"type":"number"},"expansion_customers":{"type":"number"},"contraction_customers":{"type":"number"},"churn_customers":{"type":"number"},"reactivation_customers":{"type":"number"},"paused_customers":{"type":"number","description":"Customers with a pause in this period."},"resumed_customers":{"type":"number","description":"Customers with a scheduled resume in this period."},"total_mrr":{"type":"number","description":"MRR at the end of this period."},"total_arr":{"type":"number","description":"ARR at the end of this period (= MRR × 12)."},"total_customers":{"type":"number"},"arpa":{"type":"number","description":"Average revenue per account at period end."},"asp":{"type":"number","description":"Average sale price (ARPA among paying customers)."},"quick_ratio":{"type":"number","description":"(new + expansion) / (churn + contraction). 4+ is healthy SaaS growth."},"fx_adjustment":{"type":"number","description":"MRR change attributable to FX rate movement only (no real revenue change)."},"net_mrr_diff":{"type":"number","description":"MRR change excluding FX impact."},"quantity":{"type":"number","description":"Total subscription quantity at period end."}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"breakdown":{"type":"string","description":"Set when a `breakdown` query param was used; identifies the grouping dimension."}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/mrr-growth":{"get":{"summary":"Cumulative MRR change per day","description":"Returns the running MRR delta within the current calendar month, day by day. Built for the dashboard \"MRR growth\" widget — the response is flat (one row per day) so the chart can render a current-month line plus an optional comparison overlay.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getMrrGrowth({\n    query: { date: \"20260501-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_mrr_growth(\n    date=\"20260501-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetMrrGrowth(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range covering the month to chart plus the compare month. Defaults to current month + last month.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$","description":"Override the comparison month (YYYY-MM). Defaults to the month before the date range's end.","example":"2025-05"},"required":false,"name":"compareMonth","in":"query"},{"schema":{"type":"string","description":"Comma-separated movement types to include. Subset of `new`, `expansion`, `contraction`, `churn`, `reactivation`, `paused`, `resumed`. Default: all of them.","example":"new,expansion"},"required":false,"name":"types","in":"query"}],"responses":{"200":{"description":"Cumulative MRR delta per day","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"number","description":"Day of month, 0–31 (0 is a synthetic anchor at zero)."},"cumulative_mrr":{"type":"number","description":"Cumulative MRR delta from day 1 of the current month through this day."},"cumulative_mrr_compare":{"type":"number","description":"Same metric for the compare month at the same day-of-month."}},"required":["date","cumulative_mrr"]}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/mrr-subtypes":{"get":{"summary":"MRR movement subtypes (why expansion / contraction / churn happened)","description":"Decomposes a movement type into its underlying MECHANISM, per period — how you tell genuine customer behavior from pricing/billing mechanics. e.g. whether \"expansion\" is real upsell (add-on, plan upgrade, quantity increase) or just a discount ending (discount_change → promo roll-off, NOT organic growth), and whether churn is voluntary vs delinquent (involuntary/failed-payment). Subtypes — expansion: quantity_change, plan_change (upgrade), add_on, price_change, frequency_change, discount_change (discount removed). contraction: quantity_change, plan_change (downgrade), price_change, frequency_change, discount_change (discount added). churn: voluntary vs delinquent. Use it to separate organic vs promo-driven NRR and catch a pricing lever masquerading as growth. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getMrrSubtypes({\n    query: { type: \"expansion\", date: \"20260701-20260731\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_mrr_subtypes(\n    type=\"expansion\",\n    date=\"20260701-20260731\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetMrrSubtypes(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","enum":["expansion","contraction","churn"],"description":"Which movement type to decompose."},"required":true,"name":"type","in":"query"},{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Per-period MRR (and distinct-customer counts) for each subtype of the requested movement type.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"nullable":true,"description":"`{ type, labels: {subtype: human-label}, list: { <subtype>: {date: mrr}, <subtype>_customers: {date: count} } }`."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/latest-activity":{"get":{"summary":"Recent customer activity feed","description":"A merged feed of recent MRR movements, scheduled cancellations, and failed payments, sorted newest first. Used for activity widgets and change-detection polling.","tags":["Reports — Customers & Activity"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getLatestActivity({\n    query: { limit: \"10\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_latest_activity(\n    limit=\"10\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetLatestActivity(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Maximum rows (1–100, default 30).","example":"30"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Lookback window in days (1–365, default 30).","example":"30"},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","enum":["0","1"],"description":"`0` to omit failed payments. Default `1` (include)."},"required":false,"name":"include_failed","in":"query"},{"schema":{"type":"string","enum":["0","1"],"description":"`0` to omit recovered payments (a failed invoice that was paid later, dated when it was paid). Default `1` (include)."},"required":false,"name":"include_recovered","in":"query"},{"schema":{"type":"string","enum":["0","1"],"description":"`1` to include upcoming scheduled cancellations. Default `0` (exclude)."},"required":false,"name":"include_scheduled","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"}],"responses":{"200":{"description":"Activity feed","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["movement","failed_payment","payment_recovered","scheduled"],"description":"Where the event came from."},"type":{"type":"string","description":"Event type — `new`, `expansion`, `contraction`, `churn`, `reactivation`, `paused`, `resumed`, `failed_payment` or `payment_recovered`."},"label":{"type":"string","description":"Human-readable event name, e.g. `Paused` or `Scheduled to churn`."},"subtype":{"type":"string","nullable":true},"date":{"type":"string","description":"When the event was recorded.","example":"2026-01-15T10:30:00Z"},"effective_date":{"type":"string","description":"When the event takes effect (future for scheduled events).","example":"2026-01-15T10:30:00Z"},"overdue_date":{"type":"string","nullable":true,"description":"When the payment first went past due (failed_payment only).","example":"2026-01-15T10:30:00Z"},"customer_id":{"type":"string"},"customer_name":{"type":"string","nullable":true},"customer_email":{"type":"string","nullable":true},"amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["source","type","date","effective_date","customer_id","customer_name","customer_email","amount","currency"]}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/leads":{"get":{"summary":"Leads and conversion funnel over time","description":"Per-period funnel metrics: lead counts, trial counts, conversion rates, and average time-to-paid. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Leads & Trials"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getLeads({\n    query: { date: \"20260101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_leads(\n    date=\"20260101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetLeads(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Leads time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"leads":{"type":"number"},"leads_percent_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"trials":{"type":"number"},"leads_converted":{"type":"number","description":"Leads acquired in this period that have since become paying."},"trials_converted":{"type":"number","description":"Trials started in this period that have since become paying."},"trials_percent_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"lead_to_trial_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"lead_to_trial_rate_percent_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"trial_to_paid_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"trial_to_paid_rate_percent_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"lead_to_paid_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"lead_to_paid_rate_percent_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"lead_to_paid_days":{"type":"number","description":"Average days from lead acquisition to first paid invoice."},"trial_to_paid_days":{"type":"number","description":"Average days from trial start to first paid invoice."}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/leads-summary":{"get":{"summary":"Leads funnel KPIs","description":"Headline funnel numbers over rolling 30/60/180/365-day windows, with percentage-change comparisons.","tags":["Reports — Leads & Trials"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getLeadsSummary({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_leads_summary(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetLeadsSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Funnel KPIs","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"leads_30":{"type":"number"},"leads_60":{"type":"number"},"leads_180":{"type":"number"},"leads_365":{"type":"number"},"trials_30":{"type":"number"},"trials_60":{"type":"number"},"trials_180":{"type":"number"},"trials_365":{"type":"number"},"leads_percentage_change_30":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"leads_percentage_change_60":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"leads_percentage_change_180":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"leads_percentage_change_365":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"trials_percentage_change_30":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"trials_percentage_change_60":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"trials_percentage_change_180":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"trials_percentage_change_365":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cohort":{"get":{"summary":"Cohort retention analysis","description":"Tracks groups of customers across subsequent periods to show how much of their initial MRR and customer count is retained. The final row in `list` is an `\"average\"` aggregate across all cohorts. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Retention & Cohorts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCohort({\n    query: { date: \"20250101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cohort(\n    date=\"20250101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCohort(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Cohort retention table","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"cohort_group":{"type":"string","description":"Cohort identifier (period or breakdown value). The final row uses `\"average\"`."},"label":{"type":"string"},"initial_mrr":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"initial_customers":{"type":"number"},"periods":{"type":"array","items":{"type":"object","properties":{"mrr_retained":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"customers_retained":{"type":"number"},"mrr_retention":{"type":"number","description":"MRR retention relative to the cohort's starting MRR."},"customer_retention":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"nrr":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mrr_churn":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"customer_churn":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."}}},"description":"One entry per subsequent period (period 0 is the cohort start)."}},"required":["cohort_group","label","initial_mrr","initial_customers","periods"]}},"limits":{"type":"object","properties":{"retention":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"nrr":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"churn":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"netChurn":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}}},"description":"Min/max values across all cohorts. Useful for setting chart axis bounds."}},"required":["list","limits"]},"breakdown":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/transactions":{"get":{"summary":"Cashflow received over time","description":"Per-period cash received, broken down by source: monthly subs, yearly subs, metered, one-time (after discounts), then refunds, processing fees and currency conversion, with discounts and taxes for reference. Gross cashflow is the revenue after discounts, without taxes; Net cashflow is Gross minus refunds; fees are not deducted from either. With `payouts=1`, platform income (Stripe Connect application fees) is added as a revenue line inside gross and net cashflow, for accounts that earn it. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getTransactions({\n    query: { date: \"20260101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_transactions(\n    date=\"20260101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetTransactions(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","enum":["1"],"description":"Set `1` to include platform income (Stripe Connect application fees the account earned) as `platform_income`, inside gross and net cashflow, with a projection for the running period (`platform_income_forecast`). Only without customer filters and without `breakdown` (platform income belongs to no customer)."},"required":false,"name":"payouts","in":"query"},{"schema":{"type":"string","description":"Only these categories, space-separated: `month_sub`, `year_sub`, `quarter_sub`, `week_sub`, `day_sub`, `metered`, `one_time`, `discount`, `refund`, `fee`, `tax`, `fx_loss`, and with `payouts=1` `platform_income`. With `breakdown`, picking `fee`, `refund` or `fx_loss` splits those by group too (e.g. fees by payment method).","example":"fee"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Cashflow time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"month_sub":{"type":"number","description":"Cash from monthly subscription billings."},"year_sub":{"type":"number","description":"Cash from yearly subscription billings."},"week_sub":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"day_sub":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"metered":{"type":"number","description":"Cash from usage-based / metered billing."},"one_time":{"type":"number","description":"One-time charges and invoices."},"discount":{"type":"number","description":"Discounts given (negative number), for reference: already taken off the revenue lines, so not deducted again."},"refund":{"type":"number","description":"Refunds issued (negative number). Deducted from Gross cashflow to reach Net cashflow."},"fee":{"type":"number","description":"Processing fees (negative number): the fee on each payment, plus for Stripe (without customer filters) the processing fees charged apart from the payments: network costs, card processing, other payment methods, network tokens, Terminal and dispute fees. A cost of collecting, not deducted from Gross or Net cashflow. Stripe Billing, Tax, Radar, payout fees and other product fees are in the payout fees report only."},"tax":{"type":"number","description":"Taxes collected (passed through to the tax authorities), for reference: not part of Gross or Net cashflow."},"fx_loss":{"type":"number","description":"Currency conversion: what converting payments into the balance currency cost (negative number). A cost of collecting, not deducted from Gross or Net cashflow."},"platform_income":{"type":"number","description":"Platform income (Stripe Connect application fees), with `payouts=1` only."},"platform_income_forecast":{"type":"number","description":"Projected platform income for the running period, with `payouts=1` only."},"gross_amount":{"type":"number","description":"Gross cashflow: all the revenue that landed in the period, after discounts, without taxes."},"net_amount":{"type":"number","description":"Net cashflow: Gross cashflow minus refunds."},"net_amount_change_pct":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/transactions-summary":{"get":{"summary":"Cashflow KPIs (MTD / QTD / YTD)","description":"Headline cashflow numbers for month-to-date, quarter-to-date, year-to-date, with percentage change vs the same window in the previous period.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getTransactionsSummary({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_transactions_summary(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetTransactionsSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Cashflow KPIs","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"mtd":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"prev_mtd":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"mtd_change_pct":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"qtd":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"prev_qtd":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"qtd_change_pct":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"ytd":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"prev_ytd":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"ytd_change_pct":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/map":{"get":{"summary":"Per-country metrics for a choropleth map","description":"Returns a single object keyed by country code, with every available country-level metric. Countries with trials/leads but no MRR are included. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Customers & Activity"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getMap();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_map()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetMap(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Per-country metrics","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"object","additionalProperties":{"type":"object","properties":{"current_mrr":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"subscribers":{"type":"number"},"arpa":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"asp":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"customer_churn_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"net_mrr_churn":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"ltv":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"leads":{"type":"number"},"leads_converted":{"type":"number"},"lead_conversion_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"new_trials":{"type":"number"},"trials_converted":{"type":"number"},"trial_conversion_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"payment_failure_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mrr_percent":{"type":"number","description":"This country's share of total MRR."},"subscribers_percent":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"leads_percent":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"trials_percent":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."}}},"description":"Map from ISO 3166 alpha-2 country code (lowercase) to that country's metrics."}},"required":["list"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/retention":{"get":{"summary":"Retention metrics over time","description":"NRR, GRR, customer retention, and cohort size across the requested window. Baseline is the start period; each row is one period offset forward. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Retention & Cohorts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getRetention({\n    query: { date: \"20260101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_retention(\n    date=\"20260101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetRetention(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"How many months back to anchor the baseline. Default 1 for monthly intervals, 12 for yearly."},"required":false,"name":"trailing_months","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Retention time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Target period end date.","example":"2026-01-01"},"baseline_date":{"type":"string","description":"Baseline period end (the cohort anchor).","example":"2026-01-01"},"baseline_mrr":{"type":"number","description":"MRR of the cohort at baseline, converted at the baseline period's FX."},"target_mrr":{"type":"number","description":"MRR of those same cohort customers at the target date."},"grr_mrr":{"type":"number","description":"GRR numerator — target MRR with each customer capped at their baseline MRR."},"cohort_customers":{"type":"number","description":"Customers in the baseline cohort."},"retained_customers":{"type":"number","description":"Cohort customers still active at the target date."},"churned_customers":{"type":"number"},"expansion":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"expansion_customers":{"type":"number"},"contraction":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"contraction_customers":{"type":"number"},"churn":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"churn_customers":{"type":"number"},"reactivation":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"reactivation_customers":{"type":"number"},"fx_adjustment":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"nrr":{"type":"number","description":"Net revenue retention. >100 means expansion outpaces churn."},"grr":{"type":"number","description":"Gross revenue retention. Always ≤100."},"customer_retention_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"customer_churn_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mrr_churn_rate":{"type":"number","description":"Gross MRR churn rate (= 100 - GRR)."},"net_mrr_churn_rate":{"type":"number","description":"Net MRR churn rate (= 100 - NRR). Negative when expansion exceeds churn."},"nrr_avg":{"type":"number","description":"Rolling-window average NRR."},"grr_avg":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"customer_retention_avg":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"customer_churn_avg":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mrr_churn_avg":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"net_mrr_churn_avg":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"arpa":{"type":"number","description":"Average MRR per retained cohort customer at the target date."},"ltv":{"type":"number","description":"Lifetime value = arpa / monthly customer churn (uses rolling-window churn_avg)."},"customer_lifetime":{"type":"number","description":"Average months before churn = 1 / monthly churn rate."}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"trailing_months":{"type":"number"},"baseline_period":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"target_period":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"}},"required":["result","currency","trailing_months","baseline_period","target_period"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cmrr-summary":{"get":{"summary":"Committed MRR snapshot","description":"CMRR = current MRR + scheduled future changes (already-known expansions, contractions, churn). Useful for forecasting where MRR is locked in to go. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCmrrSummary({\n    query: { baseCurrency: \"usd\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cmrr_summary(\n    baseCurrency=\"usd\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCmrrSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"CMRR snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"cmrr_current":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"cmrr_30":{"type":"number","description":"CMRR 30 days from now."},"cmrr_60":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"cmrr_180":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"cmrr_365":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/trial-outcomes":{"get":{"summary":"Trial outcomes over time","description":"Per-period breakdown of what happened to the trials started in each period: converted (split into still active today and churned since), still on trial, cancelled, or ended without purchase, plus the conversion rate. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Leads & Trials"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getTrialOutcomes({\n    query: { date: \"20260101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_trial_outcomes(\n    date=\"20260101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetTrialOutcomes(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Trial outcomes time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"trials":{"type":"number"},"converted":{"type":"number"},"still_active":{"type":"number","description":"Converted trials that are an active (or past-due) customer today."},"converted_churned":{"type":"number","description":"Converted trials that have churned since (converted minus still_active)."},"active_trial":{"type":"number"},"cancelled":{"type":"number"},"ended_no_purchase":{"type":"number"},"other":{"type":"number","description":"Present only when non-zero."},"conversion_rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"still_active_rate":{"type":"number","nullable":true,"description":"still_active as a share of converted; null when nothing converted."}}}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/lead-outcomes":{"get":{"summary":"Lead outcomes over time","description":"Per-period breakdown of what happened to the leads created in each period: converted to paying, started a trial, still a lead, or lost, plus the conversion rate. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Leads & Trials"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getLeadOutcomes({\n    query: { date: \"20260101-20260531\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_lead_outcomes(\n    date=\"20260101-20260531\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetLeadOutcomes(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Lead outcomes time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"leads":{"type":"number"},"converted":{"type":"number"},"active_trial":{"type":"number"},"still_lead":{"type":"number"},"lost":{"type":"number"},"other":{"type":"number","description":"Present only when non-zero."},"conversion_rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."}}}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/forecast/cashflow-forecast":{"get":{"summary":"Cashflow forecast — projected cash collection","description":"Projects the cash the account will collect, period by period, from the subscriptions it has today. Each active subscription is walked forward on its own billing schedule, so annual plans land as one payment on their renewal date rather than spread across the year. A committed-cash view — it does not model new customers (use the MRR forecast for growth modelling). Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowForecast({\n    query: { horizon: \"12\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_forecast(\n    horizon=\"12\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowForecast(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Months to project. Default 12.","example":"12"},"required":false,"name":"horizon","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Set to `1` to add estimated one-time / usage payments.","example":"1"},"required":false,"name":"includeOneTime","in":"query"},{"schema":{"type":"string","description":"Set to `1` to subtract estimated refunds.","example":"1"},"required":false,"name":"includeRefunds","in":"query"},{"schema":{"type":"string","description":"Set to `1` to shift each customer's cash by their measured invoice-to-payment delay and deduct payments that fail and are never recovered.","example":"1"},"required":false,"name":"includeDelay","in":"query"},{"schema":{"type":"string","description":"Set to `1` to give the period holding today its whole total: the payments already received in it (as in the cashflow report) plus what's expected for the rest of it. Without it, that period counts only from today.","example":"1"},"required":false,"name":"includeReceived","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Cashflow forecast time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"monthly_renewals":{"type":"number","description":"Cash from monthly plans billing in this period."},"annual_renewals":{"type":"number","description":"Cash from yearly plans billing in this period (counted in full when billed, not spread across the year)."},"quarterly_renewals":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"weekly_renewals":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"one_time_estimate":{"type":"number","description":"Estimated one-time / usage cash (avg of the last 6 months). Present when includeOneTime=1."},"refund_estimate":{"type":"number","description":"Estimated refunds (negative). Present when includeRefunds=1."},"cash_in":{"type":"number","description":"Total expected cash received in this period. For the period holding today, only from today on."},"monthly_cash":{"type":"number","description":"Monthly plans as charted: the same as monthly_renewals, except that with includeReceived=1 the period holding today also counts what has already come in (after discounts, as in the cashflow report). Likewise annual_cash, quarterly_cash and weekly_cash."},"annual_cash":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"quarterly_cash":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"weekly_cash":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"monthly_renewals_received":{"type":"number","description":"Period holding today only: monthly-plan payments received so far in it. Likewise annual_, quarterly_ and weekly_renewals_received."},"cash_received":{"type":"number","description":"Period holding today only: subscription payments received so far in it."},"cash_in_projected":{"type":"number","description":"Period holding today only: cash_received plus cash_in, the projected total for the whole period."},"monthly_customers":{"type":"number"},"annual_customers":{"type":"number"},"quarterly_customers":{"type":"number"},"weekly_customers":{"type":"number"},"customers_renewing":{"type":"number"}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"interval":{"type":"string"},"horizon":{"type":"number"},"summary":{"type":"object","properties":{"total":{"type":"number","description":"Total forecast cash over the horizon."},"avg_monthly":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"annual_concentration":{"type":"number","description":"Share (0–1) of forecast cash concentrated in annual renewals."}}},"payment_timing":{"type":"object","properties":{"applied":{"type":"boolean"},"invoiced_pct":{"type":"number","nullable":true},"avg_delay_days":{"type":"number","nullable":true},"permanent_failure_pct":{"type":"number","nullable":true}},"description":"What the includeDelay option applied (present when includeDelay=1)."},"excluded":{"type":"number","description":"Number of customers that carry MRR but have no known renewal date, so their cash is not projected."}},"required":["result","currency","interval","horizon","summary","payment_timing","excluded"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/forecast/cashflow-forecast-detail":{"get":{"summary":"Cashflow forecast — customers renewing in a period","description":"The individual subscriptions behind one cell of the cashflow forecast: who renews, when, and for how much. Drill-down for /forecast/cashflow-forecast.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowForecastDetail({\n    query: { selected-date: \"2026-03-01\", selected-type: \"annual\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_forecast_detail(\n    selected-date=\"2026-03-01\",\n    selected-type=\"annual\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowForecastDetail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Period date to drill into (matches a `date` from the forecast).","example":"2026-03-01"},"required":false,"name":"selected-date","in":"query"},{"schema":{"type":"string","description":"Billing-frequency bucket: `monthly`, `annual`, `quarterly`, `weekly`.","example":"annual"},"required":false,"name":"selected-type","in":"query"},{"schema":{"type":"string","description":"Range mode: first renewal date to include (YYYY-MM-DD). Use with `to` instead of `selected-date`/`selected-type` to list every renewal in a date window, one row per customer and renewal date.","example":"2026-09-22"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","description":"Range mode: last renewal date to include (YYYY-MM-DD, inclusive).","example":"2026-10-21"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","description":"Range mode: comma-separated billing frequencies to include (`monthly`, `annual`, `quarterly`, `weekly`). Omit for all.","example":"annual,quarterly"},"required":false,"name":"types","in":"query"},{"schema":{"type":"string","enum":["date","amount"],"description":"Range mode: `date` (soonest first, default) or `amount` (largest first)."},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","description":"Range mode: max rows, 1-100 (default 100).","example":"10"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Customers renewing in the selected period","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"object","additionalProperties":{"type":"object","properties":{"customer_id":{"type":"string"},"customer_name":{"type":"string","nullable":true},"customer_email":{"type":"string","nullable":true},"billing_freq":{"type":"string"},"period_end":{"type":"string","description":"Next billing date.","example":"2026-01-01"},"amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}}},"required":["list"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/forecast/ai/summary":{"get":{"summary":"MRR forecast — projection + scenario levers","description":"Deterministic MRR projection built from the account's own recent movements, with optional scenario levers. Returns the baseline-vs-scenario trajectory, the baseline rates it is derived from, and 1/2/3-year snapshots. Transparent customer-count model, reproducible by hand. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getForecastMrr({\n    query: { horizon: \"36\", months_back: \"6\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_forecast_mrr(\n    horizon=\"36\",\n    months_back=\"6\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetForecastMrr(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Months to project. Default 36.","example":"36"},"required":false,"name":"horizon","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Baseline window: recent complete months the rates are averaged from. One of `3`, `6`, `12`. Default `6`.","example":"6"},"required":false,"name":"months_back","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Scenario lever: % change to the monthly new-customer count.","example":"50"},"required":false,"name":"new_mrr_change_pct","in":"query"},{"schema":{"type":"string","description":"Scenario lever: change to monthly Net Revenue Retention, in percentage points.","example":"1"},"required":false,"name":"churn_change_pct","in":"query"},{"schema":{"type":"string","description":"Scenario lever: % price change.","example":"10"},"required":false,"name":"price_change_pct","in":"query"},{"schema":{"type":"string","description":"Who a price change applies to: `new` (new customers only) or `all`.","example":"new"},"required":false,"name":"price_scope","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"MRR forecast","content":{"application/json":{"schema":{"type":"object","properties":{"as_of":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"base_currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"current_mrr":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"horizon_months":{"type":"number"},"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"total_mrr":{"type":"number","description":"Baseline MRR — actual for past periods, projected for future ones."},"scenario_mrr":{"type":"number","nullable":true,"description":"Scenario MRR when levers are applied; null across the historical range."},"goal_mrr":{"type":"number","nullable":true,"description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"confidence_upper":{"type":"number","nullable":true,"description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"confidence_lower":{"type":"number","nullable":true,"description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}},"summary":{"type":"object","properties":{"forecast_current":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"forecast_30":{"type":"number","description":"Projected MRR in 1 year."},"forecast_60":{"type":"number","description":"Projected MRR in 2 years."},"forecast_180":{"type":"number","description":"Projected MRR in 3 years."},"forecast_365":{"type":"number","description":"Projected MRR at the end of the horizon."}}},"rates":{"type":"object","properties":{"new_customers_per_month":{"type":"number"},"asp":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"arpa":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"nrr_rate":{"type":"number","description":"Monthly net revenue retention (1.0 = flat)."},"current_customers":{"type":"number"}},"description":"The baseline rates the projection is built from."},"scenario_applied":{"type":"boolean"}},"required":["as_of","base_currency","current_mrr","horizon_months","result","summary","rates","scenario_applied"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/forecast/ai/summary-table":{"get":{"summary":"MRR forecast — period decomposition table","description":"The MRR forecast broken down per period into new business, existing MRR change, customer count and total MRR — the table behind /forecast/ai/summary. Accepts the same query params.","tags":["Reports — MRR"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getForecastMrrTable({\n    query: { horizon: \"36\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_forecast_mrr_table(\n    horizon=\"36\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetForecastMrrTable(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","example":"36"},"required":false,"name":"horizon","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Baseline window (3 / 6 / 12 months). Default 6.","example":"6"},"required":false,"name":"months_back","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string"},"required":false,"name":"new_mrr_change_pct","in":"query"},{"schema":{"type":"string"},"required":false,"name":"churn_change_pct","in":"query"},{"schema":{"type":"string"},"required":false,"name":"price_change_pct","in":"query"},{"schema":{"type":"string"},"required":false,"name":"price_scope","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Forecast decomposition, keyed by metric then date","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}}},"required":["list"],"description":"list[<metric>][<date>] — metrics include new_biz, net_change, customers and total_mrr."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-failed-payments":{"get":{"summary":"Failed payments over time","description":"Per-period failed payment volume split by ultimate outcome (recovered, still unpaid, churned). Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowFailedPayments({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_failed_payments(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowFailedPayments(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Failed payments time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"failed_amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"recovered":{"type":"number","description":"Amount that was later successfully charged."},"still_unpaid":{"type":"number","description":"Amount still outstanding (customer not churned yet)."},"churned":{"type":"number","description":"Amount associated with customers who subsequently churned."},"failed_invoices":{"type":"number"},"recovered_customers":{"type":"number"},"still_unpaid_customers":{"type":"number"},"churned_customers":{"type":"number"},"affected_customers":{"type":"number"},"total_retry_attempts":{"type":"number"}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-failed-payments-summary":{"get":{"summary":"Failed payment KPIs","description":"Headline failed-payment metrics for MTD / QTD / YTD, plus comparison vs the previous window.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowFailedPaymentsSummary({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_failed_payments_summary(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowFailedPaymentsSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Failed payments KPIs","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"mtd_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"prev_mtd_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"qtd_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"prev_qtd_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"ytd_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"prev_ytd_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"mtd_recovery_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"prev_mtd_recovery_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"ytd_recovery_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"prev_ytd_recovery_rate":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mtd_failed_pct":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"prev_mtd_failed_pct":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"ytd_failed_pct":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"prev_ytd_failed_pct":{"type":"number","description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mtd_still_unpaid_change_pct":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"ytd_still_unpaid_change_pct":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mtd_recovery_rate_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"ytd_recovery_rate_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mtd_failed_pct_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"ytd_failed_pct_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mtd_failed_invoices":{"type":"number"},"ytd_failed_invoices":{"type":"number"},"prev_mtd_failed_invoices":{"type":"number"},"prev_ytd_failed_invoices":{"type":"number"}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-refunds":{"get":{"summary":"Refunds issued over time","description":"Per-period refunds: the amount, the number of refunds, the customers refunded and the refund rate (refunds as a share of Gross cashflow), overall or by group (`breakdown`). Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowRefunds({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_refunds(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowRefunds(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Refunds time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"amount":{"type":"number","description":"Total refunded in this period (positive number)."},"count":{"type":"number","description":"Number of refunds."},"customers":{"type":"number","description":"Customers refunded."},"rate":{"type":"number","nullable":true,"description":"Refund rate: refunds as a share of Gross cashflow (revenue after discounts, without taxes). Null without revenue."},"base":{"type":"number","description":"Gross cashflow the rate is measured against."},"refund_amount":{"type":"number","description":"Same as `amount` (older name)."},"refund_count":{"type":"number","description":"Same as `count` (older name)."},"customers_refunded":{"type":"number","description":"Same as `customers` (older name)."},"breakdown":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"count":{"type":"number"},"rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."}}},"description":"With `breakdown`: each group's refunds, count and refund rate (its refunds as a share of its own Gross cashflow)."}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-discounts":{"get":{"summary":"Discounts given over time","description":"Per-period discounts given: the amount, the customers with a discount and the discount rate (discounts as a share of the list price), overall or by group (`breakdown`, including `plan`). The Cashflow report's revenue lines are already after these discounts. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowDiscounts({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_discounts(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowDiscounts(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Discounts time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"amount":{"type":"number","description":"Discounts given in this period (positive number)."},"count":{"type":"number","description":"Customers with a discount."},"customers":{"type":"number","description":"Customers with a discount (same as `count`)."},"payments":{"type":"number","description":"Payments with a discount."},"rate":{"type":"number","nullable":true,"description":"Discount rate: discounts as a share of the list price (revenue before discounts). Null without revenue."},"base":{"type":"number","description":"List price the rate is measured against."},"breakdown":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"count":{"type":"number"},"rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."}}},"description":"With `breakdown`: each group's discounts, customers with a discount and discount rate. Discounts can also be grouped by `plan`."}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-failure-rate":{"get":{"summary":"Payment failure rate over time","description":"Percentage of invoices that failed to be collected in each period. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowFailureRate({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_failure_rate(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowFailureRate(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Failure rate time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"period":{"type":"string","description":"Same as date — kept for client compatibility."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"failed_invoices":{"type":"number"},"failure_rate":{"type":"number","description":"Failed invoices divided by total invoices in the period."}},"required":["date","period","currency","failed_invoices","failure_rate"]}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-failure-rate-summary":{"get":{"summary":"Payment failure rate KPI","description":"Headline failure-rate numbers for MTD / YTD, with percentage-point change vs the prior window.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowFailureRateSummary({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_failure_rate_summary(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowFailureRateSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Failure rate KPIs","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"mtd_failure_rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"prev_mtd_failure_rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"ytd_failure_rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"prev_ytd_failure_rate":{"type":"number","nullable":true,"description":"Percentage on a 0–100 scale (so 25 = 25%). May exceed 100 for NRR."},"mtd_failure_rate_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"ytd_failure_rate_change":{"type":"number","nullable":true,"description":"Period-over-period change as a percentage. `null` when the baseline is zero."},"mtd_failed_count":{"type":"number"},"ytd_failed_count":{"type":"number"},"prev_mtd_failed_count":{"type":"number"},"prev_ytd_failed_count":{"type":"number"}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cashflow-outstanding-unpaid":{"get":{"summary":"Outstanding unpaid invoices (aged)","description":"Snapshot of currently-outstanding invoice amounts aged into buckets: today (within 0 days overdue), 30/60/180/365+ days overdue. Only counts invoices that had at least one collection attempt — manual-collect invoices with no charge attempts are not visible (a known data-model limitation). Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Cashflow"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCashflowOutstandingUnpaid();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cashflow_outstanding_unpaid()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCashflowOutstandingUnpaid(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Outstanding AR snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"today_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"d30_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"d60_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"d180_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"d365_still_unpaid":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["summary","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payouts":{"get":{"summary":"Paid out to your banks over time","description":"What Stripe paid out to your bank accounts per period, one series per payout currency, converted to the base currency at each period's rates. Stripe accounts only (see `/reports/payouts-status`).","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayouts({\n    query: { date: \"20260101-20260930\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payouts(\n    date=\"20260101-20260930\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayouts(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"}],"responses":{"200":{"description":"Payouts time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Last day of the period (YYYY-MM-DD). Pass it as `selected-date` to the list/detail endpoints.","example":"2026-09-30"},"paid_out":{"type":"number","description":"Everything paid out in the period, all currencies."},"payouts":{"type":"number","description":"Number of payouts."},"breakdown":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"amount_forecast":{"type":"number","description":"Only on the period in progress: paid out so far plus the payout days the schedule has left in the period × the currency's average payout over the last 90 days."}}},"description":"Paid out per payout currency (keyed by lowercase currency code)."},"paid_out_forecast":{"type":"number","description":"Only on the period in progress: the projected total paid out (the sum of the currencies' projections). Not set for a manual payout schedule."}}}},"breakdown":{"type":"string","description":"Always `currency`."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"totals":{"type":"object","properties":{"paid_out":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"payouts":{"type":"number"}}}},"required":["result","breakdown","currency","totals"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payouts-table":{"get":{"summary":"Paid out per currency (table)","description":"The payouts as a table: a row per payout currency, then `paid_out` (all currencies) and `payouts` (count), each keyed by period end.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutsTable({\n    query: { date: \"20260101-20260930\", interval: \"month\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payouts_table(\n    date=\"20260101-20260930\",\n    interval=\"month\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutsTable(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"}],"responses":{"200":{"description":"Payouts table","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}},"description":"Rows keyed by currency code, `paid_out` or `payouts`; each row maps a period end to an amount (minor units of the base currency) or, for `payouts`, a count."},"currencies":{"type":"array","items":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"description":"The currency rows, largest first."}},"required":["list","currencies"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payouts-list":{"get":{"summary":"Payouts (list)","description":"Individual payouts: the latest in the range, or those of one period (`selected-date`). Each with its bank account, arrival date, the Stripe fees paid out with it and what customers paid into it.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutsList({\n    query: { selected-date: \"2026-09-30\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payouts_list(\n    selected-date=\"2026-09-30\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutsList(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Only the payouts of this period (its last day, as in the `date` of `/reports/payouts`).","example":"2026-09-30"},"required":false,"name":"selected-date","in":"query"},{"schema":{"type":"string","description":"Maximum number of payouts (1–500, default 100).","example":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["date","paid","fees"],"description":"Sort field. Default: newest first."},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"Payouts","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stripe payout id (`po_...`)."},"created":{"type":"string","description":"When Stripe made the payout (YYYY-MM-DD HH:MM:SS, UTC)."},"arrival":{"type":"string","description":"When it reached (or reaches) the bank."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"paid":{"type":"number","description":"Amount paid out, minor units of the payout's currency."},"bank":{"type":"string","description":"The bank account (bank name and last digits)."},"status":{"type":"string","description":"`paid`, `failed` or `canceled`."},"mode":{"type":"string","description":"`automatic` (Stripe's schedule) or `manual`."},"period":{"type":"string","description":"Last day of the period (YYYY-MM-DD). Pass it as `selected-date` to the list/detail endpoints.","example":"2026-09-30"},"fees":{"type":"number","description":"Stripe fees paid out with this payout (minor units of its currency, positive)."},"income":{"type":"number","description":"Platform income (Stripe Connect application fees) in this payout."},"paid_base":{"type":"number","description":"Amount paid out in the base currency, at its period's rates."},"payments":{"type":"number","nullable":true,"description":"What customers paid into this payout (paid out + fees − platform income), automatic payouts only."}}}}},"required":["list"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payout-fees":{"get":{"summary":"All Stripe fees over time","description":"Every fee Stripe charged per period, by fee type (default) or by currency, with each group's percentage and the effective fee rate (all fees ÷ the money that came in: customers' payments after discounts, with taxes, plus platform income). Fee types (`fee_kind` keys): `payment` Payment fees (the fee on each payment), `fx` Currency conversion (Stripe's conversion fee and exchange-rate margin on payments it converted into the balance currency, the cash flow report's FX loss), `card` Card processing, `network` Network costs, `billing` Stripe Billing, `invoicing` Invoicing, `tax` Stripe Tax, `revrec` Revenue Recognition, `sigma` Sigma and Data Pipeline, `connect` Connect, `identity` Identity, `fincon` Financial Connections, `dispute` Dispute fees, `terminal` Terminal, `issuing` Issuing, `tokens` Network tokens, `methods` Payment method fees, `payout` Payout fees, `credit` Credits and revenue share (money back, negative), `radar` Radar, `other` Other Stripe fees. Everything except `payment` and `fx` is taken straight from the Stripe balance and never shows on a payment.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutFees({\n    query: { date: \"20260101-20260930\", breakdown: \"currency\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payout_fees(\n    date=\"20260101-20260930\",\n    breakdown=\"currency\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutFees(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","enum":["currency"],"description":"Group by the currency Stripe charged the fees in instead of by fee type. Fees for the whole account (Radar, Sigma and Data Pipeline, Revenue Recognition, Connect, Identity, Financial Connections, credits) form one `account_wide` group (\"Account-wide fees\")."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Only these fee types, space-separated (see the fee types above).","example":"network card"},"required":false,"name":"fee_kind","in":"query"},{"schema":{"type":"string","description":"Only fees charged in these currencies, space-separated (lowercase ISO 4217).","example":"usd eur"},"required":false,"name":"currency","in":"query"}],"responses":{"200":{"description":"Fees time series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Last day of the period (YYYY-MM-DD). Pass it as `selected-date` to the list/detail endpoints.","example":"2026-09-30"},"fees":{"type":"number","description":"All fees in the period (after the filters)."},"fee_rate":{"type":"number","nullable":true,"description":"Effective fee rate, 0–100 scale."},"fees_forecast":{"type":"number","description":"Only on the period in progress: the projected fees for the whole period (the sum of the groups' projections)."},"breakdown":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string","description":"The fee type's or currency's name."},"amount":{"type":"number","description":"Fees in this group in the period (positive = cost; credits are negative)."},"pct":{"type":"number","nullable":true,"description":"By fee type: the group's share of all the money that came in (the types add up to the effective fee rate). By currency: that currency's own fee rate. 0–100 scale, `null` without money in."},"amount_forecast":{"type":"number","description":"Only on the period in progress (month after the 10th, quarter or year far enough in): the projected total for the period: the group's fee rate over the last 3 complete periods × the money the period is on pace to bring in (at the pace so far when the range has no earlier periods)."}}},"description":"Per fee type key (or currency code / `account_wide` with breakdown=currency)."}}}},"breakdown":{"type":"string","description":"`kind` (fee types) or `currency`."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"totals":{"type":"object","properties":{"fees":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"money_in":{"type":"number","description":"The money that came in over the range."},"fee_rate":{"type":"number","nullable":true},"largest":{"type":"object","nullable":true,"properties":{"key":{"type":"string"},"label":{"type":"string"},"amount":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}}}},"required":["result","breakdown","currency","totals"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payout-fees-table":{"get":{"summary":"All Stripe fees (table)","description":"The fees as a table: per group a row of amounts (`list[key]`) and of percentages (`list[\"pct:\" + key]`), then `fees` and `fee_rate`, each keyed by period end. Fee types (`fee_kind` keys): `payment` Payment fees (the fee on each payment), `fx` Currency conversion (Stripe's conversion fee and exchange-rate margin on payments it converted into the balance currency, the cash flow report's FX loss), `card` Card processing, `network` Network costs, `billing` Stripe Billing, `invoicing` Invoicing, `tax` Stripe Tax, `revrec` Revenue Recognition, `sigma` Sigma and Data Pipeline, `connect` Connect, `identity` Identity, `fincon` Financial Connections, `dispute` Dispute fees, `terminal` Terminal, `issuing` Issuing, `tokens` Network tokens, `methods` Payment method fees, `payout` Payout fees, `credit` Credits and revenue share (money back, negative), `radar` Radar, `other` Other Stripe fees. Everything except `payment` and `fx` is taken straight from the Stripe balance and never shows on a payment.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutFeesTable({\n    query: { date: \"20260101-20260930\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payout_fees_table(\n    date=\"20260101-20260930\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutFeesTable(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","enum":["currency"],"description":"Group by the currency Stripe charged the fees in instead of by fee type. Fees for the whole account (Radar, Sigma and Data Pipeline, Revenue Recognition, Connect, Identity, Financial Connections, credits) form one `account_wide` group (\"Account-wide fees\")."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Only these fee types, space-separated (see the fee types above).","example":"network card"},"required":false,"name":"fee_kind","in":"query"},{"schema":{"type":"string","description":"Only fees charged in these currencies, space-separated (lowercase ISO 4217).","example":"usd eur"},"required":false,"name":"currency","in":"query"}],"responses":{"200":{"description":"Fees table","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number","nullable":true}}},"groups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]},"description":"The group rows in order, largest first."},"by":{"type":"string","description":"`kind` or `currency`."}},"required":["list","groups","by"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payout-fees-detail":{"get":{"summary":"The fee lines behind a period","description":"The individual fees of one period (`selected-date`), optionally one group (`fee_group`: a fee type key, or with breakdown=currency a currency code or `account_wide`): Stripe's fee lines and the fee on each customer payment (with the customer), by date unless `sort` says otherwise. Fee types (`fee_kind` keys): `payment` Payment fees (the fee on each payment), `fx` Currency conversion (Stripe's conversion fee and exchange-rate margin on payments it converted into the balance currency, the cash flow report's FX loss), `card` Card processing, `network` Network costs, `billing` Stripe Billing, `invoicing` Invoicing, `tax` Stripe Tax, `revrec` Revenue Recognition, `sigma` Sigma and Data Pipeline, `connect` Connect, `identity` Identity, `fincon` Financial Connections, `dispute` Dispute fees, `terminal` Terminal, `issuing` Issuing, `tokens` Network tokens, `methods` Payment method fees, `payout` Payout fees, `credit` Credits and revenue share (money back, negative), `radar` Radar, `other` Other Stripe fees. Everything except `payment` and `fx` is taken straight from the Stripe balance and never shows on a payment.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutFeesDetail({\n    query: { selected-date: \"2026-09-30\", fee_group: \"network\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payout_fees_detail(\n    selected-date=\"2026-09-30\",\n    fee_group=\"network\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutFeesDetail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","enum":["currency"],"description":"Group by the currency Stripe charged the fees in instead of by fee type. Fees for the whole account (Radar, Sigma and Data Pipeline, Revenue Recognition, Connect, Identity, Financial Connections, credits) form one `account_wide` group (\"Account-wide fees\")."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Only these fee types, space-separated (see the fee types above).","example":"network card"},"required":false,"name":"fee_kind","in":"query"},{"schema":{"type":"string","description":"Only fees charged in these currencies, space-separated (lowercase ISO 4217).","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"The period (its last day, as in the `date` of `/reports/payout-fees`).","example":"2026-09-30"},"required":true,"name":"selected-date","in":"query"},{"schema":{"type":"string","description":"Only this group: a fee type key, or with breakdown=currency a currency code or `account_wide`.","example":"network"},"required":false,"name":"fee_group","in":"query"},{"schema":{"type":"string","description":"Maximum number of lines (1–1000, default 300)."},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["date","amount","type"],"description":"Sort field: `date`, `amount` (in the base currency) or `type`. Default: `date`, oldest first."},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction (default `asc` when `sort` is given)."},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"Fee lines","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stripe id of the fee (balance transaction or charge)."},"date":{"type":"string"},"kind":{"type":"string","description":"Fee type key."},"type":{"type":"string","description":"Fee type name."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"amount":{"type":"number","description":"The fee, minor units of its currency (positive = cost)."},"amount_base":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"description":{"type":"string","description":"Stripe's name for the fee."},"payout":{"type":"string","description":"The payout it was paid out with (balance fees)."},"customer_id":{"type":"string","description":"The customer (fees on a payment)."},"customer_name":{"type":"string","nullable":true},"customer_email":{"type":"string","nullable":true}}}},"total":{"type":"number","description":"Number of lines before the limit."}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payouts-balance":{"get":{"summary":"Stripe balance and next payout","description":"The Stripe balance right now, per currency (available, pending, on the way to the bank), the payout schedule and an estimate of the next payout. From a snapshot taken daily.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutsBalance();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payouts_balance()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutsBalance(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"}],"responses":{"200":{"description":"Balance","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"available":{"type":"number","description":"Available now, minor units of this currency."},"pending":{"type":"number","description":"Pending (not yet available)."},"next":{"type":"number","description":"Estimated amount of the next payout in this currency."},"in_transit":{"type":"number","description":"Paid out, not yet at the bank."},"available_base":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"pending_base":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"next_base":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"in_transit_base":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}},"in_transit":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"amount":{"type":"number"},"status":{"type":"string"},"bank":{"type":"string"},"created":{"type":"number","description":"Unix time the payout was made."},"arrival_date":{"type":"number","description":"Unix time it arrives."},"amount_base":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}},"schedule":{"type":"object","nullable":true,"properties":{"interval":{"type":"string","description":"`daily`, `weekly`, `monthly` or `manual`."},"delay_days":{"type":"number"},"weekly_anchor":{"type":"string"},"weekly_payout_days":{"type":"array","items":{"type":"string"}},"monthly_anchor":{"type":"number"},"monthly_payout_days":{"type":"array","items":{"type":"number"}}}},"next_payout_date":{"type":"string","nullable":true,"description":"Estimated date of the next payout (YYYY-MM-DD)."},"at":{"type":"string","nullable":true,"description":"When the snapshot was taken (ISO 8601)."},"totals":{"type":"object","properties":{"available":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"pending":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"next":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"in_transit":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/payouts-status":{"get":{"summary":"Whether payouts are available","description":"Whether the account can have payout data (a connected Stripe source; Chargebee and Recurly don't share payouts) and which kinds it has.","tags":["Reports — Payouts"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPayoutsStatus();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_payouts_status()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPayoutsStatus(context.Background(), nil)"}],"responses":{"200":{"description":"Payouts status","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"supported":{"type":"boolean"},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string","nullable":true},"status":{"type":"string"}}}},"has_payouts":{"type":"boolean"},"has_fees":{"type":"boolean"},"has_platform_income":{"type":"boolean","description":"Whether the account earns platform income (Stripe Connect application fees), shown in the Cashflow report with `payouts=1`."}}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/churn-scheduled":{"get":{"summary":"Scheduled future churn","description":"Per-period MRR loss already scheduled by customers who have clicked cancel but whose effective date is still in the future (Stripe `cancel_at_period_end` pattern). Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Churn"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getChurnScheduled({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_churn_scheduled(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetChurnScheduled(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Scheduled churn series","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Period start date in ISO 8601 (YYYY-MM-DD).","example":"2026-01-01"},"churn":{"type":"number","description":"MRR scheduled to churn in this period."},"contraction":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"churn_customers":{"type":"number"},"contraction_customers":{"type":"number"},"total_mrr":{"type":"number","description":"Total scheduled MRR loss (churn + contraction)."},"total_customers":{"type":"number"}}}},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/paused":{"get":{"summary":"Paused subscriptions right now","description":"Snapshot of subscriptions paused in the billing system right now (Stripe paused collection or status `paused`, Chargebee and Recurly pauses): paused MRR, paused subscribers, MRR due back within 30 days, and the paused customers. Billing systems only report current pauses, so there is no pause history and the `date` range is ignored. Paused MRR is not churn and is left out of churn rates. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Churn"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getPaused({\n    query: { sort: \"expected_back\", order: \"asc\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_paused(\n    sort=\"expected_back\",\n    order=\"asc\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetPaused(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Maximum customers in `list` (default 500, max 2000). Summary totals always cover everyone.","example":"500"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["mrr","paused_since","expected_back"],"description":"Sort `list` by MRR before the pause (default), pause date or expected resume date. Customers without a resume date sort last."},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction (default `desc`)."},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Paused subscriptions snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"has_pauses":{"type":"boolean","description":"Whether anything is paused right now."},"summary":{"type":"object","properties":{"paused_mrr_current":{"type":"number","description":"Total MRR paused right now (base currency)."},"paused_subscribers_current":{"type":"number","description":"Customers with every MRR-bearing subscription paused."},"paused_customers_current":{"type":"number","description":"Customers with at least one paused subscription."},"due_back_30_mrr":{"type":"number","description":"MRR scheduled to resume within 30 days (base currency)."},"due_back_30_customers":{"type":"number"}}},"total":{"type":"number","description":"Customers in the full list (before `limit`)."},"list":{"type":"array","items":{"type":"object","properties":{"customer_id":{"type":"string"},"customer_name":{"type":"string"},"customer_email":{"type":"string"},"fully_paused":{"type":"boolean","description":"Every MRR-bearing subscription is paused (customer status `paused`, left the subscriber count). False = some subscriptions are paused, others still billed."},"currency":{"type":"string","description":"Currency of the paused subscriptions (lower-case ISO 4217)."},"mrr_before_pause":{"type":"number","description":"MRR the paused subscriptions carried before the pause, in `currency`."},"mrr_before_pause_base_currency":{"type":"number","description":"Same, converted to the base currency."},"paused_since":{"type":"string","description":"When the pause took effect (end of the last paid period).","example":"2026-01-01"},"expected_back":{"type":"string","nullable":true,"description":"Earliest scheduled resume, or null when the billing system has no resume date.","example":"2026-01-01"},"due_back_30_base_currency":{"type":"number","description":"MRR scheduled to resume within the next 30 days, in the base currency."}}}}},"required":["has_pauses","summary","total","list"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/churn-reasons-summary":{"get":{"summary":"AI-categorised cancellation reasons","description":"A markdown-formatted analysis of cancellation feedback for the requested period, synthesised by AI. May return `{ summary: null, reason: \"no_comments\" }` if no cancellation feedback is available.","tags":["Reports — Churn"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getChurnReasonsSummary({\n    query: { date: \"20260101-20260531\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_churn_reasons_summary(\n    date=\"20260101-20260531\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetChurnReasonsSummary(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Set `true` to force a fresh AI run instead of returning the cached summary."},"required":false,"name":"regenerate","in":"query"}],"responses":{"200":{"description":"Churn reasons summary","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","nullable":true,"description":"Markdown summary (with embedded HTML for links to customer records), or `null` when there are no comments."},"comment_count":{"type":"number"},"total_cancellations":{"type":"string"},"generated_at":{"type":"string","description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"reason":{"type":"string","description":"Why the summary is null (e.g. `no_comments`)."}},"required":["summary"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cancellation-timing":{"get":{"summary":"Cancellation timing (lifetime churn)","description":"For customers grouped by when they started paying, the share who had cancelled by each point in their lifetime (day 1 / week 1 / month 3 …), topping out at the cohort's overall churn rate. `mode=trend` returns the same metric across signup cohorts over time. Answers \"do customers churn early vs late?\". Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Churn"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCancellationTiming({\n    query: { range: \"365\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cancellation_timing(\n    range=\"365\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCancellationTiming(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Group results into one series per value of this dimension. Built-in: `plan`, `currency`, `country`, `state`, `billing_freq`, `payment_method`, `pricing_model`, `subtype`, `industry`, `age`, `size`, `data_source`, `customer`, `cancel_reason`, `market`, `initial_recurring`, `net`, `start_year`. Custom variables use `custom_<key>`."},"required":false,"name":"breakdown","in":"query"},{"schema":{"type":"string","description":"Lifetime window in days to chart (e.g. `90`, `180`, `365`, `730`). Default `365`.","example":"365"},"required":false,"name":"range","in":"query"},{"schema":{"type":"string","enum":["distribution","trend"],"description":"`distribution` (default): share churned by each tenure point for the selected cohorts. `trend`: the same rates across signup cohorts over time."},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Cancellation-timing distribution (or trend series).","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"nullable":true,"description":"distribution mode: `list.count` and `list.cumulative_percent` keyed by tenure index. trend mode: `list.rate_<days>` keyed by cohort period."},"base":{"type":"number","description":"Customers in the selected cohorts (distribution mode)."},"total":{"type":"number","description":"Total cancellations observed (distribution mode)."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/cancellation-timing-detail":{"get":{"summary":"Cancellation timing — customer drill-down","description":"Lists the customers behind a cancellation-timing bucket. In `distribution` mode pass `selected-period`; in `trend` mode pass `selected-cohort` + `selected-threshold`. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Churn"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCancellationTimingDetail({\n    query: { selected-period: \"1\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_cancellation_timing_detail(\n    selected-period=\"1\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCancellationTimingDetail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Date range in `YYYYMMDD-YYYYMMDD` format. Defaults to the last 12 months when omitted.","example":"20260101-20260531"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string","description":"Aggregation interval. One of `day`, `week`, `month`, `quarter`, `year`. Default `month`.","example":"month"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","enum":["distribution","trend"]},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string","description":"Tenure bucket index (distribution mode)."},"required":false,"name":"selected-period","in":"query"},{"schema":{"type":"string","description":"Cohort period end date, yyyy-MM-dd (trend mode)."},"required":false,"name":"selected-cohort","in":"query"},{"schema":{"type":"string","description":"Tenure threshold in days (trend mode)."},"required":false,"name":"selected-threshold","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Customers in the selected cancellation-timing bucket.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"nullable":true,"description":"Customer rows in the selected bucket (under `result.list`)."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/customer-concentration":{"get":{"summary":"Top customers by MRR","description":"Active customers sorted by MRR descending, with each row's share of total revenue. Useful for spotting concentration risk. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Reports — Customers & Activity"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCustomerConcentration();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_customer_concentration()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCustomerConcentration(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Free-text search across name, email, and external ID."},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer or transaction status filter. Prefix value with `~` to negate (e.g. `~canceled`)."},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"Concentration table","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"pareto":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"number"},"id":{"type":"string","description":"Customer external ID."},"name":{"type":"string","nullable":true},"mrr":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"cumulative_mrr":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"cumulative_pct":{"type":"number","description":"Cumulative share of total MRR captured up to and including this customer (0–100)."}}},"description":"Customers ranked by MRR descending, with cumulative share. Used to render the Pareto curve."},"concentration":{"type":"object","properties":{},"description":"Concentration KPIs (top-1, top-5, top-10, top-20 share)."},"list":{"type":"array","items":{"type":"object","properties":{}},"description":"Full customer rows used by the table view."},"count":{"type":"number"},"summary":{"type":"object","properties":{}}},"required":["pareto","concentration","list","count"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/reports/custom-variables":{"get":{"summary":"Distinct values for a custom variable","description":"Returns the distinct values seen for a single custom variable across all customers, with the count of customers per value. Used to populate filter dropdowns and the segment builder.","tags":["Reports — Customers & Activity"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.reports.getCustomVariables({\n    query: { key: \"industry\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.reports.get_custom_variables(\n    key=\"industry\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Reports.GetCustomVariables(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Custom variable key (e.g. `industry`, `team_size`). Required."},"required":true,"name":"key","in":"query"},{"schema":{"type":"string","description":"Substring filter on values."},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"Maximum values to return (default 20).","example":"20"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Distinct values + counts","content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]}}},"required":["values"]}}}},"400":{"description":"Missing `key` parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/customers":{"get":{"summary":"List customers","description":"Returns customers matching the supplied filters with their current MRR and totals. Supports all the same filter parameters as the report endpoints. Also accepts `custom_<key>` params for any account-defined custom variable; values are `~~`-separated for OR, prefix `~` to negate.","tags":["Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.customers.list({\n    query: { limit: \"50\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.customers.list(\n    limit=\"50\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Customers.List(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Page size (default 50, max 500).","example":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination offset.","example":"0"},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","description":"Free-text search across name, email, domain."},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"},{"schema":{"type":"string","description":"Currency filter. Space-separated for OR semantics. Example: `usd eur`.","example":"usd eur"},"required":false,"name":"currency","in":"query"},{"schema":{"type":"string","description":"Payment method filter (e.g. `visa`, `mastercard`, `ach`, `sepa`, `paypal`, `manual`). Space-separated."},"required":false,"name":"payment_method","in":"query"},{"schema":{"type":"string","description":"Pricing model: `licensed` or `metered`. Space-separated."},"required":false,"name":"pricing_model","in":"query"},{"schema":{"type":"string","description":"Single customer ID to filter by."},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","description":"Plan group ID. Use `GET /plans` to enumerate. Space-separated."},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","description":"Customer-age bucket in months, `M-N` or `M-`. Space-separated. Example: `0-6 6-12`.","example":"0-6 6-12"},"required":false,"name":"age","in":"query"},{"schema":{"type":"string","description":"Customer's current MRR, in whole units (dollars, euros, yen — not cents) of the account's default currency, converted at the latest exchange rates. `1000` = is 1000 (rounded to whole units), `1000..` = above 1000, `..500` = below 500, `500..1000` = between, inclusive.","example":"1000.."},"required":false,"name":"mrr","in":"query"},{"schema":{"type":"string","description":"Customer's MRR the last time it was above zero: current MRR for paying customers, MRR just before churn for churned ones. Same format and currency rules as `mrr`. Example: `1000..` finds customers (active or churned) who were paying more than 1000.","example":"1000.."},"required":false,"name":"last_active_mrr","in":"query"},{"schema":{"type":"string","description":"Everything the customer has paid so far: successful payments, one-time ones included, after discounts, refunds not subtracted. Same format and currency rules as `mrr`. Example: `..200` finds customers who paid less than 200 in total.","example":"..200"},"required":false,"name":"total_paid","in":"query"},{"schema":{"type":"string","description":"Number of successful payments the customer has made, one-time ones included. `3` = exactly 3, `3..` = more than 3, `..3` = fewer than 3, `2..5` = between, inclusive.","example":"..2"},"required":false,"name":"payments","in":"query"},{"schema":{"type":"string","description":"Filter by when the lead was created, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"created_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the customer started paying, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101.."},"required":false,"name":"paid_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription was cancelled, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"..20260630"},"required":false,"name":"cancel_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the subscription next renews (next billing date), as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260101..20260630"},"required":false,"name":"renewal_date","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial started, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored.","example":"20260601..20260630"},"required":false,"name":"trial_started","in":"query"},{"schema":{"type":"string","description":"Filter by when the trial ends, as an inclusive date range: `from..to`, `from..` (on or after), `..to` (on or before), or a single date for that exact day. Accepts `yyyy-MM-dd` or `yyyyMMdd`. Use `*` for \"has any value\" and `~` for \"has no value\". Unparseable values return 400 rather than being ignored."},"required":false,"name":"trial_end_date","in":"query"},{"schema":{"type":"string","description":"Billing frequency: `day`, `week`, `month`, `quarter`, `half_year`, `year`. Space-separated."},"required":false,"name":"billing_freq","in":"query"},{"schema":{"type":"string","description":"Map geography. `countries` (default) or `states` to break the US down by state. With `states` the response is keyed by lowercase state code and limited to US customers; those without a state on record are keyed by an empty string.","example":"states"},"required":false,"name":"geo","in":"query"},{"schema":{"type":"string","description":"Country/region filter. ISO 3166 alpha-2 codes (`us de fr`) or named regions (`eu`, `apac`, `latam`, `north_america`, `nordics`, ...). Use `*` for \"any value\", `~` for \"not set\", prefix any value with `~` to negate.","example":"us eu"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","description":"US/CA state code (lowercase). Same special tokens as `region`."},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Data source: `stripe`, `chargebee`, `recurly`, `google_sheets`. Space-separated. Prefix with `~` to exclude."},"required":false,"name":"data_source","in":"query"},{"schema":{"type":"string","description":"Customer status: `active` (the default: every subscriber, including those with an unpaid invoice, `past_due`, as in the MRR and subscriber reports), `past_due` (only the unpaid ones), `paused`, `trialing`, `trial_ended`, `lead`, `canceled`, or `all`.","example":"active"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"`true` (has any discount) or `false` (none)."},"required":false,"name":"has_discount","in":"query"},{"schema":{"type":"string","description":"Cancellation reason filter (`too_expensive`, `payment_failed`, `unused`, ...). Space-separated."},"required":false,"name":"cancel_reason","in":"query"},{"schema":{"type":"string","description":"Saved segment ID (filter combination defined in the app). Expanded server-side."},"required":false,"name":"segment","in":"query"},{"schema":{"type":"string","description":"Set `true` to use a fixed FX snapshot at period end instead of per-row historical rates.","example":"true"},"required":false,"name":"fix_fx","in":"query"},{"schema":{"type":"string","description":"Only return these fields of each record (period rows, list items, breakdown buckets), space- or comma-separated. Fields that identify a record (date, label, customer id and name) are always included. Example: `new total_mrr`.","example":"new total_mrr"},"required":false,"name":"fields","in":"query"},{"schema":{"type":"string","description":"Extra fields, comma-separated. `payment_method`: each customer's most recent payment method (`visa`, `mastercard`, `amex`, `sepa`, `paypal`, ...). `scheduled_mrr`: the next scheduled MRR change (a discount ending, a plan, price or seat change booked for later) as `{ date, mrr, change, type, subtype }`; scheduled cancellations are left out (see `cancel_date`). `recent_mrr`: upgrades and downgrades in the last 30 days, as `{ date, from, change, subtype, changes }`: the latest change (its date, the MRR before it, the change, its kind) and `changes`, every change in the window oldest first as `{ date, change, subtype }` (new customers and reactivations left out). Not available for pages of more than 2,000 customers.","example":"scheduled_mrr"},"required":false,"name":"include","in":"query"}],"responses":{"200":{"description":"Customer list","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"External customer ID from the billing source (e.g. Stripe `cus_*`). The controller maps the source's external_id to this `id` field."},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string","description":"Customer status. One of `lead`, `trialing`, `active`, `past_due`, `paused`, `canceled`, `trial_ended`. `paused` = every MRR-bearing subscription is paused."},"country":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"created_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"trial_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"trial_end_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"paid_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"cancel_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"renewal_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"overdue_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"currency":{"type":"string","nullable":true,"description":"ISO 4217 currency code, lowercase.","example":"usd"},"custom_variables":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Account-defined key/value pairs synced from the billing source's metadata."},"mrr":{"type":"number","description":"Current MRR in account base currency (cents)."},"payments":{"type":"number","description":"Number of successful payments to date."},"total_paid_customer_currency":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"total_paid_base_currency":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."}}}}},"required":["count","list"]},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"}},"required":["result","currency"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/customers/{id}":{"get":{"summary":"Get customer detail","description":"Full record for a single customer: current subscriptions, MRR in both customer and base currency, lifetime paid totals, and custom variables.","tags":["Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.customers.detail({\n    path: { id: \"cus_TBHb6emItPnJxn\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.customers.detail(\n    id=\"cus_TBHb6emItPnJxn\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Customers.Detail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"External customer ID from the billing source (e.g. Stripe `cus_*`).","example":"cus_TBHb6emItPnJxn"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Convert all amounts to this currency (ISO 4217, lowercase). Defaults to the account's base currency.","example":"usd"},"required":false,"name":"baseCurrency","in":"query"}],"responses":{"200":{"description":"Customer detail","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"status":{"type":"string","description":"Customer status. One of `lead`, `trialing`, `active`, `past_due`, `paused`, `canceled`, `trial_ended`. `paused` = every MRR-bearing subscription is paused."},"country":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"created_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"trial_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"trial_end_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"paid_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"cancel_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"renewal_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"overdue_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"custom_variables":{"type":"object","additionalProperties":{"type":"string"}},"current_subscriptions":{"type":"array","items":{"type":"object","properties":{"subscription_id":{"type":"string"},"plan_id":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"status":{"type":"string"},"start_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"current_period_end":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"next_billing_date":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}}}},"current_mrr_base_currency":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"current_mrr_customer_currency":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"total_paid_base_currency":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"total_paid_customer_currency":{"type":"number","description":"Monetary amount, minor units (cents) of the base currency. May be negative for credits, refunds, contractions."},"churn_risk_score":{"type":"number","nullable":true,"description":"0–100, higher = more at risk. Null when not enough history."}},"required":["id","name","email","currency","status","country","state","created_date","trial_started","trial_end_date","paid_started","cancel_date","renewal_date","overdue_date","custom_variables","current_subscriptions","current_mrr_base_currency","current_mrr_customer_currency","total_paid_base_currency","total_paid_customer_currency","churn_risk_score"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/plans":{"get":{"summary":"List plans","description":"All subscription plans defined for the account, with their pricing properties and any plan groups they belong to.","tags":["Plans"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.plans.list();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.plans.list()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Plans.List(context.Background(), nil)"}],"responses":{"200":{"description":"Plan list","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Plan ID in the billing source (e.g. Stripe `price_*`)."},"name":{"type":"string"},"product_name":{"type":"string","nullable":true},"billing_freq":{"type":"string","description":"`day`, `week`, `month`, `quarter`, `half_year`, `year`."},"currency":{"type":"string","description":"ISO 4217 currency code, lowercase.","example":"usd"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Plan groups this plan belongs to (many-to-many)."}},"required":["id","name","product_name","billing_freq","currency","groups"]}}},"required":["count","list"]}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/plan-groups":{"get":{"summary":"List plan groups","description":"Plan groups bundle several plans together so reports treat them as one. Used to roll up tiered/regional/quarterly price variants of the same product.","tags":["Data — Plan Groups"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.planGroups.list();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plan_groups.list()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.PlanGroups.List(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Maximum rows. Default: all."},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Plan groups","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plans":{"type":"array","items":{"type":"string"},"description":"Plan IDs (external_id) belonging to this group."}},"required":["id","name"]}}},"required":["count","list"]}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create plan group","tags":["Data — Plan Groups"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.planGroups.create({\n    body: {\n        \"name\": \"Pro tier\",\n        \"plans\": [\n            \"price_xxx\"\n        ]\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plan_groups.create(\n    body={\n        \"name\": \"Pro tier\",\n        \"plans\": [\n            \"price_xxx\"\n        ]\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.PlanGroups.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name for the group."},"plans":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}]},"description":"Plan external_ids to include. Required for manual groups; omit (or pass empty) for auto-selector groups. Items may be strings or `{ id: \"...\" }` objects."},"type":{"type":"string","enum":["manual","auto"]},"selector_type":{"type":"string","nullable":true,"description":"For auto groups: how the selector pattern matches (e.g. \"contains\", \"startswith\", \"endswith\", \"regex\")."},"selector":{"type":"string","nullable":true,"description":"For auto groups: the selector pattern itself."}},"required":["name"]}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"400":{"description":"Missing required fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/plan-groups/{id}":{"get":{"summary":"Get plan group","tags":["Data — Plan Groups"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.planGroups.detail({\n    path: { id: \"pg_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plan_groups.detail(\n    id=\"pg_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.PlanGroups.Detail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Plan group ID."},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Plan group","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plans":{"type":"array","items":{"type":"string"},"description":"Plan IDs (external_id) belonging to this group."}},"required":["id","name"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Plan group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"put":{"summary":"Update plan group","tags":["Data — Plan Groups"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.planGroups.update({\n    path: { id: \"pg_xxx\" },\n    body: {\n        \"name\": \"Renamed\",\n        \"plans\": [\n            \"price_xxx\"\n        ]\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plan_groups.update(\n    id=\"pg_xxx\",\n    body={\n        \"name\": \"Renamed\",\n        \"plans\": [\n            \"price_xxx\"\n        ]\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.PlanGroups.Update(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"plans":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}]},"description":"Plan external_ids in the group. Required for manual groups; omit for auto-selector groups. Items may be strings or `{ id: \"...\" }` objects."},"type":{"type":"string","enum":["manual","auto"]},"selector_type":{"type":"string","nullable":true,"description":"For auto groups: how the selector pattern matches."},"selector":{"type":"string","nullable":true,"description":"For auto groups: the selector pattern."}},"required":["name"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"400":{"description":"Missing required fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Plan group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"delete":{"summary":"Delete plan group","tags":["Data — Plan Groups"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.planGroups.delete({\n    path: { id: \"pg_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plan_groups.delete(\n    id=\"pg_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.PlanGroups.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/segments":{"get":{"summary":"List segments","description":"Segments are saved filter combinations. Pass `segment=<id>` to any report endpoint to apply the segment's filters server-side.","tags":["Data — Segments"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.segments.list();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.segments.list()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Segments.List(context.Background(), nil)"}],"responses":{"200":{"description":"Segments","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"filters":{"type":"string","description":"Querystring-encoded filters (e.g. `region=eu&plan=enterprise`). Parsed server-side with URLSearchParams."},"mode":{"type":"string","description":"`filter` (default — AND across keys) or `breakdown` (split-on-key mode)."}},"required":["id","name","filters"]}}},"required":["count","list"]}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create segment","tags":["Data — Segments"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.segments.create({\n    body: {\n        \"name\": \"EU Enterprise\",\n        \"filters\": {\n            \"region\": \"eu\",\n            \"plan\": \"enterprise\"\n        }\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.segments.create(\n    body={\n        \"name\": \"EU Enterprise\",\n        \"filters\": {\n            \"region\": \"eu\",\n            \"plan\": \"enterprise\"\n        }\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Segments.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"filters":{"type":"string","description":"Querystring-encoded filters (e.g. `region=eu&plan=enterprise`). See report endpoints for valid filter keys."},"mode":{"type":"string","enum":["filter","breakdown"]}},"required":["name","filters"]}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"400":{"description":"Missing required fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/segments/{id}":{"get":{"summary":"Get segment","tags":["Data — Segments"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.segments.detail({\n    path: { id: \"seg_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.segments.detail(\n    id=\"seg_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Segments.Detail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Segment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"filters":{"type":"string","description":"Querystring-encoded filters (e.g. `region=eu&plan=enterprise`). Parsed server-side with URLSearchParams."},"mode":{"type":"string","description":"`filter` (default — AND across keys) or `breakdown` (split-on-key mode)."}},"required":["id","name","filters"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Segment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"put":{"summary":"Update segment","tags":["Data — Segments"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.segments.update({\n    path: { id: \"seg_xxx\" },\n    body: { name: \"EU Enterprise (updated)\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.segments.update(\n    id=\"seg_xxx\",\n    body={\n        \"name\": \"EU Enterprise (updated)\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Segments.Update(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"filters":{"type":"string"},"mode":{"type":"string","enum":["filter","breakdown"]}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Segment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"delete":{"summary":"Delete segment","tags":["Data — Segments"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.segments.delete({\n    path: { id: \"seg_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.segments.delete(\n    id=\"seg_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Segments.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/data-sources":{"get":{"summary":"List connected data sources","description":"Each connected billing system (Stripe / Chargebee / Recurly / Google Sheets / Alunta) is one data source.","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.list();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.list()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.List(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Filter by source type (`stripe`, `chargebee`, ...)."},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Data sources","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","description":"`stripe`, `chargebee`, `recurly`, `google_sheets`, ..."},"status":{"type":"string","description":"`connected`, `disconnected`, `importing`, ..."},"created_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"updated_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"import_status":{"type":"string","nullable":true},"import_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}}}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create data source","description":"Registers a new billing system connection. `api` and `google-sheets` types also auto-create an API key returned in the `access_token` field — show it to the user once; it's the only chance to retrieve the full key.","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.create({\n    body: {\n        \"name\": \"My Stripe\",\n        \"type\": \"stripe\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.create(\n    body={\n        \"name\": \"My Stripe\",\n        \"type\": \"stripe\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["stripe","api","google-sheets","recurly","chargebee","alunta","manual"]}},"required":["name","type"]}}}},"responses":{"201":{"description":"Created (with `access_token` for `api`/`google-sheets`)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","description":"`stripe`, `chargebee`, `recurly`, `google_sheets`, ..."},"status":{"type":"string","description":"`connected`, `disconnected`, `importing`, ..."},"created_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"updated_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"import_status":{"type":"string","nullable":true},"import_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"access_token":{"type":"string","description":"Full API key — returned ONCE on creation for `api`/`google-sheets` types."}}}}}},"400":{"description":"Missing name or invalid type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/data-sources/{id}":{"put":{"summary":"Update data source","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.update({\n    path: { id: \"ds_xxx\" },\n    body: { name: \"Renamed\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.update(\n    id=\"ds_xxx\",\n    body={\n        \"name\": \"Renamed\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.Update(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","description":"`stripe`, `chargebee`, `recurly`, `google_sheets`, ..."},"status":{"type":"string","description":"`connected`, `disconnected`, `importing`, ..."},"created_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"updated_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"import_status":{"type":"string","nullable":true},"import_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","description":"`stripe`, `chargebee`, `recurly`, `google_sheets`, ..."},"status":{"type":"string","description":"`connected`, `disconnected`, `importing`, ..."},"created_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"updated_at":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"import_status":{"type":"string","nullable":true},"import_started":{"type":"string","nullable":true,"description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Data source not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"delete":{"summary":"Delete data source","description":"Removes the connection and stops all future imports. Note: historical data already in ClickHouse is not deleted by this call.","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.delete({\n    path: { id: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.delete(\n    id=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/data-sources/{id}/progress":{"get":{"summary":"Get import progress for a data source","description":"Returns the live state of any in-flight bulk import (enqueued / processed / errors / phase). Polled by the dashboard while imports run.","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.getProgress({\n    path: { id: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.get_progress(\n    id=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.GetProgress(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Data source ID."},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Import progress state","content":{"application/json":{"schema":{"type":"object","properties":{"phase":{"type":"string","description":"`idle`, `enqueueing`, `processing`, `done`, `stuck`, `aborted`."},"enqueuedCount":{"type":"number"},"processedCount":{"type":"number"},"failedCount":{"type":"number"},"startedAt":{"type":"string","description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"},"lastActivityAt":{"type":"string","description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/data-sources/{id}/reset":{"post":{"summary":"Reset a data source","description":"Clears the data source's imported data and resets sync state without removing the connection.","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.reset({\n    path: { id: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.reset(\n    id=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.Reset(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Reset","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/data-sources/{id}/full-import":{"post":{"summary":"Trigger a full import","description":"Enqueues a full re-import for the data source. Poll `GET /data/data-sources/{id}/progress` to monitor.","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.fullImport({\n    path: { id: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.full_import(\n    id=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.FullImport(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Import started","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/data-sources/{id}/abort":{"post":{"summary":"Abort an in-flight import","tags":["Data — Data Sources"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.sources.abortImport({\n    path: { id: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.sources.abort_import(\n    id=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Sources.AbortImport(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Aborted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/customers":{"get":{"summary":"List raw customers for a data source","description":"Returns the customer rows imported from a specific data source — the underlying ingestion data, before the analytics layer normalises it. Different from `GET /customers`, which returns the analytics view.","tags":["Data — Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.customers.list({\n    query: { source: \"ds_xxx\", limit: \"50\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.customers.list(\n    source=\"ds_xxx\",\n    limit=\"50\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Customers.List(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Data source ID to read from. Required."},"required":true,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Raw customer rows","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{}}}},"required":["count","list"]}},"required":["result"]}}}},"400":{"description":"Missing source parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create or update customers (bulk-friendly)","description":"Upserts one or more customers by `id` (external ID). Body accepts a single customer object OR an array — the response is always an array of per-row results.","tags":["Data — Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.customers.create({\n    body: {\n        \"id\": \"cus_xxx\",\n        \"name\": \"Acme Inc\",\n        \"email\": \"billing@acme.com\",\n        \"created_date\": \"2025-01-15\",\n        \"country\": \"us\",\n        \"data_source\": \"ds_xxx\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.customers.create(\n    body={\n        \"id\": \"cus_xxx\",\n        \"name\": \"Acme Inc\",\n        \"email\": \"billing@acme.com\",\n        \"created_date\": \"2025-01-15\",\n        \"country\": \"us\",\n        \"data_source\": \"ds_xxx\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Customers.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"External customer ID — the ID in your billing source."},"name":{"type":"string"},"email":{"type":"string","description":"Email or name is required."},"created_date":{"type":"string","description":"ISO 8601 date when the customer was created."},"trial_started":{"type":"string","description":"ISO 8601 date when their trial began."},"country":{"type":"string","description":"ISO 3166 alpha-2 country code."},"state":{"type":"string","description":"US/CA state code (lowercase)."},"custom_variables":{"type":"object","additionalProperties":{"type":"string"}},"data_source":{"type":"string","description":"Data source ID this customer belongs to."}},"required":["id","created_date","country","data_source"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"External customer ID — the ID in your billing source."},"name":{"type":"string"},"email":{"type":"string","description":"Email or name is required."},"created_date":{"type":"string","description":"ISO 8601 date when the customer was created."},"trial_started":{"type":"string","description":"ISO 8601 date when their trial began."},"country":{"type":"string","description":"ISO 3166 alpha-2 country code."},"state":{"type":"string","description":"US/CA state code (lowercase)."},"custom_variables":{"type":"object","additionalProperties":{"type":"string"}},"data_source":{"type":"string","description":"Data source ID this customer belongs to."}},"required":["id","created_date","country","data_source"]}}]}}}},"responses":{"200":{"description":"Per-row import result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{},"description":"Echoed input row with `export_status` (`success` | `error`) and `export_error` set when validation failed."}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/customers/{id}":{"get":{"summary":"Get raw customer record","tags":["Data — Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.customers.detail({\n    path: { id: \"cus_xxx\" },\n    query: { source: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.customers.detail(\n    id=\"cus_xxx\",\n    source=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Customers.Detail(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Data source ID."},"required":true,"name":"source","in":"query"}],"responses":{"200":{"description":"Raw customer","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"put":{"summary":"Update customer metadata","description":"Patch a customer's display name, email, or custom variables. Does not change subscription data or MRR.","tags":["Data — Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.customers.update({\n    path: { id: \"cus_xxx\" },\n    body: { name: \"Acme Corporation\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.customers.update(\n    id=\"cus_xxx\",\n    body={\n        \"name\": \"Acme Corporation\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Customers.Update(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"custom_variables":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"delete":{"summary":"Delete customer","description":"Removes the customer record. **Caveat:** related MRR movements stay in the analytics layer until the next full resync of the data source.","tags":["Data — Customers"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.customers.delete({\n    path: { id: \"cus_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.customers.delete(\n    id=\"cus_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Customers.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/invoices":{"get":{"summary":"List raw invoices for a data source","description":"Imported invoice rows for the requested data source. Used by integrations that need access to the raw billing-source data.","tags":["Data — Invoices"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.invoices.list({\n    query: { source: \"ds_xxx\", limit: \"50\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.invoices.list(\n    source=\"ds_xxx\",\n    limit=\"50\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Invoices.List(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Data source ID. Required."},"required":true,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Raw invoices","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{}}}},"required":["count","list"]}},"required":["result"]}}}},"400":{"description":"Missing source parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create or update invoices (bulk-friendly)","description":"Upserts one or more invoices. Body accepts a single object OR an array.","tags":["Data — Invoices"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.invoices.create({\n    body: {\n        \"id\": \"in_xxx\",\n        \"customer_id\": \"cus_xxx\",\n        \"date\": \"2025-01-15\",\n        \"amount\": 9900,\n        \"currency\": \"usd\",\n        \"data_source\": \"ds_xxx\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.invoices.create(\n    body={\n        \"id\": \"in_xxx\",\n        \"customer_id\": \"cus_xxx\",\n        \"date\": \"2025-01-15\",\n        \"amount\": 9900,\n        \"currency\": \"usd\",\n        \"data_source\": \"ds_xxx\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Invoices.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"External invoice ID."},"customer_id":{"type":"string"},"date":{"type":"string","description":"Invoice date (ISO 8601)."},"amount":{"type":"number","description":"Total amount in customer-currency minor units (cents)."},"currency":{"type":"string"},"data_source":{"type":"string"}},"required":["id","customer_id","date","amount","currency","data_source"],"description":"Additional fields (line items, taxes, refunds) may be supplied — see /docs for the full shape."},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"External invoice ID."},"customer_id":{"type":"string"},"date":{"type":"string","description":"Invoice date (ISO 8601)."},"amount":{"type":"number","description":"Total amount in customer-currency minor units (cents)."},"currency":{"type":"string"},"data_source":{"type":"string"}},"required":["id","customer_id","date","amount","currency","data_source"],"description":"Additional fields (line items, taxes, refunds) may be supplied — see /docs for the full shape."}}]}}}},"responses":{"200":{"description":"Per-row import result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{},"description":"Echoed input row with `export_status` (`success` | `error`) and `export_error` set when validation failed."}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/invoices/{id}":{"put":{"summary":"Update invoice","tags":["Data — Invoices"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.invoices.update({\n    path: { id: \"in_xxx\" },\n    body: { amount: 10900 }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.invoices.update(\n    id=\"in_xxx\",\n    body={\n        \"amount\": 10900\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Invoices.Update(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"External invoice ID."},"customer_id":{"type":"string"},"date":{"type":"string","description":"Invoice date (ISO 8601)."},"amount":{"type":"number","description":"Total amount in customer-currency minor units (cents)."},"currency":{"type":"string"},"data_source":{"type":"string"}},"description":"Additional fields (line items, taxes, refunds) may be supplied — see /docs for the full shape."}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"delete":{"summary":"Delete invoice","tags":["Data — Invoices"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.invoices.delete({\n    path: { id: \"in_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.invoices.delete(\n    id=\"in_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Invoices.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["success"],"description":"Standard \"operation succeeded\" envelope, optionally with the affected id."}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/plans":{"get":{"summary":"List raw plans","description":"Returns plan rows as imported from the billing source. Different from `GET /plans`, which is the analytics view with plan-groups attached.","tags":["Data — Plans"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.plans.list({\n    query: { source: \"ds_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plans.list(\n    source=\"ds_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Plans.List(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string","description":"Filter by data source ID."},"required":false,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Plan list","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"count":{"type":"number"},"list":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","description":"Plan ID in your billing source."},"name":{"type":"string"},"product_name":{"type":"string","nullable":true},"billing_freq":{"type":"string","description":"`day`, `week`, `month`, `quarter`, `half_year`, `year`."},"billing_freq_count":{"type":"number","description":"Interval count (default 1 — e.g. billing_freq=`month` + count=3 = quarterly, or count=6 for half-yearly). You may also name the period directly with billing_freq=`quarter` or `half_year` and leave count at 1."},"currency":{"type":"string"},"data_source":{"type":"string"}},"required":["external_id","name","billing_freq","currency","data_source"]}}},"required":["count","list"]}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create or update plans (bulk-friendly)","description":"Upserts plans by `id` (= external_id). Body accepts a single object OR an array.","tags":["Data — Plans"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.plans.create({\n    body: {\n        \"id\": \"price_pro\",\n        \"external_id\": \"price_pro\",\n        \"name\": \"Pro\",\n        \"billing_freq\": \"month\",\n        \"currency\": \"usd\",\n        \"data_source\": \"ds_xxx\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plans.create(\n    body={\n        \"id\": \"price_pro\",\n        \"external_id\": \"price_pro\",\n        \"name\": \"Pro\",\n        \"billing_freq\": \"month\",\n        \"currency\": \"usd\",\n        \"data_source\": \"ds_xxx\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Plans.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"external_id":{"type":"string","description":"Plan ID in your billing source."},"name":{"type":"string"},"product_name":{"type":"string","nullable":true},"billing_freq":{"type":"string","description":"`day`, `week`, `month`, `quarter`, `half_year`, `year`."},"billing_freq_count":{"type":"number","description":"Interval count (default 1 — e.g. billing_freq=`month` + count=3 = quarterly, or count=6 for half-yearly). You may also name the period directly with billing_freq=`quarter` or `half_year` and leave count at 1."},"currency":{"type":"string"},"data_source":{"type":"string"},"id":{"type":"string","description":"External plan ID (this becomes external_id on the stored row)."}},"required":["external_id","name","billing_freq","currency","data_source","id"]},{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","description":"Plan ID in your billing source."},"name":{"type":"string"},"product_name":{"type":"string","nullable":true},"billing_freq":{"type":"string","description":"`day`, `week`, `month`, `quarter`, `half_year`, `year`."},"billing_freq_count":{"type":"number","description":"Interval count (default 1 — e.g. billing_freq=`month` + count=3 = quarterly, or count=6 for half-yearly). You may also name the period directly with billing_freq=`quarter` or `half_year` and leave count at 1."},"currency":{"type":"string"},"data_source":{"type":"string"},"id":{"type":"string"}},"required":["external_id","name","billing_freq","currency","data_source","id"]}}]}}}},"responses":{"200":{"description":"Per-row import result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{},"description":"Echoed input row with `export_status` (`success` | `error`) and `export_error` set when validation failed."}}},"required":["result"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/data/plans/{id}":{"put":{"summary":"Update plan","tags":["Data — Plans"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.plans.update({\n    path: { id: \"price_pro\" },\n    body: {\n        \"id\": \"price_pro\",\n        \"name\": \"Pro Plan\",\n        \"billing_freq\": \"month\",\n        \"currency\": \"usd\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plans.update(\n    id=\"price_pro\",\n    body={\n        \"id\": \"price_pro\",\n        \"name\": \"Pro Plan\",\n        \"billing_freq\": \"month\",\n        \"currency\": \"usd\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Plans.Update(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"External plan ID (must match path)."},"name":{"type":"string"},"billing_freq":{"type":"string"},"currency":{"type":"string"}},"required":["id","name","billing_freq","currency"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string"},"updated":{"type":"string"}},"required":["result","updated"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"delete":{"summary":"Delete plan","description":"Removes the plan from the data source. **Caveat:** related MRR movements stay in the analytics layer until the next full resync.","tags":["Data — Plans"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.data.plans.delete({\n    path: { id: \"price_pro\" },\n    body: {\n        \"id\": \"price_pro\",\n        \"external_id\": \"price_pro\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.data.plans.delete(\n    id=\"price_pro\",\n    body={\n        \"id\": \"price_pro\",\n        \"external_id\": \"price_pro\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Data.Plans.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string"}},"required":["id","external_id"]}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string"},"deleted":{"type":"string"}},"required":["result","deleted"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/profile":{"get":{"summary":"Get the current user's profile","description":"Returns the user record associated with the API key, plus the list of accounts they have access to.","tags":["Profile"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.profile.get();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.profile.get()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Profile.Get(context.Background(), nil)"}],"responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true,"description":"BCP-47 language tag (e.g. `en`, `da`)."},"timezone":{"type":"string","nullable":true,"description":"IANA timezone (e.g. `Europe/Copenhagen`)."},"accounts":{"type":"array","items":{"type":"object","properties":{}},"description":"Accounts the user has access to (role + account metadata per row)."}},"required":["id","email","first_name","last_name","locale","timezone"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"put":{"summary":"Update the current user's profile","tags":["Profile"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.profile.update({\n    body: {\n        \"first_name\": \"Lasse\",\n        \"timezone\": \"Europe/Copenhagen\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.profile.update(\n    body={\n        \"first_name\": \"Lasse\",\n        \"timezone\": \"Europe/Copenhagen\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Profile.Update(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"locale":{"type":"string"},"timezone":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated profile","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true,"description":"BCP-47 language tag (e.g. `en`, `da`)."},"timezone":{"type":"string","nullable":true,"description":"IANA timezone (e.g. `Europe/Copenhagen`)."},"accounts":{"type":"array","items":{"type":"object","properties":{}},"description":"Accounts the user has access to (role + account metadata per row)."}},"required":["id","email","first_name","last_name","locale","timezone"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/integrations/webhooks":{"get":{"summary":"List webhook subscriptions","description":"Webhooks let you push event notifications to any HTTPS URL — useful for Zapier / n8n / Make integrations.","tags":["Webhooks"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.webhooks.list();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.webhooks.list()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Webhooks.List(context.Background(), nil)"}],"responses":{"200":{"description":"Webhook subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","description":"HTTPS URL the webhook posts events to."},"event_type":{"type":"string","description":"Event type this webhook subscribes to."},"created_at":{"type":"string","description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}},"required":["id","url","event_type"]}}},"required":["webhooks"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"post":{"summary":"Create webhook subscription","description":"Subscribe an HTTPS URL to an event type. Returns a 409 if the (url, event_type) pair already exists.","tags":["Webhooks"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.webhooks.create({\n    body: {\n        \"url\": \"https://hooks.zapier.com/...\",\n        \"event_type\": \"movement.churn\"\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.webhooks.create(\n    body={\n        \"url\": \"https://hooks.zapier.com/...\",\n        \"event_type\": \"movement.churn\"\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Webhooks.Create(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"HTTPS URL to POST events to.","example":"https://hooks.zapier.com/..."},"event_type":{"type":"string","description":"One of: movement.new, movement.expansion, movement.contraction, movement.churn, movement.reactivation, movement.paused, movement.resumed, failed_payment, invoice.paid, customer.created, customer.updated, plan.created, data_source.import_completed."}},"required":["url","event_type"]}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","description":"HTTPS URL the webhook posts events to."},"event_type":{"type":"string","description":"Event type this webhook subscribes to."},"created_at":{"type":"string","description":"ISO 8601 datetime.","example":"2026-01-15T10:30:00Z"}},"required":["id","url","event_type"]}}}},"400":{"description":"Missing/invalid URL or event_type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"409":{"description":"A webhook with this URL + event_type already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"existing_id":{"type":"string"}},"required":["error","existing_id"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/integrations/webhooks/{id}":{"delete":{"summary":"Delete webhook subscription","tags":["Webhooks"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.webhooks.delete({\n    path: { id: \"wh_xxx\" }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.webhooks.delete(\n    id=\"wh_xxx\"\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Webhooks.Delete(context.Background(), nil)"}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"message":{"type":"string"}},"required":["success","message"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}},"/settings/notifications":{"get":{"summary":"Get notification preferences","description":"Returns the current user's notification preferences for the active account (which reports they receive, alert thresholds).","tags":["Settings"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.notifications.get();"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.notifications.get()"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Notifications.Get(context.Background(), nil)"}],"responses":{"200":{"description":"Notification preferences","content":{"application/json":{"schema":{"type":"object","properties":{"daily_report":{"type":"boolean","nullable":true},"weekly_report":{"type":"boolean","nullable":true},"monthly_report":{"type":"boolean","nullable":true},"expansion_alert_threshold":{"type":"number","nullable":true,"description":"MRR (in account base currency cents) above which an expansion triggers an alert email. `null` = no alerts."},"contraction_alert_threshold":{"type":"number","nullable":true},"notify_scheduled_churn":{"type":"boolean","nullable":true},"notify_failed_payment":{"type":"boolean","nullable":true}},"required":["daily_report","weekly_report","monthly_report","expansion_alert_threshold","contraction_alert_threshold","notify_scheduled_churn","notify_failed_payment"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}},"put":{"summary":"Update notification preferences","tags":["Settings"],"security":[{"ApiKeyAuth":[]}],"x-codeSamples":[{"lang":"JavaScript","label":"JavaScript","source":"import { GrowPanel } from '@growpanel/sdk';\n\nconst gp = new GrowPanel({ apiKey: process.env.GROWPANEL_API_KEY });\nconst result = await gp.notifications.update({\n    body: {\n        \"daily_report\": true,\n        \"notify_failed_payment\": true\n    }\n});"},{"lang":"Python","label":"Python","source":"import os\nfrom growpanel import GrowPanel\n\ngp = GrowPanel(api_key=os.environ['GROWPANEL_API_KEY'])\nresult = gp.notifications.update(\n    body={\n        \"daily_report\": true,\n        \"notify_failed_payment\": true\n    }\n)"},{"lang":"Go","label":"Go","source":"import (\n    \"context\"\n    \"os\"\n    growpanel \"github.com/growpanel/growpanel-sdk-go\"\n)\n\ngp, _ := growpanel.New(os.Getenv(\"GROWPANEL_API_KEY\"))\nresult, _ := gp.Notifications.Update(context.Background(), nil)"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"daily_report":{"type":"boolean","nullable":true},"weekly_report":{"type":"boolean","nullable":true},"monthly_report":{"type":"boolean","nullable":true},"expansion_alert_threshold":{"type":"number","nullable":true,"description":"MRR (in account base currency cents) above which an expansion triggers an alert email. `null` = no alerts."},"contraction_alert_threshold":{"type":"number","nullable":true},"notify_scheduled_churn":{"type":"boolean","nullable":true},"notify_failed_payment":{"type":"boolean","nullable":true}}}}}},"responses":{"200":{"description":"Updated preferences","content":{"application/json":{"schema":{"type":"object","properties":{"daily_report":{"type":"boolean","nullable":true},"weekly_report":{"type":"boolean","nullable":true},"monthly_report":{"type":"boolean","nullable":true},"expansion_alert_threshold":{"type":"number","nullable":true,"description":"MRR (in account base currency cents) above which an expansion triggers an alert email. `null` = no alerts."},"contraction_alert_threshold":{"type":"number","nullable":true},"notify_scheduled_churn":{"type":"boolean","nullable":true},"notify_failed_payment":{"type":"boolean","nullable":true}},"required":["daily_report","weekly_report","monthly_report","expansion_alert_threshold","contraction_alert_threshold","notify_scheduled_churn","notify_failed_payment"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"403":{"description":"Account is blocked or trial expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}},"required":["error"]}}}}}}}}}