Approve, Reject, and Reassign
9 min
these three endpoints act on approvals that are already pending all of them take approvalids — the ids of individual approval records, which you get from get /cpq/approvals or get /cpq/approval requests , not the id of the quote itself all three return the same action payload the resulting status , whether the record islocked , and the affected approval rows approve post /cpq/approvals\ approve field type description approvalids array of string required approval record ids to approve message string approver comment recorded on the approval actor string salesforce user id to act on behalf of source string ui , email , api , or flow defaults to api curl x post 'https //api nue io/cpq/approvals\ approve' \\ h 'nue api key your api key' \\ h 'content type application/json' \\ d '{ "approvalids" \["a0ukb000000wxdemak"], "message" "margin is within policy for this segment", "source" "api" }' { "status" "success", "data" { "requestid" "a0tkb000000vwcdmak", "recordid" "0q0kb000000xyzakak", "status" "approved", "islocked" false, "approvers" \[], "approvals" \[ { "approvalid" "a0ukb000000wxdemak", "stepname" "deal desk", "stepstatus" "approved", "approveruserid" "005kb000000wxyziak", "originalapproveruserid" null, "reassignedfromapprovalid" null, "rejectionmessage" null } ] }, "warnings" \[], "errors" \[] } approving the last outstanding approver on a step resolves that step and advances the process when the final step resolves, the record's overall status becomes approved and islocked returns to false you can pass several approvalids in one call — useful for a bulk approve action in an approver's queue reject post /cpq/approvals\ reject field type description approvalids array of string required approval record ids to reject reason string rejection reason recorded on the approval actor string salesforce user id to act on behalf of source string ui , email , api , or flow defaults to api curl x post 'https //api nue io/cpq/approvals\ reject' \\ h 'nue api key your api key' \\ h 'content type application/json' \\ d '{ "approvalids" \["a0ukb000000wxdemak"], "reason" "discount exceeds policy for a first year deal reduce to 15% or add a two year term " }' always send a reason the reason is what the submitter sees and what an auditor reads later it is surfaced as rejectionmessage on the approval row and on the record's overall status a rejection without one tells the rep their quote was refused but not what to change reassign routes pending approvals to a different approver post /cpq/approvals\ reassign field type description approvalids array of string required approval record ids to reassign newapproverid string required id of the new approver, a user or a group approvertype string type of the target identified by newapproverid message string comment recorded on the reassignment actor string salesforce user id to act on behalf of source string ui , email , api , or flow defaults to api curl x post 'https //api nue io/cpq/approvals\ reassign' \\ h 'nue api key your api key' \\ h 'content type application/json' \\ d '{ "approvalids" \["a0ukb000000wxdemak"], "newapproverid" "005kb000000abcdeak", "approvertype" "user", "message" "dana is out this week" }' reassignment keeps a trail the resulting row carries field meaning approveruserid the new approver originalapproveruserid the previous approver's salesforce user id reassignedfromapprovalid the approval this row was rerouted from both trail fields are null on rows that were never reassigned, so a delegation chain is explicit rather than something you have to infer from timestamps common errors code cause missing parameter a required field such as approvalids or newapproverid was absent invalid parameter a value was malformed, or source was outside ui , email , api , flow record not found an approval id does not exist or is not visible to the acting user all of these return the standard envelope with status of failure , so you can handle them with the same parsing path as a success