Guides and Examples
...
Orders
Create Order Overview
9 min
create order overview the nue cpq order apis provide rest endpoints for creating orders and change orders that directly provision subscriptions, assets, and entitlements unlike the quote apis, which are designed for pricing previews and approval workflows, the order apis are built for direct execution you submit an order, and the system creates the full downstream object graph in a single call there are two primary endpoints create order ( post /cpq/create order ) creates a new order with one or more order products by default the order is activated immediately, provisioning subscriptions, assets, and entitlements change order ( post /cpq/change order ) modifies existing subscriptions by creating a change order supports renewals, quantity changes, cancellations, upgrades, downgrades, and more create order vs create quote the create order and create quote apis serve different purposes and differ in how products are identified and how pricing is resolved feature create quote ( /cpq/quotes ) create order ( /cpq/create order ) product identification productsku + uom (or productname + uom ) pricebookentryid (explicit price book entry id) pricing resolution the pricing engine resolves list price, applies discounts, price tags, and computes totals automatically you provide salesprice and totalprice directly; the pricing engine does not recalculate preview mode yes ( \ preview endpoint for dry run) no orders are created and activated immediately by default output quote + quote line items order + order products + subscriptions + assets + entitlements activation separate activation step required automatic on creation (configurable via options activateorder ) change support create a new quote change order endpoint for modifying existing subscriptions bundle handling auto expands bundles from product catalog configuration you explicitly define childrenorderproducts in the request discount/price tag evaluation full pricing engine with discount propagation and price tag evaluation not applicable you supply pre calculated prices when to use create quote you need a pricing preview or what if scenario before committing you are building a quoting workflow with approval steps products are identified by sku and uom, and you want the pricing engine to resolve everything you want automatic bundle expansion, discount propagation, and price tag evaluation when to use create order you want to create and activate an order in a single api call you already have price book entry ids and pre calculated pricing (for example, from your own pricing engine or an external system) you need the full provisioning result subscriptions, assets, and entitlements immediately you are making changes to existing subscriptions via the change order endpoint order lifecycle when you call create order with activation enabled (the default), the following sequence occurs order created the order is created with status activated order products created each item in the orderproducts array becomes an order product record subscriptions provisioned recurring products generate subscription records with the specified start date, end date, and term assets created asset records are created to represent the customer's entitlement to each product entitlements created entitlement records are created to track what the customer has access to when options activateorder is set to false , the order is created in draft status subscriptions, assets, and entitlements are not provisioned until the order is activated separately change order types change orders modify existing subscriptions each change is identified by an assetnumber and a changetype the following change types are supported change type description renew extend a subscription for a new term beyond its current end date updatequantity increase or decrease the quantity on an existing subscription updateterm modify the subscription term without changing other attributes coterm align a subscription's end date with another subscription (co termination) cancel cancel an active subscription as of a specified effective date reconfigure modify add ons or components within a bundle subscription adjustprice change the pricing on an existing subscription without modifying quantity or term convertfreetrial convert a free trial subscription to a paid subscription upgrade replace the current product with a higher tier product downgrade replace the current product with a lower tier product swap replace the current product with a different product (lateral move) change order processing options the proceedoption field determines how a change order is processed proceed option description createorder create a new order for the changes and optionally activate it useexistingorder add the changes to an existing draft order (requires containedobjectid ) createquote create a quote for the changes, enabling an approval workflow before activation useexistingquote add the changes to an existing draft quote (requires containedobjectid ) authentication all cpq order api requests 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"); curl x post 'https //api nue io/cpq/create order' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ }' create order response when an order is created and activated, the response includes id the order id order the order header object with status, effective date, and totals orderproducts array of order products; bundle parents include childrenorderproducts nesting subscriptions subscriptions created from recurring products; bundle parents include childrensubscriptions nesting assets asset records created from the order entitlements entitlement records created from the order change order response when a change order is created and activated, the response includes headerobjectids the ids of created orders or quotes messages status messages for the operation subscriptions updated subscription records assets updated asset records entitlements updated entitlement records invoices invoice records generated for prorated charges (if billing is enabled) next steps docid\ ymmgzrhx6rmik18clykyl detailed guide with use cases for creating orders and change orders