Guides and Examples
...
Quotes
Quantity Tier Attributes
20 min
quantity tier attributes quantity tier attributes (qta) dynamically resolve discount tiers based on field values such as account numberofemployees instead of applying a flat discount, you configure tiered brackets that automatically select the correct discount percentage based on a quantity like field at pricing time how qta works the qta mechanism involves three objects that work together quantitypricetierattribute defines the source field that drives tier resolution (e g , account numberofemployees ) productpricedimension a junction object that links a quantitypricetierattribute to a specific product pricedimension with pricetier records defines the quantity brackets and corresponding discount percentages when the pricing engine encounters a product with an attached qta, it reads the value of the source field, finds the matching tier bracket, and applies the configured discount percentage setup requirements object purpose key fields quantitypricetierattribute defines the source field sourcefield (e g , account numberofemployees ), name productpricedimension links qta to a product productid , quantitypricetierattributeid pricedimension groups tier brackets name , type pricetier individual tier bracket minquantity , maxquantity , discountpercent example tier configuration tier min quantity max quantity discount % 1 1 50 0 2 51 200 10 3 201 500 15 4 501 null 20 if account numberofemployees is 300, the engine selects tier 3 and applies a 15% discount resolution flow 1\ pricing engine identifies product has qta via productpricedimension 2\ reads the source field value (e g , account numberofemployees = 300) 3\ looks up pricedimension tiers for the linked qta 4\ finds the tier where minquantity <= 300 <= maxquantity (tier 3) 5\ applies the tier's discount percentage (15%) as a system discount authentication const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); use case 1 qta on bundle parent when a qta is attached to the bundle parent product, the resolved field value drives tier resolution the resolved discount applies to the parent line item pass the tier value using pricetags with the headcountbucket tier configuration const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); const quotedata = { opportunityid "006xx000001abc123", name "qta bundle parent quote", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "enterprise bundle", uom "license/month", quantity 250, pricetags \[{ code "headcount bucket" }], addons \[ { productsku "addon support", uom "license/month", quantity 1 } ] } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { const parentline = result quotelineitems\[0]; console log(`parent discount (from qta) ${parentline discount}%`); console log(`parent total $${parentline 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" "qta bundle parent quote", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "enterprise bundle", "uom" "license/month", "quantity" 250, "pricetags" \[{ "code" "headcount bucket" }], "addons" \[ { "productsku" "addon support", "uom" "license/month", "quantity" 1 } ] } ] }' with a quantity of 250, the engine resolves to tier 3 (201 500) and applies a 15% system discount to the parent line use case 2 qta on specific add on a qta can be attached to an individual add on product rather than the bundle parent in this case, only that add on receives the tiered discount const quotedata = { opportunityid "006xx000001abc123", name "qta add on only quote", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "enterprise bundle", uom "license/month", quantity 10, addons \[ { productsku "addon storage", uom "gb/month", quantity 500, pricetags \[{ code "storage volume tier" }] } ] } ] }; 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]; const addon = parent childrenlineitems\[0]; console log(`parent discount ${parent discount}%`); // no qta 0% console log(`add on discount ${addon discount}%`); // qta resolved }) 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" "qta add on only quote", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "enterprise bundle", "uom" "license/month", "quantity" 10, "addons" \[ { "productsku" "addon storage", "uom" "gb/month", "quantity" 500, "pricetags" \[{ "code" "storage volume tier" }] } ] } ] }' the parent has no qta and receives no tiered discount the addon storage add on resolves its own tier based on quantity 500 use case 3 qta on both parent and add on when both the bundle parent and an add on have qta configurations, each product resolves its tier independently based on its own linked qta field and quantity const quotedata = { opportunityid "006xx000001abc123", name "qta both parent and add on", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "enterprise bundle", uom "license/month", quantity 300, pricetags \[{ code "headcount bucket" }], addons \[ { productsku "addon storage", uom "gb/month", quantity 100, pricetags \[{ code "storage volume tier" }] } ] } ] }; 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]; const addon = parent childrenlineitems\[0]; console log(`parent qta discount ${parent discount}%`); // tier 3 15% console log(`add on qta discount ${addon discount}%`); // tier 2 10% }) 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" "qta both parent and add on", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "enterprise bundle", "uom" "license/month", "quantity" 300, "pricetags" \[{ "code" "headcount bucket" }], "addons" \[ { "productsku" "addon storage", "uom" "gb/month", "quantity" 100, "pricetags" \[{ "code" "storage volume tier" }] } ] } ] }' the parent resolves tier 3 (quantity 300, 15% discount) and the add on resolves tier 2 (quantity 100, 10% discount) independently use case 4 qta on nested bundle qta resolution works recursively through nested bundles if a child bundle has its own qta, the engine resolves tiers at each nesting level independently const quotedata = { opportunityid "006xx000001abc123", name "nested bundle qta", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "platform suite", uom "license/month", quantity 100, pricetags \[{ code "headcount bucket" }], addons \[ { productsku "enterprise bundle", uom "license/month", quantity 50, pricetags \[{ code "headcount bucket" }], addons \[ { productsku "addon support", uom "license/month", quantity 1 } ] } ] } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log(`top level bundle discount ${result quotelineitems\[0] 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" "nested bundle qta", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "platform suite", "uom" "license/month", "quantity" 100, "pricetags" \[{ "code" "headcount bucket" }], "addons" \[ { "productsku" "enterprise bundle", "uom" "license/month", "quantity" 50, "pricetags" \[{ "code" "headcount bucket" }], "addons" \[ { "productsku" "addon support", "uom" "license/month", "quantity" 1 } ] } ] } ] }' each level in the bundle hierarchy resolves its own qta tier platform suite at quantity 100 (tier 2 10%) and enterprise bundle at quantity 50 (tier 1 0%) use case 5 auto attached qta via productpricedimension when a productpricedimension record links a qta to a product, the qta is automatically applied during pricing without any explicit reference in the api request the engine discovers the qta configuration from the product's metadata this means the api request looks the same as a standard quote the qta discount is applied behind the scenes const quotedata = { opportunityid "006xx000001abc123", name "auto attached qta", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "volume license", uom "user/month", quantity 400 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { const line = result quotelineitems\[0]; console log(`auto attached qta discount ${line discount}%`); console log(`list price $${line listtotalprice}`); console log(`total price $${line 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" "auto attached qta", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "volume license", "uom" "user/month", "quantity" 400 } ] }' no pricetags are needed in the request the engine detects the qta link via productpricedimension and applies the tier 3 discount (15%) automatically for quantity 400 use case 6 qta + discretionary discount stacking qta discounts are system level discounts you can stack an explicit discretionary discount on top of the qta resolved discount the pricing engine applies the qta discount first (as a system discount), then applies the discretionary discount to the resulting subtotal pricing formula with stacking listprice x quantity x term = listtotal > listtotal x (1 qtadiscount/100) = subtotal > subtotal x (1 discretionarydiscount/100) = totalprice const quotedata = { opportunityid "006xx000001abc123", name "qta + discretionary discount", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "volume license", uom "user/month", quantity 400, discount 5 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { const line = result quotelineitems\[0]; console log(`qta system discount resolved from tier`); console log(`discretionary discount ${line discount}%`); console log(`list total $${line listtotalprice}`); console log(`final total $${line 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" "qta + discretionary discount", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "volume license", "uom" "user/month", "quantity" 400, "discount" 5 } ] }' the auto attached qta resolves tier 3 (15% system discount) for quantity 400 the explicit 5% discretionary discount stacks on top, resulting in an effective combined discount how qta interacts with other discounts discount type applied by stacking order override behavior qta system discount pricing engine (automatic) applied first cannot be overridden by request discretionary line discount discount field on product applied after qta stacks on top of qta header discount discount field on quote root applied after qta stacks on top of qta; overridden by line discount price tag discount pricetags on product applied alongside qta both evaluate independently key behaviors behavior description auto discovery qta linked via productpricedimension is applied automatically independent resolution each product resolves its own qta tier independently system discount qta discounts are treated as system level discounts, not discretionary stacking discretionary discounts stack on top of qta discounts nested support qta works at any nesting level within bundle hierarchies null max quantity the highest tier can use null as max quantity for open ended brackets price tag delivery qta tiers can be referenced via pricetags with the tier code