Guides and Examples
...
Quotes
Discounts
20 min
discounts the nue cpq pricing engine supports a three layer discount model that gives you precise control over how discounts are applied across a quote discounts can be set at the header level, the parent/bundle level, or the individual line item level, and they follow deterministic override rules so you always know which discount wins use this guide when you need to apply discretionary discounts to new quotes whether a blanket percentage across all lines, targeted discounts on specific products, dollar amount discounts, or combinations of these discount layers layer field location applies to override behavior header discount discount or discountamount on the quote root all line items that do not have their own discount lowest priority; overridden by bundle or product level discounts bundle/parent discount discount or discountamount on a bundle product all children of that bundle (unless child has its own) middle priority; overrides header, overridden by child level line level discount discount or discountamount on a product entry that specific line item only highest priority; overrides header and parent discounts key rules percentage takes priority over amount if both discount (percentage) and discountamount are provided on the same object, the percentage value is used and the amount is ignored product level discount overrides header discount a line item with its own discount or discountamount will not receive the header level discount bundle discount propagates to children a discount on a bundle parent flows down to all child add ons unless the child specifies its own discount header discountamount is distributed proportionally the fixed dollar amount is allocated across eligible lines based on each line's share of the total list amount bundled items with a $0 list price are not discountable discounts are skipped for zero price children non discountable products generate a warning if a product is configured as non discountable in the catalog, the system issues a warning and skips the discount for that line pricing calculation order resolve the list unit price from the price book entry (or price tag) apply price tags (pricedimension) to determine the effective unit price apply discount tags (discountdimension) if present apply discretionary discounts (this guide) header, bundle, or line level calculate the final totalprice for each line warning codes warning code meaning product discount overrides header a product level discount was found, so the header discount was not applied to that line product discount applied a product level discount was successfully applied header discount applied the header discount was applied to a line that had no product level override product not discountable the product is configured as non discountable; the discount was skipped authentication setup all examples below use the following headers const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); use case 1 header level percentage discount apply a 10% discount to every line item in the quote by setting discount on the quote root the discount propagates to all lines that do not have their own product level discount const quotedata = { opportunityid "006xx000001abc123", name "q1 enterprise license — 10% header discount", subscriptionstartdate "2025 01 01", subscriptionenddate "2026 01 01", subscriptiontermdimension "month", subscriptionterm 12, discount 10, products \[ { productsku "platform base", uom "user/month", quantity 50 }, { productsku "analytics addon", uom "user/month", quantity 50 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log(`header discount ${result quote discount}%`); result quotelineitems foreach(item => { console log(`${item product sku} list $${item listtotalprice} → total $${item totalprice} (${item discount}% off)`); }); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "q1 enterprise license — 10% header discount", "subscriptionstartdate" "2025 01 01", "subscriptionenddate" "2026 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "discount" 10, "products" \[ { "productsku" "platform base", "uom" "user/month", "quantity" 50 }, { "productsku" "analytics addon", "uom" "user/month", "quantity" 50 } ] }' both products receive the 10% discount because neither has a product level discount override the response warnings array will contain header discount applied entries for each line use case 2 product level discount on bundle and standalone apply different discounts to a bundle parent (20%) and a standalone product (10%) the bundle's 20% discount propagates to all of its child add ons const quotedata = { opportunityid "006xx000001abc123", name "bundle 20% + standalone 10%", subscriptionstartdate "2025 01 01", subscriptionenddate "2026 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "enterprise suite", uom "user/month", quantity 50, discount 20, addons \[ { productsku "premium support", uom "user/month", quantity 50 }, { productsku "data export", uom "user/month", quantity 50 } ] }, { productsku "analytics addon", uom "user/month", quantity 25, discount 10 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { result quotelineitems foreach(item => { console log(`${item product sku} ${item discount}% off → $${item totalprice}`); if (item childrenlineitems) { item childrenlineitems foreach(child => { console log(` └─ ${child product sku} ${child discount}% off → $${child totalprice}`); }); } }); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "bundle 20% + standalone 10%", "subscriptionstartdate" "2025 01 01", "subscriptionenddate" "2026 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "enterprise suite", "uom" "user/month", "quantity" 50, "discount" 20, "addons" \[ { "productsku" "premium support", "uom" "user/month", "quantity" 50 }, { "productsku" "data export", "uom" "user/month", "quantity" 50 } ] }, { "productsku" "analytics addon", "uom" "user/month", "quantity" 25, "discount" 10 } ] }' result enterprise suite parent and both children ( premium support , data export ) receive 20% off analytics addon receives its own 10% discount independently use case 3 bundle discount with protected add on apply a 15% discount to a bundle parent, but protect a specific add on from the discount by setting discount 0 on it the protected add on keeps its full list price while sibling add ons inherit the parent discount const quotedata = { opportunityid "006xx000001abc123", name "bundle 15% with protected add on", subscriptionstartdate "2025 01 01", subscriptionenddate "2026 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "enterprise suite", uom "user/month", quantity 50, discount 15, addons \[ { productsku "premium support", uom "user/month", quantity 50 }, { productsku "data export", uom "user/month", quantity 50, discount 0 } ] } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { const parent = result quotelineitems\[0]; console log(`${parent product sku} ${parent discount}% off`); parent childrenlineitems foreach(child => { console log(` └─ ${child product sku} ${child discount}% off → $${child totalprice}`); }); // premium support inherits 15% from parent // data export uses its own 0% discount (full price) }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "bundle 15% with protected add on", "subscriptionstartdate" "2025 01 01", "subscriptionenddate" "2026 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "enterprise suite", "uom" "user/month", "quantity" 50, "discount" 15, "addons" \[ { "productsku" "premium support", "uom" "user/month", "quantity" 50 }, { "productsku" "data export", "uom" "user/month", "quantity" 50, "discount" 0 } ] } ] }' result enterprise suite and premium support receive 15% off data export receives 0% off (its own discount 0 overrides the parent's 15%) the response warnings will include product discount overrides header for data export use case 4 dollar discount amount on a product apply a fixed dollar discount ( discountamount ) to a specific product instead of a percentage the discountamount is subtracted from the line's list total price const quotedata = { opportunityid "006xx000001abc123", name "dollar discount on product", subscriptionstartdate "2025 01 01", subscriptionenddate "2026 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "platform base", uom "user/month", quantity 10, discountamount 50 }, { productsku "analytics addon", uom "user/month", quantity 10 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { result quotelineitems foreach(item => { console log(`${item product sku} list $${item listtotalprice}, discountamount $${item discountamount || 0}, total $${item totalprice}`); }); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "dollar discount on product", "subscriptionstartdate" "2025 01 01", "subscriptionenddate" "2026 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "platform base", "uom" "user/month", "quantity" 10, "discountamount" 50 }, { "productsku" "analytics addon", "uom" "user/month", "quantity" 10 } ] }' platform base has $50 subtracted from its list total price analytics addon receives no discount because neither a header nor product level discount is specified use case 5 header dollar amount + product percentage (mixed) combine a header level discountamount with a product level discount percentage the product with its own percentage discount uses that value; lines without a product level discount receive a proportional share of the header dollar amount const quotedata = { opportunityid "006xx000001abc123", name "header dollar + product percentage mix", subscriptionstartdate "2025 01 01", subscriptionenddate "2026 01 01", subscriptiontermdimension "month", subscriptionterm 12, discountamount 200, products \[ { productsku "platform base", uom "user/month", quantity 50 }, { productsku "analytics addon", uom "user/month", quantity 50, discount 15 }, { productsku "data export", uom "user/month", quantity 25 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log(`header discountamount $${result quote discountamount}`); result quotelineitems foreach(item => { console log(`${item product sku} discount=${item discount || 0}%, discountamount=$${item discountamount || 0}, total=$${item totalprice}`); }); // platform base receives proportional share of the $200 header amount // analytics addon receives its own 15% discount (header dollar skipped) // data export receives proportional share of the $200 header amount }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "header dollar + product percentage mix", "subscriptionstartdate" "2025 01 01", "subscriptionenddate" "2026 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "discountamount" 200, "products" \[ { "productsku" "platform base", "uom" "user/month", "quantity" 50 }, { "productsku" "analytics addon", "uom" "user/month", "quantity" 50, "discount" 15 }, { "productsku" "data export", "uom" "user/month", "quantity" 25 } ] }' result analytics addon uses its own 15% percentage discount the header discountamount is not applied to this line platform base and data export split the $200 header discount proportionally based on their list amounts the warnings array will include product discount overrides header for analytics addon use case 6 non discountable products when a product is configured as non discountable in the product catalog, the pricing engine skips the discount for that line and issues a warning other eligible lines still receive their discounts const quotedata = { opportunityid "006xx000001abc123", name "quote with non discountable product", subscriptionstartdate "2025 01 01", subscriptionenddate "2026 01 01", subscriptiontermdimension "month", subscriptionterm 12, discount 10, products \[ { productsku "platform base", uom "user/month", quantity 50 }, { productsku "compliance module", uom "user/month", quantity 50 }, { productsku "analytics addon", uom "user/month", quantity 25 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { result quotelineitems foreach(item => { console log(`${item product sku} discount=${item discount || 0}%, total=$${item totalprice}`); }); // check warnings for non discountable products if (result warnings && result warnings length > 0) { result warnings foreach(w => { console log(`warning \[${w\ code}] ${w\ message}`); }); } // compliance module (non discountable) triggers product not discountable warning // platform base and analytics addon receive the 10% header discount }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "quote with non discountable product", "subscriptionstartdate" "2025 01 01", "subscriptionenddate" "2026 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "discount" 10, "products" \[ { "productsku" "platform base", "uom" "user/month", "quantity" 50 }, { "productsku" "compliance module", "uom" "user/month", "quantity" 50 }, { "productsku" "analytics addon", "uom" "user/month", "quantity" 25 } ] }' result platform base and analytics addon receive the 10% header discount normally compliance module is non discountable its totalprice equals its listtotalprice , and the response warnings array contains a product not discountable entry for that line discount interaction rules scenario behavior header discount + no product discount header percentage applied to all lines header discount + product discount product percentage wins; header skipped for that line header discountamount + no product discount dollar amount distributed proportionally across all lines header discountamount + product discount product percentage wins; header dollar excluded from that line's allocation bundle discount + no child discount bundle percentage propagates to all children bundle discount + child discount child percentage wins; bundle discount skipped for that child both discount and discountamount on same object percentage wins; dollar amount ignored non discountable product + any discount discount skipped; warning issued discount field reference field type scope description discount number (0 100) quote root, product, add on percentage discount discountamount number quote root, product, add on fixed dollar discount next steps docid\ z5zott7eszhmhaxifqmkr apply tiered, volume, and ramp pricing adjustments docid\ wwo0bzasgs6mdcue g kl configure term lengths, billing periods, and renewal settings docid\ fri8qggg2m1jvpi qlnvi work with bundle products and add ons docid\ bc idxynwaus7o9efycwq return to the full api reference