Skip to content

feat(quotes): add quote commands - #32

Draft
santi-de wants to merge 1 commit into
mainfrom
santi/san-240-cli-cli-parity-for-quotes
Draft

santi-de wants to merge 1 commit into
mainfrom
santi/san-240-cli-cli-parity-for-quotes

Conversation

@santi-de

Copy link
Copy Markdown

Summary

Adds dualentry quotes for CPQ quotes, built on the /public/v2/quotes API.

  • list: --search, --status, --approval-status, --company, --customer, --valid-from / --valid-to, --ordering, plus the usual paging and --all.
  • get: by quote number (12) or the QT- ID shown in the app (QT-45). The human output shows lines with billing frequency and service period, ramp segments, totals (one-time, recurring per cadence, MRR and ARR, first invoice, TCV or "Ongoing", per year), and the signing order.
  • create --file: nested lines, recipients and signing order as JSON. record_status: "posted" submits for approval; "draft" saves.
  • update: partial update (PATCH). Sending items or recipients replaces the list, as documented in --help.
  • --display-options on create and update: headline_total, total_rows, year_by_year.
  • submit: submits a draft or rejected quote for approval.
  • send: emails an approved quote with --to/--cc/--bcc/--subject/--message/--reply-to, attaching a PDF with --pdf file.pdf or sending without one via --no-pdf.
  • template: a sample quote JSON.

Not included, because the API does not offer them: approve and reject (approvers act in the app), PDF download, and the payment schedule preview. Orgs without the CPQ subscription get the API's "Subscription required" error.

README and CHANGELOG updated.

Testing

  • tests/test_quotes.py: list filters, get by number and by QT- ID, ongoing TCV output, display-options merge and validation, partial update, submit, send with and without a PDF, the subscription error, and the template.
  • The quotes API is not on production yet; these commands work once it ships.

Made with Cursor

Add dualentry quotes: list with quote filters, get by number or QT- ID with totals and signing order, create, partial update with --display-options, submit, send with or without a PDF, and a JSON template.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Scorpion197

Copy link
Copy Markdown

i believe you should check that the returned quote’s id matches the one requested before using its number becuase f /quotes/ ignores the id filter, limit=1 would just return the first quote which means quotes send QT-45 could quietly email another customer’s quote

_resolve_by_internal_id in commands/__init__.py already handles this so the same check could work here raising a 404 if there’s no match

@Warkanlock
Warkanlock marked this pull request as draft October 19, 2026 15:51
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.

3 participants