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                                                  18           diego.hayes18@example.com      375             Diego       1790695422       1790695422          Hayes      0         1            cust-1018    0                        607
active  0                                                  16           silas.haddad16@example.com     369             Silas       1791235662       1791235662          Haddad     0         1            cust-1016    0                        606
active  1                                                  64           zoe.okafor64@example.com       1547            Zoe         1791754494       1791754494          Okafor     49        1            cust-1064    0                        588
active  1                                                  40           isla.reyes40@example.com       931             Isla        1791721087       1791721087          Reyes      49        1            cust-1040    0                        588
active  1                                                  27           hazel.underwood27@example.com  677             Hazel       1790262839       1790262839          Underwood  49        1            cust-1027    0                        588
active  0                                                  52           grace.carter52@example.com     1306            Grace       1792414880       1792414880          Carter     0         1            cust-1052    0                        577
active  1                                                  109          priya.nguyen109@example.com    2694            Priya       1790598577       1790598577          Nguyen     29        1            cust-1109    0                        348
active  1                                                  107          diego.bennett107@example.com   2630            Diego       1790117692       1790117692          Bennett    29        1            cust-1107    0                        348
active  1                                                  99           theo.nguyen99@example.com      2459            Theo        1792362110       1792362110          Nguyen     29        1            cust-1099    0                        348
active  1                                                  86           chloe.ellis86@example.com      2127            Chloe       1791330094       1791330094          Ellis      29        1            cust-1086    0                        348
active  1                                                  66           hugo.foster66@example.com      1591            Hugo        1790864794       1790864794          Foster     29        1            cust-1066    0                        348
active  1                                                  57           rhys.patel57@example.com       1416            Rhys        1790628035       1790628035          Patel      29        1            cust-1057    0                        348
active  1                                                  47           mason.patel47@example.com      1159            Mason       1792205808       1792205808          Patel      29        1            cust-1047    0                        348
active  1                                                  45           ruby.walsh45@example.com       1094            Ruby        1790460284       1790460284          Walsh      29        1            cust-1045    0                        348
active  1                                                  13           maya.grant13@example.com       330             Maya        1790349735       1790349735          Grant      29        1            cust-1013    0                        348
active  1                                                  12           liam.lindqvist12@example.com   318             Liam        1792330333       1792330333          Lindqvist  29        1            cust-1012    0                        348
active  0                                                  20           jonah.haddad20@example.com     403             Jonah       1792001795       1792621961          Haddad     0         2            cust-1020    0                        338
active  0                                                  30           clara.foster30@example.com     756             Clara       1792421176       1792621961          Foster     0         2            cust-1030    0                        286
active  0                                                  10           nora.haddad10@example.com      246             Nora        1792546064       1792621961          Haddad     0         2            cust-1010    0                        258
active  0                                                  84           owen.walsh84@example.com       2066            Owen        1790644401       1791412023          Walsh      0         2            cust-1084    0                        242
active  0                                                  35           diego.quinn35@example.com      848             Diego       1792408826       1792621961          Quinn      0         2            cust-1035    0                        242
active  0                                                  110          elias.zhang110@example.com     2710            Elias       1791907472       1792336637          Zhang      0         2            cust-1110    0                        232
active  0                                                  95           silas.lopez95@example.com      2348            Silas       1792270784       1792270784          Lopez      0         1            cust-1095    0                        225
active  0                                                  6            silas.walsh6@example.com       135             Silas       1792588984       1792588984          Walsh      0         1            cust-1006    0                        225
active  0                                                  1            silas.okafor1@example.com      10              Silas       1790285091       1790925926          Okafor     0         2            cust-1001    0                        208
active  0                                                  72           chloe.haddad72@example.com     1695            Chloe       1791522420       1792276669          Haddad     0         2            cust-1072    0                        200
active  0                                                  63           mateo.jensen63@example.com     1494            Mateo       1791055483       1791055483          Jensen     0         1            cust-1063    0                        198
active  0                                                  82           grace.jensen82@example.com     2050            Grace       1790945821       1791518952          Jensen     0         2            cust-1082    0                        195
active  0                                                  19           elias.lindqvist19@example.com  380             Elias       1791547456       1791987825          Lindqvist  0         2            cust-1019    0                        192
active  0                                                  51           kenji.tanaka51@example.com     1279            Kenji       1792299173       1792299173          Tanaka     0         1            cust-1051    0                        180
active  0                                                  60           arlo.moreau60@example.com      1429            Arlo        1792522686       1792522686          Moreau     0         1            cust-1060    0                        175
active  0                                                  41           aisha.morgan41@example.com     938             Aisha       1792424376       1792621961          Morgan     0         2            cust-1041    0                        175
active  0                                                  24           isla.zhang24@example.com       583             Isla        1790117958       1790117958          Zhang      0         1            cust-1024    0                        175
active  0                                                  68           mason.patel68@example.com      1609            Mason       1791840991       1791840991          Patel      0         1            cust-1068    0                        174
active  0                                                  49           ruby.morgan49@example.com      1223            Ruby        1791574604       1791574604          Morgan     0         1            cust-1049    0                        174
active  0                                                  43           mateo.zhang43@example.com      995             Mateo       1792610762       1792621961          Zhang      0         2            cust-1043    0                        174
active  0                                                  92           zoe.ortiz92@example.com        2262            Zoe         1790962246       1791477831          Ortiz      0         2            cust-1092    0                        164
active  0                                                  4            leo.quinn4@example.com         58              Leo         1792563469       1792563469          Quinn      0         1            cust-1004    0                        164
active  0                                                  102          elias.walsh102@example.com     2500            Elias       1790118931       1790118931          Walsh      0         1            cust-1102    0                        150
active  0                                                  101          aisha.turner101@example.com    2485            Aisha       1791356199       1791356199          Turner     0         1            cust-1101    0                        146
active  0                                                  97           arlo.lopez97@example.com       2377            Arlo        1792597344       1792597344          Lopez      0         1            cust-1097    0                        146
active  0                                                  65           miles.nguyen65@example.com     1561            Miles       1791243150       1791243150          Nguyen     0         1            cust-1065    0                        146
active  0                                                  48           rhys.zhang48@example.com       1192            Rhys        1792621991       1792621991          Zhang      0         1            cust-1048    0                        141
active  0                                                  37           noah.reyes37@example.com       865             Noah        1790044560       1790044560          Reyes      0         1            cust-1037    0                        132
active  0                                                  56           chloe.shah56@example.com       1382            Chloe       1790271788       1790677373          Shah       0         2            cust-1056    0                        130
active  0                                                  42           grace.vance42@example.com      967             Grace       1792019482       1792567917          Vance      0         2            cust-1042    0                        126
active  0                                                  81           clara.vance81@example.com      2005            Clara       1790954864       1790954864          Vance      0         1            cust-1081    0                        112
active  0                                                  78           ethan.ortiz78@example.com      1851            Ethan       1790177646       1790177646          Ortiz      0         1            cust-1078    0                        111
active  0                                                  113          jonah.young113@example.com     2876            Jonah       1791486019       1791486019          Young      0         1            cust-1113    0                        108
active  0                                                  98           priya.haddad98@example.com     2441            Priya       1791799995       1792621961          Haddad     0         2            cust-1098    0                        102
Total: 114 | Limit: 50 | Offset: 0
Warning: Showing 50 of 114 results. Use --all to fetch all.
Real output · p202 1.9.78 · 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, 6 no Pro licence on the install.
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
    }
  ]
}