From cdb956ff29a89a0a8a0df8717e2c66ea15431bfb Mon Sep 17 00:00:00 2001 From: Josh Holtz Date: Tue, 8 Sep 2026 16:34:18 -0500 Subject: [PATCH 1/3] feat(customers): rename wallet to balances, In-App Currency copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'wallet' was a name the CLI invented — the product is In-App Currency and nothing else calls this a wallet. The command is now 'rc customers balances' with 'wallet' kept as an alias for old scripts. The api layer methods follow their endpoint names (VirtualCurrencies*) instead of the CLI concept. Co-Authored-By: Claude Fable 5 --- docs/command-surface.md | 6 +++--- .../api/customer_subscription_paths_test.go | 4 ++-- internal/api/customers.go | 6 +++--- internal/cli/customers.go | 19 ++++++++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/command-surface.md b/docs/command-surface.md index 348069db..c90d5dd8 100644 --- a/docs/command-surface.md +++ b/docs/command-surface.md @@ -123,7 +123,7 @@ rc customers override-offering --offering rc customers clear-override rc customers restore-google --token rc customers simulate-purchase # Test Store only; --app-id/--product/--app-user-id + confirmation/--yes -rc customers wallet # virtual_currencies per-customer +rc customers balances # per-customer In-App Currency balances (virtual_currencies endpoint); wallet is a hidden alias # Entitlements (project catalog) rc entitlements list @@ -252,9 +252,9 @@ rc audit # /audit_logs with --li ## Build order 1. **`projects`** (list, show, use, create) — create is required for zero-to-project setup. -2. **`customers`** ✅ — list, composite show, grant, revoke, aliases, attributes (+ set-attribute), transfer, override-offering, clear-override, restore-google, wallet. +2. **`customers`** ✅ — list, composite show, grant, revoke, aliases, attributes (+ set-attribute), transfer, override-offering, clear-override, restore-google, balances. 3. **Catalog CRUD** ✅ — entitlements (+ archive/restore/products/attach/detach), offerings (+ archive/restore), products (+ update/archive/restore/push), packages (show/create/update/delete/products/attach/detach). No `crud` helper extracted — readable enough inline. -4. **Support toolkit**: `subscriptions` ✅ (show/transactions/entitlements/management-url/cancel/extend/refund), `purchases` ✅, `invoices` ✅, `customer wallet` ✅. +4. **Support toolkit**: `subscriptions` ✅ (show/transactions/entitlements/management-url/cancel/extend/refund), `purchases` ✅, `invoices` ✅, `customers balances` ✅. 5. **Long tail**: `webhooks` ✅ (under `/integrations/webhooks`), `paywalls` ✅. 6. **Cross-resource utilities**: `metrics` ✅, `charts list/show/options` ✅ (with client-side enum validation + shell completion), `audit` ✅. 7. **Apps** ✅ — list/show/create/update/delete/keys/storekit-config. diff --git a/internal/api/customer_subscription_paths_test.go b/internal/api/customer_subscription_paths_test.go index 6cbda313..9064a0c1 100644 --- a/internal/api/customer_subscription_paths_test.go +++ b/internal/api/customer_subscription_paths_test.go @@ -48,12 +48,12 @@ func TestCustomerAndSubscriptionLivePaths(t *testing.T) { }, }, { - name: "customer wallet update balance", + name: "customer virtual currencies update balance", method: http.MethodPost, path: "/projects/proj/customers/cust/virtual_currencies/update_balance", response: `{}`, call: func(c *api.Client) error { - return c.Customers.WalletAdjustBalance(context.Background(), "proj", "cust", "GLD", 10) + return c.Customers.VirtualCurrenciesUpdateBalance(context.Background(), "proj", "cust", "GLD", 10) }, }, { diff --git a/internal/api/customers.go b/internal/api/customers.go index 90c7d7fc..57735189 100644 --- a/internal/api/customers.go +++ b/internal/api/customers.go @@ -163,20 +163,20 @@ func (s *CustomersService) RestoreGooglePlay(ctx context.Context, projectID, cus } // GET /projects/{project_id}/customers/{customer_id}/virtual_currencies -func (s *CustomersService) Wallet(ctx context.Context, projectID, customerID string) (*Page[map[string]any], error) { +func (s *CustomersService) VirtualCurrencies(ctx context.Context, projectID, customerID string) (*Page[map[string]any], error) { var out Page[map[string]any] err := s.c.do(ctx, http.MethodGet, pathCustomerVirtualCurrencies(projectID, customerID), nil, &out) return &out, err } // POST /projects/{project_id}/customers/{customer_id}/virtual_currencies/update_balance -func (s *CustomersService) WalletAdjustBalance(ctx context.Context, projectID, customerID, currencyCode string, amount int64) error { +func (s *CustomersService) VirtualCurrenciesUpdateBalance(ctx context.Context, projectID, customerID, currencyCode string, amount int64) error { body := map[string]any{"currency_code": currencyCode, "amount": amount} return s.c.do(ctx, http.MethodPost, pathCustomerVirtualCurrenciesUpdateBalance(projectID, customerID), body, nil) } // POST /projects/{project_id}/customers/{customer_id}/virtual_currencies/transactions -func (s *CustomersService) WalletTransaction(ctx context.Context, projectID, customerID, currencyCode string, amount int64) error { +func (s *CustomersService) VirtualCurrenciesTransaction(ctx context.Context, projectID, customerID, currencyCode string, amount int64) error { body := map[string]any{"currency_code": currencyCode, "amount": amount} return s.c.do(ctx, http.MethodPost, pathCustomerVirtualCurrenciesTransactions(projectID, customerID), body, nil) } diff --git a/internal/cli/customers.go b/internal/cli/customers.go index fed66fe0..d9099c57 100644 --- a/internal/cli/customers.go +++ b/internal/cli/customers.go @@ -83,7 +83,7 @@ one Customer are aliases.`, newCustomerClearOverrideCmd(), newCustomerRestoreGoogleCmd(), newCustomerSimulatePurchaseCmd(), - newCustomerWalletCmd(), + newCustomerBalancesCmd(), ) return cmd } @@ -517,14 +517,15 @@ Confirmation: no prompt — idempotent (re-running with the same token is safe). return cmd } -func newCustomerWalletCmd() *cobra.Command { +func newCustomerBalancesCmd() *cobra.Command { return &cobra.Command{ - Use: "wallet ", - Short: "Show a Customer's Virtual Currency balances", - Long: `Shows the Customer's wallet: per-currency virtual currency balances for -the project.`, - Example: ` rc customers wallet cus_abc - rc customers wallet cus_abc --json | jq '.data.items[]'`, + Use: "balances ", + // "wallet" was the original name; kept for muscle memory and old scripts. + Aliases: []string{"wallet"}, + Short: "Show a Customer's In-App Currency balances", + Long: `Shows the Customer's per-currency In-App Currency balances for the project.`, + Example: ` rc customers balances cus_abc + rc customers balances cus_abc --json | jq '.data.items[]'`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { rt := RuntimeFrom(cmd.Context()) @@ -536,7 +537,7 @@ the project.`, if err != nil { return err } - page, err := client.Customers.Wallet(cmd.Context(), projectID, args[0]) + page, err := client.Customers.VirtualCurrencies(cmd.Context(), projectID, args[0]) if err != nil { return err } From 3601e3c3a95174ac157c96c67f5ba8b08488522e Mon Sep 17 00:00:00 2001 From: Josh Holtz Date: Tue, 8 Sep 2026 17:02:18 -0500 Subject: [PATCH 2/3] =?UTF-8?q?fix(customers):=20review=20fixes=20?= =?UTF-8?q?=E2=80=94=20precise=20alias=20wording,=20old-name=20bridge=20in?= =?UTF-8?q?=20help?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'wallet' shows in help and schema output, so it isn't hidden; and the help now names the old Virtual Currency term so grepping for it still finds the command. Co-Authored-By: Claude Fable 5 --- docs/command-surface.md | 2 +- internal/cli/customers.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/command-surface.md b/docs/command-surface.md index c90d5dd8..84c1a7e9 100644 --- a/docs/command-surface.md +++ b/docs/command-surface.md @@ -123,7 +123,7 @@ rc customers override-offering --offering rc customers clear-override rc customers restore-google --token rc customers simulate-purchase # Test Store only; --app-id/--product/--app-user-id + confirmation/--yes -rc customers balances # per-customer In-App Currency balances (virtual_currencies endpoint); wallet is a hidden alias +rc customers balances # per-customer In-App Currency balances (virtual_currencies endpoint); wallet is kept as an alias # Entitlements (project catalog) rc entitlements list diff --git a/internal/cli/customers.go b/internal/cli/customers.go index d9099c57..7eff55d2 100644 --- a/internal/cli/customers.go +++ b/internal/cli/customers.go @@ -523,7 +523,9 @@ func newCustomerBalancesCmd() *cobra.Command { // "wallet" was the original name; kept for muscle memory and old scripts. Aliases: []string{"wallet"}, Short: "Show a Customer's In-App Currency balances", - Long: `Shows the Customer's per-currency In-App Currency balances for the project.`, + Long: `Shows the Customer's per-currency In-App Currency balances for the project. +In-App Currency was formerly called Virtual Currency; the v2 API endpoint and +payload still say virtual_currencies.`, Example: ` rc customers balances cus_abc rc customers balances cus_abc --json | jq '.data.items[]'`, Args: cobra.ExactArgs(1), From 467c75928035e468305df964795cf21c9f118e6c Mon Sep 17 00:00:00 2001 From: Josh Holtz Date: Tue, 8 Sep 2026 17:30:01 -0500 Subject: [PATCH 3/3] docs(command-surface): note the In-App Currency product name in the resource list Co-Authored-By: Claude Fable 5 --- docs/command-surface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/command-surface.md b/docs/command-surface.md index 84c1a7e9..c71653f8 100644 --- a/docs/command-surface.md +++ b/docs/command-surface.md @@ -44,7 +44,7 @@ the code when adding/renaming a command. ## The 16 documented resources (sidebar order) App · Audit Log · Charts & Metrics · Collaborator · Customer · Entitlement · -Offering · Package · Product · Virtual Currency · Purchase · Subscription · +Offering · Package · Product · Virtual Currency (product name: In-App Currency) · Purchase · Subscription · Invoice · Paywall · Integration · Project ## Charts: fixed 22-name enum