Guides and Examples
...
Quotes
Create Quote Overview
16 min
create quote overview the nue cpq quote api provides rest endpoints for programmatically creating fully priced quotes with the same pricing fidelity as the nue ui use the cpq rest api when you need to build quotes outside of the nue application for example, from a custom storefront, a partner portal, an ai agent, or any backend integration that requires real time pricing if you are working with post quote lifecycle operations such as order activation, subscription management, or asset tracking, use the / /lifecycle%20manager/orders/orders%20overview\ mdx instead the cpq rest api is focused on quote creation and pricing endpoints endpoint method description /cpq/quotes post create and persist a quote (commit mode) /cpq/quotes\ preview post preview a quote without persisting (dry run mode) /cpq/quotes/{quoteid} get retrieve a quote's json representation how it works when you submit a create quote request, the pricing engine performs the following steps product resolution finds products by sku or name, resolves the correct price book entry based on uom, currency, and pricing attributes bundle expansion automatically includes bundled items, auto populates required add ons, resolves dynamic product options pricing engine execution calculates the full pricing formula chain listprice x quantity x term = listtotal , then applies system discounts and discretionary discounts to arrive at the final total price discount propagation applies header level discounts to all undiscounted lines, propagates parent level discounts to children, respects explicit overrides price tag evaluation evaluates tiered, volume, and ramp price/discount tags; applies auto attached tags from product configuration validation enforces business rules and returns structured error messages or warnings key concepts preview vs commit the cpq api supports two modes with identical request bodies mode endpoint persists to database quote id in response preview (dry run) post /cpq/quotes\ preview no null commit post /cpq/quotes yes returns a uuid preview mode runs the full pricing engine but writes nothing to the database use it for pricing previews, what if scenarios, and validation commit mode runs the same engine and persists the result see docid 0jq3sd3mi6ejhjc69ovik for detailed examples product identification products are identified by sku and unit of measure (uom) the sku resolves the product, and the uom resolves the specific price book entry that determines the list price sku + uom (recommended) { "productsku" "nue platform", "uom" "user/month" } name + uom { "productname" "nue platform", "uom" "user/month" } price book entry id { "pricebookentryid" "pbe 001" } when both productsku and productname are provided, the sku is used for product resolution pricing formula the pricing engine applies the following formula for recurring products listtotal = listprice x quantity x term subtotal = listtotal systemdiscount total = subtotal discretionarydiscount one time products use listtotal = listprice x quantity (no term multiplier) prerequisites before creating quotes, ensure you have a valid nue api key with quote creation permissions an opportunity id to associate with the quote products published to your price book with price book entries knowledge of product skus and their units of measure (uom) authentication all cpq operations require authentication using your nue api key in the nue api key header const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); minimal example preview a quote 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 2026 platform license", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 10 } ] }' const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); const quotedata = { opportunityid "006xx000001abc123", name "q1 2026 platform license", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptiontermdimension "month", subscriptionterm 12, products \[ { productsku "nue platform", 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 => { console log('quote preview ', result); console log(`total amount $${result data quote totalamount}`); console log(`line items ${result data quotelineitems length}`); // quote id is null in preview mode }) catch(error => console log('error ', error)); minimal example commit a quote to persist the quote, use the /cpq/quotes endpoint (without \ preview ) the request body is identical curl x post 'https //api nue io/cpq/quotes' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "opportunityid" "006xx000001abc123", "name" "q1 2026 platform license", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptiontermdimension" "month", "subscriptionterm" 12, "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 10 } ] }' fetch('https //api nue io/cpq/quotes', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log(`quote id ${result data quote id}`); // non null quote is persisted console log(`total amount $${result data quote totalamount}`); }) catch(error => console log('error ', error)); request structure the create quote request body has three main sections quote header fields field type required description opportunityid string yes the opportunity id to associate with the quote name string yes the quote name subscriptionstartdate date yes start date (yyyy mm dd) subscriptionenddate date no end date; calculated from term if not provided subscriptionterm number yes term length (e g , 12 for 12 months) subscriptiontermdimension string no "month" (default) or "year" pricebookid string no price book id; uses system default if omitted discount number no header level discount percentage (0 100) discountamount number no header level discount as fixed amount billingperiod string no "monthly" , "quarterly" , "semi annually" , "annually" billingtiming string no "in advance" or "in arrears" autorenew boolean no auto renew setting for all products currencyisocode string no iso currency code for multi currency orgs pricetags array no quote level price/discount tags product input fields field type required description productsku string yes product sku (either sku or name required) productname string yes product name (alternative to sku) uom string conditional unit of measure; required if pricebookentryid is not provided quantity number no product quantity (defaults vary by product) startdate date no product start date; defaults to quote start date enddate date no product end date subscriptionterm number no per product term override discount number no line level discount percentage (0 100) discountamount number no line level discount amount billingperiod string no per product billing period override billingtiming string no per product billing timing override autorenew boolean no per product auto renew override evergreen boolean no whether the product is evergreen renewalterm number no renewal term override pricetags array no line level price/discount tags addons array no add on products for bundles (recursive productinput) custompricingattributes array no custom attributes for multi attribute pbe resolution price tag input field type required description code string one of code/id the price tag code id string one of code/id the price tag id response structure the response wraps results in a status and data envelope { "status" "succeed", "data" { "quote" { }, "quotelineitems" \[ ] }, "warnings" \[] } data quote the quote header object with all calculated pricing fields data quotelineitems array of line items; bundle children are nested in childrenlineitems for preview requests, data quote id is null for commit requests, data quote id contains the persisted quote id guide articles article description docid 0jq3sd3mi6ejhjc69ovik understand the difference between dry run and commit modes docid\ iupfrldiwgoehemeyadpb create quotes with simple standalone products docid\ fri8qggg2m1jvpi qlnvi work with bundle products and add ons docid\ y9awhgt5iyiblymwve6nx apply header, parent, and line level discounts docid\ plcj0tpent2lihn0h6qgj configure quantity based pricing tiers