Guides and Examples
...
Quotes
Validation Errors
31 min
validation errors the nue cpq quote api returns structured error and warning responses when a request fails validation or contains conditions that merit attention understanding these codes helps you build robust integrations that handle edge cases gracefully error response format validation errors follow a consistent structure { "status" "failed", "data" null, "errors" \[ { "code" "quote name required", "message" "quote name is required", "field" "name" } ], "warnings" \[] } successful responses that include warnings { "status" "succeed", "data" { "quote" { }, "quotelineitems" \[ ] }, "errors" \[], "warnings" \[ { "code" "product discount applied", "message" "discount percentage takes precedence over discount amount", "field" "discount" } ] } message fields 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) authentication const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); scenario 1 missing quote name the name field is required on every quote request const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); const quotedata = { opportunityid "006xx000001abc123", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, products \[ { productsku "nue on salesforce", 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('errors ', result errors); // \[{ code "quote name required", message "quote name is required", field "name" }] }) 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", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 } ] }' error code quote name required scenario 2 missing opportunity id the opportunityid field is required to associate the quote with a sales opportunity returns http 400 const quotedata = { name "missing opportunity quote", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, products \[ { productsku "nue on salesforce", 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('errors ', result errors); // \[{ code "quote opportunityid required", message "opportunity id is required" }] }) 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 '{ "name" "missing opportunity quote", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 } ] }' error code quote opportunityid required scenario 3 negative or zero subscription term the subscriptionterm must be a positive number const quotedata = { opportunityid "006xx000001abc123", name "negative term quote", subscriptionstartdate "2026 01 01", subscriptionterm 6, products \[ { productsku "nue on salesforce", 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('errors ', result errors); // \[{ code "quote subscriptionterm invalid", message "subscription term must be a positive number" }] }) 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" "negative term quote", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 6, "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 } ] }' error code quote subscriptionterm invalid scenario 4 empty or null products list the products array must contain at least one product const quotedata = { opportunityid "006xx000001abc123", name "empty products quote", subscriptionstartdate "2026 01 01", subscriptionterm 12, products \[] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log('errors ', result errors); // \[{ code "missing parameter", message "at least one product is required" }] }) 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" "empty products quote", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[] }' error code missing parameter scenario 5 nonexistent sku if the provided sku does not match any product in the catalog, the api returns an error const quotedata = { opportunityid "006xx000001abc123", name "bad sku quote", subscriptionstartdate "2026 01 01", subscriptionterm 12, products \[ { productsku "nonexistent sku", 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('errors ', result errors); // \[{ code "invalid input", message "product not found with sku nonexistent sku" }] }) 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" "bad sku quote", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nonexistent sku", "uom" "user/month", "quantity" 10 } ] }' error code invalid input scenario 6 wrong uom each product has a defined set of valid units of measure using an invalid uom triggers an 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" "wrong uom quote", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nue on salesforce", "uom" "gb/month", "quantity" 10 } ] }' error code pricebook entry mismatch no price book entry found for product nue on salesforce with uom gb/month scenario 7 mix of valid and invalid products (partial failure) when one product in the products array is invalid, the entire quote request fails there is no partial success const quotedata = { opportunityid "006xx000001abc123", name "mixed valid/invalid products", subscriptionstartdate "2026 01 01", subscriptionterm 12, products \[ { productsku "nue on salesforce", uom "user/month", quantity 10 }, { productsku "nonexistent sku", uom "user/month", quantity 5 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { // the entire request fails even the valid product is not priced console log('status ', result status); // "failed" console log('errors ', result errors); }) 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" "mixed valid/invalid products", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 }, { "productsku" "nonexistent sku", "uom" "user/month", "quantity" 5 } ] }' error code invalid input the error identifies the invalid product fix all product issues and resubmit the entire request scenario 8 invalid billing period the billingperiod field only accepts specific values monthly , quarterly , semi annually , annually 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" "invalid billing period", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "billingperiod" "weekly", "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 } ] }' error code product billingperiod invalid valid values are monthly , quarterly , semi annually , annually scenario 9 invalid billing timing the billingtiming field only accepts "in advance" or "in arrears" 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" "invalid billing timing", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "billingtiming" "on delivery", "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 } ] }' error code product billingtiming invalid valid values are in advance , in arrears scenario 10 invalid add on product if a product specified as an add on is not a valid option for the parent bundle, the api returns an error const quotedata = { opportunityid "006xx000001abc123", name "invalid add on", subscriptionstartdate "2026 01 01", subscriptionterm 12, products \[ { productsku "enterprise bundle", uom "license/month", quantity 10, addons \[ { productsku "unrelated product", uom "unit/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('errors ', result errors); // \[{ code "invalid addon product", message "product unrelated product is not a valid option for bundle enterprise bundle" }] }) 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" "invalid add on", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "enterprise bundle", "uom" "license/month", "quantity" 10, "addons" \[ { "productsku" "unrelated product", "uom" "unit/month", "quantity" 1 } ] } ] }' error code invalid addon product scenario 11 both discount percentage and amount on same product (warning) when both discount (percentage) and discountamount are provided on the same product, the percentage takes precedence the api returns a warning but processes the request successfully const quotedata = { opportunityid "006xx000001abc123", name "dual discount product", subscriptionstartdate "2026 01 01", subscriptionterm 12, products \[ { productsku "nue on salesforce", uom "user/month", quantity 10, discount 10, discountamount 500 } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log('status ', result status); // "succeed" console log('warnings ', result warnings); // \[{ code "product discount applied", message "discount percentage takes precedence over discount amount" }] const line = result quotelineitems\[0]; console log(`applied discount ${line discount}%`); // 10% (percentage wins) }) 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" "dual discount product", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10, "discount" 10, "discountamount" 500 } ] }' warning code product discount applied the 10% discount is used; the $500 discountamount is ignored scenario 12 currency mismatch when currencyisocode is set but a product does not have a pbe in that currency, the request fails 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" "currency mismatch", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "currencyisocode" "gbp", "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 } ] }' error code pricebook entry mismatch no pbe found for product nue on salesforce with currency gbp scenario 13 duplicate price tag (warning) if the same price tag is applied more than once to a product, the api deduplicates it and returns a warning const quotedata = { opportunityid "006xx000001abc123", name "duplicate price tag", subscriptionstartdate "2026 01 01", subscriptionterm 12, products \[ { productsku "nue on salesforce", uom "user/month", quantity 10, pricetags \[ { code "volume discount" }, { code "volume discount" } ] } ] }; fetch('https //api nue io/cpq/quotes\ preview', { method 'post', headers myheaders, body json stringify(quotedata) }) then(response => response json()) then(result => { console log('status ', result status); // "succeed" console log('warnings ', result warnings); // \[{ code "duplicate price tag", message "duplicate price tag volume discount was deduplicated" }] }) 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" "duplicate price tag", "subscriptionstartdate" "2026 01 01", "subscriptionterm" 12, "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10, "pricetags" \[ { "code" "volume discount" }, { "code" "volume discount" } ] } ] }' warning code duplicate price tag the tag is applied only once always ensure each price tag is specified only once per product 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 the valid options product billingtiming invalid 400 the billingtiming value is not one of the valid options 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 request) invalid addon product 400 the specified add on is not a valid option for the parent bundle pricebook entry mismatch 400 no pbe found for 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; 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 best practices for error handling always check status look for "succeed" or "failed" in the response status field inspect errors array each error object contains a code , message , and optionally a field check warnings array warnings indicate non fatal conditions that may affect pricing log error codes use the machine readable code for programmatic error handling, not the message use preview mode first validate quote configurations in preview before committing handle all products a single invalid product fails the entire request; validate all products before submitting handle 429 responses implement exponential backoff retry logic for rate limited requests