Guides and Examples
...
Orders
Create Order
25 min
create order this guide covers creating orders and change orders using the nue cpq order apis the create order endpoint ( post /cpq/create order ) creates and activates an order in a single call, provisioning subscriptions, assets, and entitlements automatically the change order endpoint ( post /cpq/change order ) modifies existing subscriptions through renewals, quantity changes, cancellations, upgrades, and more unlike the create quote api, which uses product sku + uom and relies on the pricing engine to resolve everything, the create order api requires explicit pricebookentryid values and pre calculated pricing fields such as salesprice and totalprice authentication const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); create order ( post /cpq/create order ) use case 1 basic order creation create an order with a single recurring product you must provide the customerid , effectivedate , pricebookid , and at least one order product with its pricebookentryid and pricing details const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); const orderdata = { customerid "001xx000003abc123", effectivedate "2026 01 01", pricebookid "01sxx000001abc123", orderproducts \[ { productid "prod 001 nue platform", pricebookentryid "pbe 001 nue platform user month", quantity 10, subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, uomid "uom user month", salesprice 29 90, totalprice 3588 00 } ] }; fetch('https //api nue io/cpq/create order', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order id ${result id}`); console log(`order status ${result order status}`); console log(`order products ${result orderproducts length}`); console log(`subscriptions ${result subscriptions length}`); console log(`assets ${result assets length}`); console log(`entitlements ${result entitlements length}`); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/create order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "effectivedate" "2026 01 01", "pricebookid" "01sxx000001abc123", "orderproducts" \[ { "productid" "prod 001 nue platform", "pricebookentryid" "pbe 001 nue platform user month", "quantity" 10, "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "uomid" "uom user month", "salesprice" 29 90, "totalprice" 3588 00 } ] }' the response includes the created order, order products, subscriptions, assets, and entitlements since activateorder defaults to true , the order is activated immediately and all downstream records are provisioned use case 2 order with bundles bundle products are represented as a parent order product with nested childrenorderproducts each child product requires its own pricebookentryid and pricing const orderdata = { customerid "001xx000003abc123", effectivedate "2026 01 01", pricebookid "01sxx000001abc123", orderproducts \[ { productid "prod 010 enterprise suite", pricebookentryid "pbe 010 enterprise suite", quantity 1, subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, uomid "uom suite year", salesprice 999 00, totalprice 999 00, childrenorderproducts \[ { productid "prod 011 platform addon", pricebookentryid "pbe 011 platform addon", quantity 10, subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, uomid "uom user month", salesprice 9 90, totalprice 1188 00 }, { productid "prod 012 storage addon", pricebookentryid "pbe 012 storage addon", quantity 5, subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, uomid "uom gb month", salesprice 2 00, totalprice 120 00 } ] } ] }; fetch('https //api nue io/cpq/create order', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order id ${result id}`); result orderproducts foreach(op => { console log(` parent ${op productname}, total $${op totalprice}`); if (op childrenorderproducts) { op childrenorderproducts foreach(child => { console log(` child ${child productname}, qty ${child quantity}, total $${child totalprice}`); }); } }); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/create order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "effectivedate" "2026 01 01", "pricebookid" "01sxx000001abc123", "orderproducts" \[ { "productid" "prod 010 enterprise suite", "pricebookentryid" "pbe 010 enterprise suite", "quantity" 1, "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "uomid" "uom suite year", "salesprice" 999 00, "totalprice" 999 00, "childrenorderproducts" \[ { "productid" "prod 011 platform addon", "pricebookentryid" "pbe 011 platform addon", "quantity" 10, "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "uomid" "uom user month", "salesprice" 9 90, "totalprice" 1188 00 }, { "productid" "prod 012 storage addon", "pricebookentryid" "pbe 012 storage addon", "quantity" 5, "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "uomid" "uom gb month", "salesprice" 2 00, "totalprice" 120 00 } ] } ] }' in the response, bundle subscriptions are nested similarly the parent subscription includes childrensubscriptions for each add on component use case 3 order with billing options control billing behavior by specifying billingperiod and billingtiming at the order level or on individual order products const orderdata = { customerid "001xx000003abc123", effectivedate "2026 01 01", pricebookid "01sxx000001abc123", billingperiod "monthly", orderproducts \[ { productid "prod 001 nue platform", pricebookentryid "pbe 001 nue platform user month", quantity 25, subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, uomid "uom user month", salesprice 29 90, totalprice 8970 00, billingperiod "monthly", billingtiming "in advance" } ] }; fetch('https //api nue io/cpq/create order', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order id ${result id}`); console log(`subscriptions ${result subscriptions length}`); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/create order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "effectivedate" "2026 01 01", "pricebookid" "01sxx000001abc123", "billingperiod" "monthly", "orderproducts" \[ { "productid" "prod 001 nue platform", "pricebookentryid" "pbe 001 nue platform user month", "quantity" 25, "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "uomid" "uom user month", "salesprice" 29 90, "totalprice" 8970 00, "billingperiod" "monthly", "billingtiming" "in advance" } ] }' use case 4 order without activation set options activateorder to false to create the order in draft status subscriptions, assets, and entitlements are not provisioned until the order is activated separately const orderdata = { customerid "001xx000003abc123", effectivedate "2026 01 01", pricebookid "01sxx000001abc123", options { activateorder false }, orderproducts \[ { productid "prod 001 nue platform", pricebookentryid "pbe 001 nue platform user month", quantity 10, subscriptionstartdate "2026 01 01", subscriptionenddate "2027 01 01", subscriptionterm 12, uomid "uom user month", salesprice 29 90, totalprice 3588 00 } ] }; fetch('https //api nue io/cpq/create order', { method 'post', headers myheaders, body json stringify(orderdata) }) then(response => response json()) then(result => { console log(`order id ${result id}`); console log(`order status ${result order status}`); // "draft" // subscriptions, assets, and entitlements arrays will be empty console log(`subscriptions ${result subscriptions length}`); // 0 }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/create order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "customerid" "001xx000003abc123", "effectivedate" "2026 01 01", "pricebookid" "01sxx000001abc123", "options" { "activateorder" false }, "orderproducts" \[ { "productid" "prod 001 nue platform", "pricebookentryid" "pbe 001 nue platform user month", "quantity" 10, "subscriptionstartdate" "2026 01 01", "subscriptionenddate" "2027 01 01", "subscriptionterm" 12, "uomid" "uom user month", "salesprice" 29 90, "totalprice" 3588 00 } ] }' when activateorder is false , the response still includes the order and order products, but subscriptions , assets , and entitlements are empty arrays the order remains in draft status until activated through a separate api call change order ( post /cpq/change order ) change orders modify existing subscriptions each change order request contains an options object that controls how the change is processed and an assetchanges array that specifies which subscriptions to modify and how change order request structure { "options" { "proceedoption" "createorder", "activateorder" true, "opportunityid" "006xx000001abc123" }, "assetchanges" \[ { "assetnumber" "ast 00001", "changetype" "updatequantity", "quantity" 50 } ] } options proceedoption determines whether the change creates a new order, adds to an existing order, creates a quote, or adds to an existing quote options activateorder controls whether the resulting order is activated immediately assetchanges is an array of modifications, each targeting a specific asset by its assetnumber use case 5 update quantity increase or decrease the quantity on an existing subscription set the changetype to updatequantity and specify the new total quantity const changeorderdata = { options { proceedoption "createorder", activateorder true }, assetchanges \[ { assetnumber "ast 00001", changetype "updatequantity", quantity 50, effectivedate "2026 06 01" } ] }; fetch('https //api nue io/cpq/change order', { method 'post', headers myheaders, body json stringify(changeorderdata) }) then(response => response json()) then(result => { console log(`change order ids ${result headerobjectids}`); console log(`messages ${result messages}`); console log(`updated subscriptions ${result subscriptions? length}`); console log(`updated assets ${result assets? length}`); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/change order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "options" { "proceedoption" "createorder", "activateorder" true }, "assetchanges" \[ { "assetnumber" "ast 00001", "changetype" "updatequantity", "quantity" 50, "effectivedate" "2026 06 01" } ] }' the change order updates the subscription quantity from its current value to 50 if billing is enabled, prorated charges or credits are calculated based on the effectivedate use case 6 renew subscription extend a subscription for a new term beyond its current end date set the changetype to renew and specify the renewalterm const changeorderdata = { options { proceedoption "createorder", activateorder true }, assetchanges \[ { assetnumber "ast 00001", changetype "renew", renewalterm 12, effectivedate "2027 01 01" } ] }; fetch('https //api nue io/cpq/change order', { method 'post', headers myheaders, body json stringify(changeorderdata) }) then(response => response json()) then(result => { console log(`change order ids ${result headerobjectids}`); console log(`renewed subscriptions ${result subscriptions? length}`); result subscriptions? foreach(sub => { console log(` subscription ${sub name}, new end date ${sub subscriptionenddate}`); }); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/change order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "options" { "proceedoption" "createorder", "activateorder" true }, "assetchanges" \[ { "assetnumber" "ast 00001", "changetype" "renew", "renewalterm" 12, "effectivedate" "2027 01 01" } ] }' the renewal extends the subscription term by the specified number of months the effectivedate should typically align with the subscription's current end date use case 7 cancel subscription cancel an active subscription as of a specified effective date set the changetype to cancel const changeorderdata = { options { proceedoption "createorder", activateorder true }, assetchanges \[ { assetnumber "ast 00001", changetype "cancel", effectivedate "2026 06 01" } ] }; fetch('https //api nue io/cpq/change order', { method 'post', headers myheaders, body json stringify(changeorderdata) }) then(response => response json()) then(result => { console log(`change order ids ${result headerobjectids}`); console log(`messages ${result messages}`); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/change order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "options" { "proceedoption" "createorder", "activateorder" true }, "assetchanges" \[ { "assetnumber" "ast 00001", "changetype" "cancel", "effectivedate" "2026 06 01" } ] }' the cancellation takes effect on the effectivedate if the effective date is in the future, the subscription remains active until that date if billing is enabled, a credit may be issued for the unused portion of the current billing period use case 8 upgrade product replace the current product with a higher tier product set the changetype to upgrade and provide the targetproductid and targetpricebookentryid for the new product const changeorderdata = { options { proceedoption "createorder", activateorder true }, assetchanges \[ { assetnumber "ast 00001", changetype "upgrade", targetproductid "prod 002 nue enterprise", targetpricebookentryid "pbe 002 nue enterprise user month", effectivedate "2026 06 01" } ] }; fetch('https //api nue io/cpq/change order', { method 'post', headers myheaders, body json stringify(changeorderdata) }) then(response => response json()) then(result => { console log(`change order ids ${result headerobjectids}`); console log(`updated subscriptions ${result subscriptions? length}`); console log(`updated assets ${result assets? length}`); }) catch(error => console log('error ', error)); curl x post 'https //api nue io/cpq/change order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "options" { "proceedoption" "createorder", "activateorder" true }, "assetchanges" \[ { "assetnumber" "ast 00001", "changetype" "upgrade", "targetproductid" "prod 002 nue enterprise", "targetpricebookentryid" "pbe 002 nue enterprise user month", "effectivedate" "2026 06 01" } ] }' the upgrade cancels the existing subscription and creates a new subscription for the target product the new subscription inherits the remaining term from the original unless overridden request reference createorderrequest fields field type required description customerid string yes the customer account id effectivedate date yes the order effective date (yyyy mm dd) pricebookid string yes the price book id to use for the order billingperiod string no billing period for the order monthly , quarterly , semi annually , annually billcycleday string no day of the month the billing cycle starts description string no order description additionalattributes object no custom fields on the order (key value pairs) options object no order processing options (see checkoutoptions) orderproducts array yes list of order products to create createorderproductrequest fields field type required description productid string yes the product id pricebookentryid string yes the price book entry id that determines pricing quantity number yes quantity to order subscriptionstartdate date yes subscription start date (yyyy mm dd) subscriptionenddate date no subscription end date; calculated from start date + term if not provided subscriptionterm number yes subscription term in months uomid string no unit of measure id salesprice number yes unit sales price (pre calculated) totalprice number yes total price for this line (pre calculated) billingperiod string no per product billing period override billingtiming string no per product billing timing in advance or in arrears discount number no discount percentage (0 100) additionalattributes object no custom fields on the order product (key value pairs) childrenorderproducts array no child order products for bundle items (recursive) changeorderrequest fields field type required description options object yes change order processing options (see checkoutoptions) assetchanges array yes list of asset changes to process assetchangerequest fields field type required description assetnumber string yes the asset number of the subscription to modify changetype string yes type of change (see table below) effectivedate date no effective date of the change (yyyy mm dd) quantity number conditional new total quantity (for updatequantity ) quantitychange number conditional delta quantity change (alternative to quantity for updatequantity ) renewalterm number conditional new term in months (for renew ) targetproductid string conditional target product id (for upgrade , downgrade , swap ) targetpricebookentryid string conditional target price book entry id (for upgrade , downgrade , swap ) additionalattributes object no custom fields for the change changetype options value description required fields renew extend subscription for a new term renewalterm updatequantity change subscription quantity quantity or quantitychange updateterm modify the subscription term renewalterm coterm co terminate with another subscription effectivedate cancel cancel the subscription effectivedate reconfigure modify bundle add ons varies by configuration adjustprice change pricing without quantity/term change pricing fields convertfreetrial convert free trial to paid target pricing fields upgrade replace with higher tier product targetproductid , targetpricebookentryid downgrade replace with lower tier product targetproductid , targetpricebookentryid swap replace with a different product targetproductid , targetpricebookentryid checkoutoptions fields field type required description proceedoption string yes how to process the change (see table below) activateorder boolean no whether to activate the order immediately (default true ) opportunityid string conditional opportunity id; required when proceedoption is createorder or createquote containedobjectid string conditional existing order or quote id; required when proceedoption is useexistingorder or useexistingquote proceedoption values value description createorder create a new order for the changes useexistingorder add changes to an existing draft order (requires containedobjectid ) createquote create a quote for the changes, enabling approval workflows useexistingquote add changes to an existing draft quote (requires containedobjectid ) key behaviors behavior details activation default orders are activated immediately by default set options activateorder to false to create a draft order pricing the create order api does not recalculate pricing you must supply pre calculated salesprice and totalprice values bundle nesting bundle products use childrenorderproducts to define add on components the response mirrors this structure in childrensubscriptions effective date the effectivedate on the order determines when the order takes effect for change orders, the effectivedate on each asset change determines when that specific change takes effect multiple changes a single change order request can include multiple entries in the assetchanges array, each targeting a different asset with a different change type prorated billing when billing is enabled, mid term changes (quantity updates, cancellations, upgrades) generate prorated charges or credits based on the effective date