Set opportunity products
set_opportunity_productsReplace an opportunity's entire product set and derive its value. Pass catalog product IDs/quantities, never prices; [] clears all lines and sets value to zero. The server snapshots unit_price_cents and computes totals: per_unit multiplies by quantity, flat charges once (quantity >1 is flagged). Discounts are percentages via line/top-level discount_pct; the server computes money. Bundles expand automatically; out-of-tier quantities are flagged, not blocked. include_discontinued:true allows a discontinued item on an existing agreement. Returns the fresh opportunity, priced lines and flags.
When to use: Price a deal from selected products after applying the opportunity_products template.
Example: Put 15 standard-plan units on Acme’s deal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | The WHOLE product set (replace-all): [{product_id: product uuid, quantity: integer ≥ 0, discount_pct?: 0–100, include_discontinued?: boolean}]; [] clears every line. | |
| discount_pct | No | A number from 0 to 100. | |
| opportunity_id | Yes | A uuid. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| updated | No | ||
| guidance | No | ||
| line_items | No | ||
| opportunity | No | ||
| missing_objects | No | ||
| tier_validations | No | ||
| pricing_mode_validations | No |