Update Order Overview
18 min
update order overview the update order api changes an existing draft order and re runs the same pricing and tax cascade the nue line editor runs internally it is the write counterpart to create order docid\ qdvlx6ws2ascbu8hwfrzf , and the exact mirror of update quote docid\ j9w7ufhjvphiej93bx5y9 quote and order share the same line editor, the same pricing engine, and the same tax cascade, so every operation, action name, payload shape, ordering rule, recalc mode, and error code is identical read update quote overview docid\ j9w7ufhjvphiej93bx5y9 for the full contract this page covers the endpoint and the handful of things that differ on orders endpoints endpoint method description /cpq/orders/{orderid}\ update post apply one or more update actions to an existing draft order there is no separate preview endpoint preview is iscommit false on the same call action oriented, not payload oriented you do not send the order you want you send an ordered list of actions naming what to do, each with its own payload fields you omit are untouched; lines you omit are untouched a line is deleted only when you ask for it by id in a deletelineitems action the server never infers a deletion from a shorter line list this is what separates the update order api from patch /api/objects/order/{id} the objects api writes the field you send and recalculates nothing, leaving totals and tax stale this api applies the change and re runs pricing, roll ups, and tax in the same transaction see action oriented, not payload oriented docid\ j9w7ufhjvphiej93bx5y9 on the quote page for the full explanation request envelope { "iscommit" true, "recalc" "auto", "expectedlastmodified" "2026 08 07t18 22 41 000z", "actions" \[ { "action" "\<actionname>", "payload" { / action specific / } } ] } the order is identified by the {orderid} path parameter do not put orderid in the body the six actions identical to the quote api action payload updateheaderfields { "fieldvalues" { } } updatelineitems { "lineitems" \[ { "lineitemid" " ", "fieldvalues" { } } ] } deletelineitems { "lineitemids" \[ " " ] } addlineitems { "products" \[ productinput ] } replacepricetags { "pricetags" \[ { "\<old>" "\<new>" } ], "target" \[ ], "includechildren" true } removepricetags { "pricetags" \[ "\<idorcode>" ], "target" \[ ], "includechildren" true } actions are re ordered server side into the canonical sequence header fields, deletes, price tag actions, line updates, adds updateheaderfields may appear at most once, and each line may be targeted at most once; both violations return conflicting actions the sort is stable by stage within a stage, actions keep the order you sent them that is immaterial everywhere except the price tag stage, where removepricetags and replacepricetags share a stage and their target line ids are not covered by the conflict check so two overlapping tag actions run in submitted order and the result depends on it see action ordering docid\ j9w7ufhjvphiej93bx5y9 what differs from the quote api quote order path /cpq/quotes/{quoteid}\ update /cpq/orders/{orderid}\ update editability gate quote must not be activated, ordered, or locked for approval quote not editable order must be in draft status order not draft not found error quote not found order not found concurrency error quote modified order modified header object validated against quote order line object validated against quotelineitem orderproduct invalid field message invalid field for quote invalid field for order invalid line field message invalid field for quote line item invalid field for order product response keys quote , quotelineitems order , orderproducts contract value fields acv , tcv orderacv , ordertcv apex global method globalquoteserviceapi updatequote globalorderserviceapi updateorder draft only an activated order cannot be edited through this api changes to live, activated subscriptions renewals, quantity changes, cancellations, and bundle reconfigurations go through the change order docid\ ussheavdtd5efewfauylq process instead field naming use nue field names over rest fieldvalues keys are validated against the nue object describe for order (header actions) and orderproduct (line actions) use the nue camelcase api names name , paymentterm , billcycleday , subscriptionterm , quantity , discount , netsalesprice , includedunits , evergreen custom fields use their salesforce api name ( region c ) an unknown key fails at the proxy with 400 invalid field for order \<name> salesforce field api names such as subscriptionterm c are for the apex global method, not for rest recalculation modes auto (default), pricing only , tax only , none case sensitive, same semantics as on quotes see recalculation modes docid\ j9w7ufhjvphiej93bx5y9 pricing engine plugins run on the update exactly as they do on create but only when the request actually reaches the pricing pass they do not run under recalc none or tax only , nor under auto when you only touched non repricing fields preview runs them too see pricing engine plugins and recalc docid\ j9w7ufhjvphiej93bx5y9 examples patch order header fields curl x post 'https //api nue io/cpq/orders/801cu000004abcdefg\ update' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "iscommit" true, "recalc" "auto", "actions" \[ { "action" "updateheaderfields", "payload" { "fieldvalues" { "name" "acme q3 expansion order", "ponumber" "po 2026 0417", "paymentmethod" "invoice" } } } ] }' edit a line and preview the impact const myheaders = new headers(); myheaders append("nue api key", "your api key here"); myheaders append("content type", "application/json"); const edit = { iscommit false, // preview nothing is written recalc "auto", actions \[ { action "updatelineitems", payload { lineitems \[ { lineitemid "802cu00000abcdefgh", fieldvalues { quantity 30, discount 15 } } ] } } ] }; const res = await fetch( 'https //api nue io/cpq/orders/801cu000004abcdefg\ update', { method 'post', headers myheaders, body json stringify(edit) } ); const result = await res json(); console log(`preview total ${result order totalamount}`); console log(`preview order acv ${result order orderacv}`); add a product and delete another in one call curl x post 'https //api nue io/cpq/orders/801cu000004abcdefg\ update' \\ h 'nue api key your api key here' \\ h 'content type application/json' \\ d '{ "iscommit" true, "recalc" "auto", "actions" \[ { "action" "addlineitems", "payload" { "products" \[ { "productsku" "nue platform", "uom" "user/month", "quantity" 5 } ] } }, { "action" "deletelineitems", "payload" { "lineitemids" \["802cu00000zzzyyxwv"] } } ] }' add a bundle option (reconfigure) there is no reconfigure action you add, re quantify, or delete the bundle's option lines parentlineid points at the bundle line { "iscommit" true, "recalc" "auto", "actions" \[ { "action" "addlineitems", "payload" { "products" \[ { "parentlineid" "802cu00000bundleaa", "productsku" "addon support", "uom" "license/month", "quantity" 2 } ] } } ] } line level custom fields on an added line { "action" "addlineitems", "payload" { "products" \[ { "productsku" "nue on salesforce", "uom" "user/month", "quantity" 25, "customfields" { "costcenter c" "cc 1042" } } ] } } see custom fields docid\ bikygxx0nxr6hdnxuvitf response { "order" { "id" "801cu000004abcdefg", "name" "acme q3 expansion order", "status" "draft", "totalamount" 48250 00, "orderacv" 41000 00, "ordertcv" 41000 00, "tax" 3862 50, "currencyisocode" "usd" }, "orderproducts" \[ { "id" "802cu00000abcdefgh", "quantity" 30, "discount" 15, "netsalesprice" 1254 60, "totalprice" 37638 00 }, { "id" "802cu00000newlinea", "quantity" 5, "netsalesprice" 2270 00, "totalprice" 11350 00, "changetype" "newproduct" } ], "warnings" \[] } field type description order object the order header with recalculated pricing, metrics, and tax orderproducts array every order product after the update, with hierarchy warnings array non blocking advisories { level, code, message } failures return 400 or 500 with { status, error, message, errordetails\[] } what you can change the rules are identical to quotes, with orderproduct field names in place of quotelineitem names header fields never updatable field not updatable totalamount , totalamountwithouttax , subtotal , listtotal , grandtotal , systemdiscount , systemdiscountamount , totalcommittedamount , sellertotalamount , tax , orderacv , ordertcv , todayarr , todaycmrr , id deliberately updatable inputs discount , discountamount , totalprice , partnerpayoutpercentage , partnerpayoutamount guarded separately currencyisocode cannot change; the account cannot change; pricebookid cannot change once the order has priced lines ( pricebook change not allowed ) line fields that re price quantity , netsalesprice , discount , discountamount , subscriptionstartdate , subscriptionenddate , subscriptionterm , includedunits , evergreen , plus line direct quantity tier attribute custom fields line fields saved without re pricing billingperiod , billingtiming , paymentterm , billcycleday , billcyclestartmonth , autorenew , defaultrenewalterm , description , cancellationdate line fields never updatable listprice , listtotalprice , unitprice , netsellerprice , subtotal , totalprice , totalamount , totalamountwithouttax , sellertotalamount , tax , systemdiscount , systemdiscountamount , every delta metric, actualquantity , actualsubscriptionterm , proratedquantity , partnerpayoutpercentage , partnerpayoutamount plus identity and relationship fields id , orderid , pricebookentryid , productid , parentorderproductid , productoptionid line type rules are the same summary, split, ramp, and subscription context lines are not editable; required and bundled children cannot be removed alone; removing a bundle root removes its whole descendant closure; change lines are removed only via their summary line addresses and taxation an address or taxation override change always triggers a tax recalculation when taxation is enabled, then rolls the header total up recalc tax only is the cheap address only path the taxable address override (five taxation fields, activated by taxationcountry ) and the taxation customer identity resolve independently, order first, then account see addresses and taxation docid\ j9w7ufhjvphiej93bx5y9 scope and limits draft orders only activated orders go through the change order api a record with 200 or more line items currently fails outright a hard ceiling that applies to every action pricing and tax are synchronous callouts; budget at least one of each per recalc tax failures surface as warnings, not errors apex global method globalapitypes updateorderresponse globalorderserviceapi updateorder(globalapitypes updateorderrequest req) the order id is req orderid , and fieldvalues keys are salesforce field api names ( subscriptionterm c ), not nue names the response is { status, data, warnings, errors } there is also an in org apexrest surface at post /services/apexrest/ruby/updateorder taking the same json body full apex documentation lives in the nue knowledge center under global methods related pages create order overview docid\ qdvlx6ws2ascbu8hwfrzf the create counterpart update quote overview docid\ j9w7ufhjvphiej93bx5y9 the full contract custom fields docid\ bikygxx0nxr6hdnxuvitfchange quotes and orders docid\ ussheavdtd5efewfauylq for activated subscriptions