Deal products (line items)
A deal's line items are the products attached to it, each with its own price, quantity,
and discount. pdcli manages them under deal product, a v2 command group that maps onto
/api/v2/deals/{id}/products. The deal's product catalog entry lives in product; the
line item that ties a product to a deal is the attachment you operate on here.
List the line items
Section titled “List the line items”pdcli deal product list 42┌────┬─────────┬────────────┬────────────┬─────┬──────────┬──────┐│ ID │ Product │ Name │ Item price │ Qty │ Discount │ Sum │├────┼─────────┼────────────┼────────────┼─────┼──────────┼──────┤│ 3 │ 10 │ Consulting │ 150 │ 4 │ 0 │ 600 ││ 7 │ 12 │ Onboarding │ 90 │ 1 │ 10 │ 80 │└────┴─────────┴────────────┴────────────┴─────┴──────────┴──────┘The ID column is the attachment ID — the handle you pass to --attachment when
updating or removing a line, distinct from the catalog Product ID. Sort with --sort-by
(id, add_time, update_time, or order_nr) and --sort-direction (asc/desc):
pdcli deal product list 42 --sort-by add_time --sort-direction descAdd a line item
Section titled “Add a line item”--product (catalog ID) and --price (per-unit item price) are required; --quantity
defaults to 1. Discounts, tax, and a comment are optional:
pdcli deal product add 42 --product 10 --price 90pdcli deal product add 42 --product 10 --price 90 --quantity 3pdcli deal product add 42 --product 10 --price 90 --discount 10 --discount-type percentage--discount-type is percentage or amount. You don't compute the line total yourself —
Pipedrive derives sum server-side from item_price × quantity less the discount, and
returns it on the created record. That's why the Sum column above (e.g. 150 × 4 = 600)
isn't something pdcli adds up locally.
Update a line item
Section titled “Update a line item”update is a v2 PATCH — only the fields you pass change; everything else is left alone.
Identify the line with --attachment (the ID from deal product list):
pdcli deal product update 42 --attachment 3 --quantity 5pdcli deal product update 42 --attachment 3 --price 120pdcli deal product update 42 --attachment 3 --discount 15 --discount-type amountPass at least one field flag, or it's exit 64 (Nothing to update). Any of --product,
--price, --quantity, --discount, --discount-type, --tax, and --comments may be
combined; the server recomputes sum from the new values.
Remove a line item
Section titled “Remove a line item”pdcli deal product remove 42 --attachment 3pdcli deal product remove 42 --attachment 3 --yesLike every destructive command, it confirms first; -y/--yes skips the prompt for scripts.
Worked example
Section titled “Worked example”Find a product in the catalog, attach it to a deal, and confirm the line:
pdcli product list --jq '.[] | {id, name}' # find the catalog product IDpdcli deal product add 42 --product 10 --price 150 --quantity 4pdcli deal product list 42 # the new line, with its server-computed Sum