Skip to content

refactor(cli): send customerId on the card commands - #962

Open
whoisglover wants to merge 1 commit into
mainfrom
eng-11658-cli-customer-id
Open

refactor(cli): send customerId on the card commands#962
whoisglover wants to merge 1 commit into
mainfrom
eng-11658-cli-customer-id

Conversation

@whoisglover

@whoisglover whoisglover commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Jira: ENG-11658 under ENG-11645

What this does

The card endpoints used to call the cardholder cardholderId. #937 renamed that to customerId across the spec and the docs.

The Grid CLI was not part of that change. It still sends cardholderId and still spells the flag --cardholder-id, so the one executable client in this repo speaks a field name the spec no longer documents.

This PR brings the CLI in line.

How it works

  • grid cards list --cardholder-id becomes grid cards list --customer-id.
  • grid cards create --cardholder-id becomes grid cards create --customer-id.
  • The Card interface and both request bodies send customerId.
  • The README examples use the new flag.

Breaking for anyone scripting the CLI. There is no alias, which matches how #937 handled the API itself.

Sequencing

The server has not caught up. GridListCardsRequestArgs in list_cards.py declares cardholder_id and sets extra="forbid", so GET /cards?customerId= returns a 400 until the server change lands. POST /cards is the same: the generated CardCreateRequest still requires cardholderId.

So this should merge with the webdev server change, not ahead of it. Holding it as its own PR keeps that decision separate from the funding-source work.

Tests

cd cli && npm test passes 80 tests.

Why it is its own PR

It was sitting inside #934, which is titled "bind one funding source per card". A breaking flag rename that belongs to a different ticket should not ride along inside that diff, so it was split out.

@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
grid-flow-builder Ignored Ignored Preview Sep 12, 2026 3:54am UTC
grid-wallet-demo Ignored Ignored Preview Sep 12, 2026 3:54am UTC

Request Review

@whoisglover
whoisglover marked this pull request as ready for review September 12, 2026 03:56
@whoisglover

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

This PR should not merge or release independently because its list and create requests fail against the current server; it is mergeable once the corresponding server support is coordinated.

Findings

  1. P1 Server rollout breaks commands
Fix with agent prompt
### Issue 1
cli/src/commands/cards.ts:71
If this CLI change is merged or released before the server update, `cards list --customer-id` sends a query parameter the current server rejects, while `cards create --customer-id` sends `customerId` instead of the required `cardholderId` at line 121. Both commands therefore fail against the current server. Coordinate the server rollout or retain temporary compatibility until server support lands.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

  • Renames the list and create flags from --cardholder-id to --customer-id.
  • Sends customerId in card list queries and create request bodies.
  • Updates the local card type, tests, and README examples.
  • Requires coordinated deployment with the server change because the current server rejects these new requests.

Reviews (1) · Last reviewed commit: "refactor(cli): send customerId on the ca..."

Comment thread cli/src/commands/cards.ts

const params: Record<string, string | number | undefined> = {
cardholderId: options.cardholderId,
customerId: options.customerId,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Server rollout breaks commands

If this CLI change is merged or released before the server update, cards list --customer-id sends a query parameter the current server rejects, while cards create --customer-id sends customerId instead of the required cardholderId at line 121. Both commands therefore fail against the current server. Coordinate the server rollout or retain temporary compatibility until server support lands.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/src/commands/cards.ts
Line: 71

Comment:
**Server rollout breaks commands**

If this CLI change is merged or released before the server update, `cards list --customer-id` sends a query parameter the current server rejects, while `cards create --customer-id` sends `customerId` instead of the required `cardholderId` at line 121. Both commands therefore fail against the current server. Coordinate the server rollout or retain temporary compatibility until server support lands.

**Knowledge Base Used:**
- [Grid command-line client](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/grid-cli.md)
- [Client integration tooling](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/client-integrations.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant