Guides and Examples
...
Quotes
Quote Data Reference
32 min
quote data reference this page provides a complete field reference for the nue cpq create quote api, covering all request fields, response fields, error codes, warning codes, and pricing behavior rules 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) both endpoints accept the same request body and return the same response structure the only difference is that preview mode returns null for quote id and does not persist data authentication const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); curl x post 'https //api nue io/cpq/quotes\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ }' request body fields (createquoterequest) these are the top level fields accepted in the request body the request is a flat json object with quote header fields at the top level and a products array field type required default description opportunityid string yes the opportunity id to associate with the quote name string yes the quote name subscriptionstartdate date yes start date in yyyy mm dd format subscriptionenddate date no calculated from term end date in yyyy mm dd format subscriptionterm number yes term length (e g , 12 for 12 months) subscriptiontermdimension string no "month" "month" or "year" pricebookid string no system default the price book id to use for pricing discount number no 0 header level discount percentage (0 100) discountamount number no 0 header level fixed discount amount billingperiod string no product default "monthly" , "quarterly" , "semi annually" , "annually" billingtiming string no product default "in advance" or "in arrears" autorenew boolean no product default auto renewal setting for all products currencyisocode string no org default iso 4217 currency code (e g , "usd" , "eur" ) pricetags array no \[] quote level price/discount tags (array of pricetaginput) products array yes array of addquoteproductrequest objects (at least one required) any additional top level fields beyond those listed above are treated as custom fields and stored on the quote header custom field names must match the api field names on your quote object (e g , ruby customtext c ) addquoteproductrequest fields each entry in the products array (and recursively in addons ) accepts these fields field type required default description productsku string yes product sku (either sku or name required) productname string yes product name (alternative to sku) pricebookentryid string no direct pbe id (bypasses sku/uom resolution) uom string conditional unit of measure; required if pricebookentryid is not provided quantity number no product default product quantity startdate date no quote start date per product start date ( yyyy mm dd ) enddate date no calculated per product end date ( yyyy mm dd ) subscriptionterm number no quote term per product term override subscriptiontermdimension string no quote dimension per product term dimension override discount number no 0 line level discount percentage (0 100) discountamount number no 0 line level fixed discount amount billingperiod string no quote/product default "monthly" , "quarterly" , "semi annually" , "annually" billingtiming string no quote/product default "in advance" or "in arrears" autorenew boolean no quote/product default per product auto renew override evergreen boolean no false whether the subscription is evergreen (no end date) renewalterm number no same as term renewal term override pricetags array no \[] line level price/discount tags (array of pricetaginput) addons array no \[] add on products for bundles (recursive addquoteproductrequest) custompricingattributes array no \[] custom attributes for multi attribute pbe resolution either productsku or productname is required if both are provided, sku takes precedence for product resolution pricetaginput fields price tags are referenced by code or by id at least one of the two fields must be provided field type required description code string one of code/id the price tag code defined in the catalog (e g , "volume discount" ) id string one of code/id the price tag record id (e g , "a1b2c3d4e5f6g7h8" ) example { "pricetags" \[ { "code" "volume discount" }, { "id" "a1b2c3d4e5f6g7h8" } ] } custompricingattribute fields custom pricing attributes enable multi attribute pbe resolution when a product has multiple pbes differentiated by custom fields field type required description name string yes the api field name of the pricing attribute on the pbe (e g , ruby pricingattribute 1 c ) value string yes the value to match against the pbe field example { "custompricingattributes" \[ { "name" "ruby pricingattribute 1 c", "value" "technology partner" }, { "name" "ruby pricingattribute 2 c", "value" "enterprise" } ] } when multiple attributes are provided, the engine uses and logic all attributes must match for a pbe to be selected response structure (createquoteresponse) the response wraps results in a status envelope { "status" "succeed", "data" { "quote" { }, "quotelineitems" \[ ] }, "errors" \[], "warnings" \[] } field type description status string "succeed" or "failed" data object/null contains quote and quotelineitems on success; null on failure errors array array of error message objects (empty on success) warnings array array of warning message objects (may be present on success) quotedata fields (response) the data quote object in the response contains these fields field type description id string/null quote uuid (commit mode) or null (preview mode) name string quote name opportunityid string associated opportunity id totalamount number final calculated total after all discounts listamount number total list price before discounts discount number applied header discount percentage discountamount number applied header discount amount subscriptionstartdate date quote start date subscriptionenddate date quote end date subscriptionterm number subscription term length subscriptiontermdimension string term dimension ( "month" or "year" ) billingperiod string billing period billingtiming string billing timing autorenew boolean auto renewal setting currencyisocode string currency code pricebookid string price book id used for pricing status string quote status createddate datetime creation timestamp (commit only) lastmodifieddate datetime last modification timestamp (commit only) any custom fields included in the request body also appear on the quote object in the response quotelineitemdto fields (response) each entry in the data quotelineitems array contains these fields bundle children appear in the childrenlineitems array within the parent line item field type description id string/null line item uuid (commit) or null (preview) product object product details sku (string), name (string), id (string) quantity number product quantity listunitprice number list price per unit per billing period listtotalprice number total list price listunitprice x quantity x term totalprice number final price after all discounts discount number applied discount percentage discountamount number applied discount amount systemdiscount number system level discount (e g , from qta) startdate date line item start date enddate date line item end date subscriptionterm number line item subscription term subscriptiontermdimension string term dimension billingperiod string billing period for this line billingtiming string billing timing for this line autorenew boolean auto renewal setting evergreen boolean whether the line is evergreen renewalterm number renewal term uom string unit of measure revenuemodel string revenue model ( "recurring" , "one time" , "usage" ) childrenlineitems array nested add on quotelineitemdto objects (bundle children) pricing field relationships listunitprice from price book entry listtotalprice = listunitprice x quantity x term for recurring products listtotalprice = listunitprice x quantity for one time products totalprice = listtotalprice x (1 systemdiscount/100) x (1 discount/100) message fields (errors and warnings) both error and warning objects share this structure field type description code string machine readable error or warning code message string human readable description of the issue field string the field that caused the issue (when applicable) error code reference error code http status description missing parameter 400 a required parameter is missing from the request quote name required 400 the name field is missing or empty quote opportunityid required 400 the opportunityid field is missing or empty quote subscriptionterm invalid 400 the subscriptionterm is zero, negative, or not a number product sku or name required 400 a product entry has neither productsku nor productname product quantity invalid 400 the quantity is zero, negative, or not a number product billingperiod invalid 400 the billingperiod value is not one of monthly , quarterly , semi annually , annually product billingtiming invalid 400 the billingtiming value is not one of in advance , in arrears product renewalterm invalid 400 the renewalterm is zero, negative, or not a number product subscriptionterm invalid 400 a per product subscriptionterm override is invalid invalid input 400 general invalid input (e g , nonexistent sku, malformed json) invalid addon product 400 the specified add on is not a valid option for the parent bundle pricebook entry mismatch 400 no pbe found matching the given sku + uom + currency + pricing attributes business logic error 400 a business rule was violated (e g , conflicting configurations) warning code reference warning code description duplicate price tag the same price tag was specified more than once on a product; deduplicated product discount applied discount percentage takes precedence over discount amount on a product header discount applied header level discount percentage takes precedence over header discount amount product discount overrides header a product level discount overrides the header level discount for that line default value applied a default value was applied for a missing optional field pricing formula the pricing engine calculates prices using the following formula chain recurring products listtotalprice = listunitprice x quantity x term subtotal = listtotalprice x (1 systemdiscount / 100) totalprice = subtotal x (1 discount / 100) one time products listtotalprice = listunitprice x quantity subtotal = listtotalprice x (1 systemdiscount / 100) totalprice = subtotal x (1 discount / 100) fixed amount discount (alternative) when discountamount is used instead of discount totalprice = listtotalprice discountamount default values field default when omitted subscriptiontermdimension "month" quantity product specific default (typically 1) discount 0 (no discount) discountamount 0 (no discount) startdate (product) quote subscriptionstartdate enddate (product) calculated from start date + term billingperiod product configuration default billingtiming product configuration default autorenew product configuration default evergreen false currencyisocode org default currency pricebookid system default price book fallback logic scenario behavior subscriptionenddate omitted calculated as subscriptionstartdate + subscriptionterm product startdate omitted falls back to quote subscriptionstartdate product subscriptionterm omitted falls back to quote subscriptionterm product billingperiod omitted falls back to quote billingperiod , then product default product billingtiming omitted falls back to quote billingtiming , then product default product autorenew omitted falls back to quote autorenew , then product default pricebookid omitted uses the system default price book currencyisocode omitted uses the org's default currency discount propagation rules rule behavior header discount to lines applied to all lines without their own explicit discount parent discount to children propagated to bundle children without their own explicit discount explicit line discount overrides header discount for that specific line explicit add on discount overrides parent discount for that specific add on percentage vs amount conflict percentage takes precedence; amount is ignored (warning returned) system discount + discretionary stack multiplicatively listprice x (1 systemdiscount) x (1 discretionarydiscount) header discountamount distribution fixed amount is distributed proportionally across eligible lines by list amount ratio validation constraints constraint rule name required; cannot be empty opportunityid required; must reference a valid opportunity subscriptionterm required; must be a positive number products required; array must contain at least one item discount range must be between 0 and 100 (inclusive) discount vs discountamount mutually exclusive when both are non zero; percentage takes precedence with warning billingperiod values "monthly" , "quarterly" , "semi annually" , "annually" billingtiming values "in advance" , "in arrears" subscriptiontermdimension values "month" , "year" product identification either productsku / productname or pricebookentryid required uom required when pricebookentryid is not provided add on validation add on products must be valid options for the parent bundle currency pbe every product must have a pbe in the requested currency