p202 ltv customers

List customers with LTV rollups, or show one customer in full (CRM, aliases, custom fields, recent revenue)

All commands

01Run it

Straight from the command's own help.

p202 ltv customers --search acme --segment repeat
p202 ltv customers --cf plan=pro --cf score.min=50 --all
p202 ltv customers 42

02What you get

Captured from the real binary, run against a demo store with 30 days of traffic. Switch tabs to see the same run as JSON, the shape scripts and agents parse.

p202 ltv customers
$ p202 ltv customers
status  active_subscription_count  city  company  country  customer_id  email                          first_click_id  first_name  first_seen_time  last_activity_time  last_name  mrr       order_count  primary_ref  refunded_amount  region  total_revenue
------  -------------------------  ----  -------  -------  -----------  -----------------------------  --------------  ----------  ---------------  ------------------  ---------  --------  -----------  -----------  ---------------  ------  -------------
active  0                                                  111          diego.vance111@example.com     2800            Diego       1789733060       1789733060          Vance      0         1            cust-1111    0                        636
active  0                                                  18           lena.grant18@example.com       548             Lena        1791356492       1791356492          Grant      0         1            cust-1018    0                        607
active  1                                                  115          mason.morgan115@example.com    2871            Mason       1791243739       1791243739          Morgan     49        1            cust-1115    0                        588
active  1                                                  83           mateo.morgan83@example.com     1996            Mateo       1790547397       1790547397          Morgan     49        1            cust-1083    0                        588
active  1                                                  67           zoe.okafor67@example.com       1597            Zoe         1790184516       1790184516          Okafor     49        1            cust-1067    0                        588
active  1                                                  10           felix.jensen10@example.com     295             Felix       1790777698       1790777698          Jensen     49        1            cust-1010    0                        588
active  0                                                  78           lena.quinn78@example.com       1869            Lena        1790480065       1790480065          Quinn      0         1            cust-1078    0                        577
active  0                                                  20           grace.foster20@example.com     600             Grace       1789064541       1789064541          Foster     0         1            cust-1020    0                        548
active  0                                                  68           lena.bennett68@example.com     1611            Lena        1790276733       1790276733          Bennett    0         1            cust-1068    0                        518
active  0                                                  1            kenji.vance1@example.com       3               Kenji       1790595724       1790854924          Vance      0         1            cust-1001    59                       518
active  1                                                  89           rhys.carter89@example.com      2149            Rhys        1789500439       1789500439          Carter     29        1            cust-1089    0                        348
active  1                                                  55           zoe.patel55@example.com        1294            Zoe         1790423437       1790423437          Patel      29        1            cust-1055    0                        348
active  1                                                  46           grace.foster46@example.com     1101            Grace       1791539206       1791539206          Foster     29        1            cust-1046    0                        348
active  1                                                  22           elias.lindqvist22@example.com  677             Elias       1789416983       1789416983          Lindqvist  29        1            cust-1022    0                        348
active  1                                                  11           lena.reyes11@example.com       364             Lena        1790768967       1790768967          Reyes      29        1            cust-1011    0                        348
active  1                                                  4            elias.diaz4@example.com        85              Elias       1791303994       1791303994          Diaz       29        1            cust-1004    0                        348
active  0                                                  31           clara.foster31@example.com     801             Clara       1790089761       1790841089          Foster     0         2            cust-1031    0                        286
active  0                                                  21           ivy.hayes21@example.com        627             Ivy         1789902011       1790100430          Hayes      0         2            cust-1021    0                        276
active  0                                                  2            grace.quinn2@example.com       15              Grace       1790626426       1790921878          Quinn      0         2            cust-1002    0                        252
active  0                                                  79           kenji.bennett79@example.com    1887            Kenji       1791065921       1791065921          Bennett    0         1            cust-1079    0                        242
active  0                                                  13           ethan.grant13@example.com      421             Ethan       1789767743       1790353372          Grant      0         2            cust-1013    0                        242
active  0                                                  44           isla.quinn44@example.com       1042            Isla        1790174263       1790174263          Quinn      0         1            cust-1044    0                        232
active  0                                                  7            silas.walsh7@example.com       176             Silas       1790715099       1790715099          Walsh      0         1            cust-1007    0                        225
active  0                                                  19           nora.walsh19@example.com       569             Nora        1791231148       1791231148          Walsh      0         1            cust-1019    0                        214
active  0                                                  66           mateo.jensen66@example.com     1544            Mateo       1790674883       1790674883          Jensen     0         1            cust-1066    0                        198
active  0                                                  72           grace.moreau72@example.com     1673            Grace       1791357768       1791539176          Moreau     0         2            cust-1072    0                        180
active  0                                                  65           arlo.moreau65@example.com      1470            Arlo        1789770031       1789770031          Moreau     0         1            cust-1065    0                        175
active  0                                                  49           mateo.tanaka49@example.com     1145            Mateo       1790432452       1790432452          Tanaka     0         1            cust-1049    0                        175
active  0                                                  24           hugo.kowalski24@example.com    705             Hugo        1791296228       1791539176          Kowalski   0         2            cust-1024    0                        175
active  0                                                  36           diego.quinn36@example.com      895             Diego       1789159933       1789159933          Quinn      0         1            cust-1036    0                        174
active  0                                                  98           rhys.zhang98@example.com       2522            Rhys        1789044827       1789268422          Zhang      0         2            cust-1098    0                        171
active  0                                                  86           miles.jensen86@example.com     2107            Miles       1789575919       1789575919          Jensen     0         1            cust-1086    0                        164
active  0                                                  35           diego.underwood35@example.com  862             Diego       1791377586       1791539176          Underwood  0         2            cust-1035    0                        164
active  0                                                  96           omar.morgan96@example.com      2336            Omar        1791219616       1791219616          Morgan     0         1            cust-1096    0                        156
active  0                                                  110          arlo.reyes110@example.com      2756            Arlo        1790097838       1790776628          Reyes      0         2            cust-1110    0                        150
active  0                                                  82           lucas.grant82@example.com      1951            Lucas       1791149199       1791539176          Grant      0         2            cust-1082    0                        150
active  0                                                  76           hazel.bennett76@example.com    1782            Hazel       1789130506       1789130506          Bennett    0         1            cust-1076    0                        150
active  0                                                  43           hazel.morgan43@example.com     1041            Hazel       1791022077       1791022077          Morgan     0         1            cust-1043    0                        150
active  0                                                  39           lena.moreau39@example.com      962             Lena        1788952578       1789644838          Moreau     0         2            cust-1039    0                        150
active  0                                                  73           june.hayes73@example.com       1726            June        1789051454       1789051454          Hayes      0         1            cust-1073    0                        146
active  0                                                  61           hazel.vance61@example.com      1397            Hazel       1789330864       1789330864          Vance      0         1            cust-1061    0                        146
active  0                                                  109          june.reyes109@example.com      2711            June        1789215886       1789215886          Reyes      0         1            cust-1109    0                        141
active  0                                                  74           chloe.haddad74@example.com     1748            Chloe       1790639259       1790639259          Haddad     0         1            cust-1074    0                        130
active  0                                                  62           ruby.vance62@example.com       1446            Ruby        1789466643       1789466643          Vance      0         1            cust-1062    0                        130
active  0                                                  29           felix.diaz29@example.com       747             Felix       1790726688       1791539176          Diaz       0         2            cust-1029    0                        126
active  0                                                  99           leo.haddad99@example.com       2528            Leo         1790716612       1790716612          Haddad     0         1            cust-1099    0                        125
active  0                                                  52           arlo.grant52@example.com       1187            Arlo        1790809126       1790809126          Grant      0         1            cust-1052    0                        125
active  0                                                  51           isla.foster51@example.com      1182            Isla        1789418375       1789418375          Foster     0         1            cust-1051    0                        125
active  0                                                  71           ava.morgan71@example.com       1651            Ava         1790817267       1791314745          Morgan     0         2            cust-1071    0                        120
active  0                                                  92           elias.keller92@example.com     2169            Elias       1791143047       1791539176          Keller     0         2            cust-1092    0                        102
Total: 115 | Limit: 50 | Offset: 0
Warning: Showing 50 of 115 results. Use --all to fetch all.
Real output · p202 1.9.77 · demo dataexit 0

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 ltv customers

Set flags below; the command updates as you type.

04Flags

11 flags, plus the global flags every command takes.

FlagWhat it does
--allboolFetch every page (500 rows a request)
--cfstringArrayOnly customers whose custom field matches: key=value, or key.min=value / key.max=value for a number or date field (repeatable, at most 3; p202 ltv fields list shows the keys)
--dirstringSort direction: ASC, DESC
ASCDESC
--limit, -lstringRows per page (max 500)
--offset, -ostringPagination offset
--period, -pstringPeriod: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltime
todayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime
--segmentstringOnly this segment (repeat: 2+ orders; subscribers: an active subscription; at_risk: a past_due subscription): repeat, subscribers, at_risk
repeatsubscribersat_risk
--sort, -sstringSort: total_revenue, order_count, last_activity_time, first_seen_time, mrr
total_revenueorder_countlast_activity_timefirst_seen_timemrr
--time-fromstringAcquisition window start: unix seconds, a date (2026-10-01, from its first second in the account's timezone) or a time with its offset (2026-10-01T09:30:00Z)
--time-tostringAcquisition window end, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset

05How it works

List customers with their LTV rollups, newest-valued first, or show one in full.

p202 ltv customers --search acme --segment repeat
p202 ltv customers --cf plan=pro --cf score.min=50 --all
p202 ltv customers 42

--search matches the customer reference, email, company or name. --cf filters by custom field: key=value, or key.min/key.max for number and date fields (at most 3). Writes are p202 ltv customer (upsert, update, merge, erase, alias).

06For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands ltv customers --json.
  • With AI_AGENT, CLAUDECODE or another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with a hint.
  • Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
p202 commands ltv customers --json
{
  "path": "p202 ltv customers",
  "use": "customers [id]",
  "short": "List customers with LTV rollups, or show one customer in full (CRM, aliases, custom fields, recent revenue)",
  "long": "List customers with their LTV rollups, newest-valued first, or show one in full.\n\n  p202 ltv customers --search acme --segment repeat\n  p202 ltv customers --cf plan=pro --cf score.min=50 --all\n  p202 ltv customers 42\n\n--search matches the customer reference, email, company or name. --cf filters by custom\nfield: key=value, or key.min/key.max for number and date fields (at most 3). Writes are\n`p202 ltv customer` (upsert, update, merge, erase, alias).",
  "runnable": true,
  "flags": [
    {
      "name": "all",
      "type": "bool",
      "default": "false",
      "usage": "Fetch every page (500 rows a request)",
      "required": false
    },
    {
      "name": "cf",
      "type": "stringArray",
      "default": "[]",
      "usage": "Only customers whose custom field matches: key=value, or key.min=value / key.max=value for a number or date field (repeatable, at most 3; `p202 ltv fields list` shows the keys)",
      "required": false
    },
    {
      "name": "dir",
      "type": "string",
      "default": "",
      "usage": "Sort direction: ASC, DESC",
      "allowed_values": [
        "ASC",
        "DESC"
      ],
      "required": false
    },
    {
      "name": "limit",
      "shorthand": "l",
      "type": "string",
      "default": "",
      "usage": "Rows per page (max 500)",
      "required": false
    },
    {
      "name": "offset",
      "shorthand": "o",
      "type": "string",
      "default": "",
      "usage": "Pagination offset",
      "required": false
    },
    {
      "name": "period",
      "shorthand": "p",
      "type": "string",
      "default": "",
      "usage": "Period: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltime",
      "allowed_values": [
        "today",
        "yesterday",
        "last7",
        "last14",
        "last30",
        "last90",
        "thismonth",
        "lastmonth",
        "thisyear",
        "lastyear",
        "alltime"
      ],
      "required": false
    },
    {
      "name": "search",
      "type": "string",
      "default": "",
      "usage": "Only customers whose reference, email, company or name contains this text (the API's q)",
      "required": false
    },
    {
      "name": "segment",
      "type": "string",
      "default": "",
      "usage": "Only this segment (repeat: 2+ orders; subscribers: an active subscription; at_risk: a past_due subscription): repeat, subscribers, at_risk",
      "allowed_values": [
        "repeat",
        "subscribers",
        "at_risk"
      ],
      "required": false
    },
    {
      "name": "sort",
      "shorthand": "s",
      "type": "string",
      "default": "",
      "usage": "Sort: total_revenue, order_count, last_activity_time, first_seen_time, mrr",
      "allowed_values": [
        "total_revenue",
        "order_count",
        "last_activity_time",
        "first_seen_time",
        "mrr"
      ],
      "required": false
    },
    {
      "name": "time-from",
      "type": "string",
      "default": "",
      "usage": "Acquisition window start: unix seconds, a date (2026-10-01, from its first second in the account's timezone) or a time with its offset (2026-10-01T09:30:00Z)",
      "required": false
    },
    {
      "name": "time-to",
      "type": "string",
      "default": "",
      "usage": "Acquisition window end, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset",
      "required": false
    }
  ]
}