Guides and Examples
...
Orders
Create Order
24 min
create order this guide covers creating orders using the nue cpq order api the create order endpoint ( post /cpq/orders ) creates an order in draft status after activation, subscriptions, assets, and entitlements are provisioned automatically products are identified by productsku + uom , and the pricing engine resolves list prices, discounts, and totals the same way create quote works for change orders that modify existing subscriptions, see docid\ flrvjtt xsk2gyx2nx96a all examples below use the commit endpoint ( post /cpq/orders ) to preview an order without persisting, replace the url with https //api nue io/cpq/orders\ preview the request body is identical for both modes authentication const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); example products the examples in this guide reference the following products from the nue test catalog product sku uom list price revenue model nue platform nue platform user/month $15 00 recurring nue on salesforce nue on salesforce user/month $29 90 recurring implementation service implementation service hour $250 00 one time bundles bundle sku uom list price description nue gem edition nue gem edition user/month $0 00 mid tier bundle with required + bundled options bundle components component sku uom list price option type nue platform nue platform user/month $15 00 bundled (auto included) nue on salesforce nue on salesforce user/month $29 90 bundled (auto included) cpq module cpq module user/month $10 00 required (auto included) billing module billing module user/month $12 00 required (auto included) implementation service implementation service hour $250 00 optional (specify in addons) nue platform nue platform user/month $15 00 optional (specify in addons) usb security key usb security key each $45 00 optional (specify in addons) key behaviors behavior details product identification products are identified by productsku + uom , the same as create quote the pricing engine resolves the price book entry and calculates pricing pricing formula (recurring) listprice x quantity x term = listtotal pricing formula (one time) listprice x quantity = listtotal order status orders are created in draft status activation is a separate operation end date convention the api uses inclusive end dates a 12 month term starting 2026 01 01 results in subscriptionenddate of 2026 12 31 , not 2027 01 01 preview mode use post /cpq/orders\ preview for a dry run that returns the priced order without persisting bundle handling bundles auto expand bundled and required items optional add ons are specified via the addons array, identical to create quote use case 1 basic order creation ( post /cpq/orders ) create an order with a single recurring product you must provide the customerid , subscriptionstartdate , and at least one product with its productsku and uom the pricebookid is optional if omitted, the org's active standard price book is used request body { "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 10 } ] } curl curl x post 'https //api nue io/cpq/orders' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 10 } ] }' javascript fetch const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); const orderdata = { customerid "001xx000003abc123", pricebookid "01sxx000001abc123", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, subscriptiontermdimension "month", products \[ { productsku "nue platform", uom "user/month", quantity 10 } ] }; fetch('https //api nue io/cpq/orders', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order status ${result order status}`); console log(`order products ${result orderproducts length}`); }) catch(error => console log('error ', error)); the order is created in draft status the pricing engine resolves the list price from the price book entry matching nue platform + user/month after activation, subscriptions, assets, and entitlements are provisioned use case 2 multiple products add multiple products to the products array each product resolves independently against the price book recurring and one time products can be mixed in the same order request body { "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 }, { "productsku" "nue platform", "uom" "user/month", "quantity" 5 }, { "productsku" "implementation service", "uom" "hour", "quantity" 20 } ] } curl curl x post 'https //api nue io/cpq/orders' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 10 }, { "productsku" "nue platform", "uom" "user/month", "quantity" 5 }, { "productsku" "implementation service", "uom" "hour", "quantity" 20 } ] }' javascript fetch const orderdata = { customerid "001xx000003abc123", pricebookid "01sxx000001abc123", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, subscriptiontermdimension "month", products \[ { productsku "nue on salesforce", uom "user/month", quantity 10 }, { productsku "nue platform", uom "user/month", quantity 5 }, { productsku "implementation service", uom "hour", quantity 20 } ] }; fetch('https //api nue io/cpq/orders', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order products ${result orderproducts length}`); // 3 }) catch(error => console log('error ', error)); recurring products are priced at listprice x quantity x term one time products are priced at listprice x quantity (no term multiplier) use case 3 order with bundles bundle products are added the same way as in create quote the pricing engine auto expands bundled and required items optional add ons are specified via the addons array request body { "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue gem edition", "uom" "user/month", "quantity" 10, "addons" \[ { "productsku" "implementation service", "uom" "hour", "quantity" 20 } ] } ] } curl curl x post 'https //api nue io/cpq/orders' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue gem edition", "uom" "user/month", "quantity" 10, "addons" \[ { "productsku" "implementation service", "uom" "hour", "quantity" 20 } ] } ] }' javascript fetch const orderdata = { customerid "001xx000003abc123", pricebookid "01sxx000001abc123", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, subscriptiontermdimension "month", products \[ { productsku "nue gem edition", uom "user/month", quantity 10, addons \[ { productsku "implementation service", uom "hour", quantity 20 } ] } ] }; fetch('https //api nue io/cpq/orders', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order products ${result orderproducts length}`); }) catch(error => console log('error ', error)); the bundle auto expands its bundled items (nue platform, nue on salesforce) and required items (cpq module, billing module) the implementation service optional add on is included because it is specified in the addons array use case 4 order with billing options control billing behavior by specifying billingperiod at the order level or on individual products request body { "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "billingperiod" "month", "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 25, "billingperiod" "month", "billingtiming" "in advance" } ] } curl curl x post 'https //api nue io/cpq/orders' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "billingperiod" "month", "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 25, "billingperiod" "month", "billingtiming" "in advance" } ] }' javascript fetch const orderdata = { customerid "001xx000003abc123", pricebookid "01sxx000001abc123", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, subscriptiontermdimension "month", billingperiod "month", products \[ { productsku "nue platform", uom "user/month", quantity 25, billingperiod "month", billingtiming "in advance" } ] }; fetch('https //api nue io/cpq/orders', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order products ${result orderproducts length}`); }) catch(error => console log('error ', error)); use case 5 preview order ( post /cpq/orders\ preview ) use the preview endpoint to validate your payload and inspect pricing without creating the order the request body is identical to the commit endpoint curl curl x post 'https //api nue io/cpq/orders\ preview' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "pricebookid" "01sxx000001abc123", "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "subscriptiontermdimension" "month", "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 10 } ] }' javascript fetch const orderdata = { customerid "001xx000003abc123", pricebookid "01sxx000001abc123", subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, subscriptiontermdimension "month", products \[ { productsku "nue platform", uom "user/month", quantity 10 } ] }; fetch('https //api nue io/cpq/orders\ preview', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log('order preview ', result); }) catch(error => console log('error ', error)); preview mode runs the full pricing engine but writes nothing to the database use it for pricing previews, validation, and what if scenarios before committing request reference order header fields field type required description customerid string yes the customer account id pricebookid string no the price book id to use for the order if omitted, defaults to the org's active standard price book recommended when using custom price books subscriptionstartdate date yes subscription start date (yyyy mm dd) subscriptionenddate date no subscription end date; calculated from start date + term if not provided the api uses an inclusive end date, so a 12 month term starting 2026 01 01 results in an end date of 2026 12 31 subscriptionterm number no subscription term length (e g , 12 for 12 months) subscriptiontermdimension string no "month" or "year" billingperiod string no billing period month , quarter , semi annual , annual billcycleday string no day of the month the billing cycle starts billingaccountid string no the billing account id currencyisocode string no iso currency code for multi currency orgs autorenew boolean no auto renew setting for all products paymentterm string no invoice payment schedule description string no order description products array yes list of products to add to the order pricetags array no order 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 per product start date override enddate date no per product end date override subscriptionterm number no per product term override discount number no discretionary discount percentage (0 100) discountamount number no discretionary discount amount billingperiod string no per product billing period override billingtiming string no per product billing timing in advance or in arrears 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 optional add on products for bundles (recursive productinput) custompricingattributes array no custom attributes for multi attribute pbe resolution response reference the response contains the created order and its order products response fields field type description order object the order header record order id string the order id ( null in preview mode) order status string order status ( draft for committed orders, null for previews) order totalamount number total order amount calculated by the pricing engine order subscriptionstartdate date subscription start date order subscriptionenddate date subscription end date (inclusive see end date convention above) orderproducts array array of order product records orderproducts\[] productname string resolved product name orderproducts\[] quantity number product quantity orderproducts\[] listprice number unit list price resolved from the price book entry orderproducts\[] totalprice number total price for this line orderproducts\[] childrenorderproducts array child order products for bundle items summary use case products key concept 1 basic order nue platform x 10 sku + uom identification, pricing engine resolution 2 multiple products recurring + one time multiple products in one order 3 bundles nue gem edition + implementation service add on auto expansion, addons for optional items 4 billing options nue platform with billing overrides per product billing period and timing 5 preview nue platform via \ preview dry run pricing without persisting