Skip to content

feat(org): add finalized invoice commands - #659

Draft
ImLunaHey wants to merge 1 commit into
mainfrom
luna/dep-4480-invoices
Draft

ImLunaHey wants to merge 1 commit into
mainfrom
luna/dep-4480-invoices

Conversation

@ImLunaHey

@ImLunaHey ImLunaHey commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Add finalized invoice exports under depot org invoices:

depot org invoices list --page-size 100
depot org invoices get in_example
depot org invoices line-items in_example --page-token '<nextPageToken>'
  • Return full protobuf JSON responses, preserving signed integer amounts as strings and optional fields. List commands read one page and expose continuation tokens, including on empty filtered pages.
  • Accept organization tokens or owner user tokens with --org; preserve the token's organization unless explicitly selected. No interactive login.
  • Use published Buf commit 2ae2cc96583940688aa4b20766844296, retaining the existing Go generator and Connect runtime versions.
  • Document current/previous subscription and standalone history, pagination, and confidential document links.

Validation: full go test ./...; organization-command race tests; golangci-lint; module verification/tidy; binary build and command-help smoke checks. Tests exercise real HTTP/2 Connect requests, auth headers, exact JSON amounts, empty-page continuation, invalid inputs, and API errors without retries. Hosted cross-platform packaging and upstream validation remain CI checks.

Release after API #5892 is verified deployed. This CLI uses Buf modules directly and does not depend on the Go SDK release.

Part of DEP-4480. SDK counterparts: Node #36, Go #65.

Catch up on this pull request in Depot


Note

Medium Risk
Touches billing/invoice data and confidential document URLs in JSON responses, but the change is read-only CLI surfacing of an existing API with token-gated access and solid test coverage.

Overview
Adds depot org invoices with list, get, and line-items so automation can read finalized Stripe invoice data as protobuf JSON without fetching hosted/PDF links.

Calls the new BillingService via NewBillingClient(), using static org tokens (--token / DEPOT_TOKEN) or an owner user token with --org—not the org from org switch, and no interactive login. List commands are single-page with --page-size (1–100) and --page-token, including empty pages that still return a continuation token.

Bumps the generated buf.build API modules to commit 2ae2cc965839, wires the command under depot org, documents usage in the README, and adds HTTP/2 Connect tests for JSON amount precision, pagination, auth headers, validation, and error handling without retries.

Reviewed by Cursor Bugbot for commit 9c8de5f. Bugbot is set up for automated code reviews on this repo. Configure here.

@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

DEP-4480

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