Finalize Quotes
1 min
code examples curl request post \\ \ url https //api nue io/cpq/quotes\ finalize \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "quoteids" \[] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "quoteids" \[] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api nue io/cpq/quotes\ finalize", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api nue io/cpq/quotes\ finalize") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "quoteids" \[] }) response = https request(request) puts response read body import requests import json url = "https //api nue io/cpq/quotes\ finalize" payload = json dumps({ "quoteids" \[] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // the quotes were finalized into orders { "orders" \[ { "orderid" "", "ordernumber" "", "status" "draft", "quoteid" "" } ], "warnings" \[ { "errorcode" "", "errortype" "", "message" "" } ] }// invalid request — more than 50 ids, an empty list, an unresolved change order line, or a tax calculation error on the quote nothing was finalized { "code" 400, "message" "bad request", "details" "required field 'name' is missing" }// one or more quotes were not found nothing was finalized { "code" 400, "message" "bad request", "details" "required field 'name' is missing" }// internal server error the outcome is unknown — read the quote before retrying, or it may be finalized twice { "code" 400, "message" "bad request", "details" "required field 'name' is missing" }