Summary
Expose the high-priority V4 Live finance and shared-account methods that still have no practical V5 equivalent, using typed Direct CLI commands.
Commands
Implement these commands with typed flags:
direct v4finance get-clients-units --logins LOGIN[,LOGIN...]
direct v4finance get-credit-limits --logins LOGIN[,LOGIN...]
direct v4finance transfer-money --from-login LOGIN --to-login LOGIN --amount AMOUNT --dry-run
direct v4finance pay-campaigns --campaign-ids IDS --amount AMOUNT --dry-run
direct v4finance check-payment --payment-id ID
direct v4account account-management ... --dry-run
direct v4account enable-shared-account ... --dry-run
Exact flag names should stay canonical: lowercase kebab-case, comma-separated list flags, and explicit typed inputs. Do not add raw JSON passthrough.
Implementation Notes
- Use the V4 foundation helper from the V4 CLI foundation issue.
- Money values stay human-readable at the CLI boundary and convert internally if V4 requires another wire format.
- Mutating commands must support
--dry-run and print the exact V4 request body.
- If official V4 docs contradict the vendored
SUPPORTED_V4_METHODS, record the finding and mark the method api-status:docs-drift before implementation.
- Do not add
GetBalance unless official verification shows it works; current vendored registry notes it was removed with error code 509.
Test Plan
- Dry-run tests assert exact request bodies for mutating commands.
- Unit tests for comma-separated login/campaign ID parsing.
- CLI error tests for missing required flags and invalid money values.
- Mocked adapter tests for successful read commands.
Acceptance Criteria
- All listed commands are registered and documented.
- Mutating commands have
--dry-run coverage.
- Invalid inputs fail with Click usage errors before API calls.
- README includes single-line canonical examples.
- Commands are classified in the smoke matrix.
Contract source rule
When this issue touches API contracts, V4 Live methods, request bodies, response shapes, safety classification, or CLI command payloads:
- Treat official Yandex Direct docs and safe live probes as the only authoritative sources for wire shape.
- Do not treat issue examples, guessed param names, or vendored method registries as authoritative by themselves.
- If official docs are missing, 404, ambiguous, disabled, or contradict this issue, stop implementation and record the docs drift before coding.
- Public CLI must stay typed and canonical: no public
--json passthrough for user-facing input.
- Mutating or financially sensitive V4 commands stay dry-run-only unless the issue explicitly says otherwise after verification.
- Update
direct_cli/v4_contracts.py source status (confirmed-live, docs, undocumented) and add focused tests for exact request bodies.
Summary
Expose the high-priority V4 Live finance and shared-account methods that still have no practical V5 equivalent, using typed Direct CLI commands.
Commands
Implement these commands with typed flags:
direct v4finance get-clients-units --logins LOGIN[,LOGIN...]direct v4finance get-credit-limits --logins LOGIN[,LOGIN...]direct v4finance transfer-money --from-login LOGIN --to-login LOGIN --amount AMOUNT --dry-rundirect v4finance pay-campaigns --campaign-ids IDS --amount AMOUNT --dry-rundirect v4finance check-payment --payment-id IDdirect v4account account-management ... --dry-rundirect v4account enable-shared-account ... --dry-runExact flag names should stay canonical: lowercase kebab-case, comma-separated list flags, and explicit typed inputs. Do not add raw JSON passthrough.
Implementation Notes
--dry-runand print the exact V4 request body.SUPPORTED_V4_METHODS, record the finding and mark the methodapi-status:docs-driftbefore implementation.GetBalanceunless official verification shows it works; current vendored registry notes it was removed with error code509.Test Plan
Acceptance Criteria
--dry-runcoverage.Contract source rule
When this issue touches API contracts, V4 Live methods, request bodies, response shapes, safety classification, or CLI command payloads:
--jsonpassthrough for user-facing input.direct_cli/v4_contracts.pysource status (confirmed-live,docs,undocumented) and add focused tests for exact request bodies.