API References
...
Orders
Invoice Preview
1 min
code examples curl location 'https //api nue io/orders/invoice preview' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "customer" { "id" "" }, "orderproducts" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "", "addons" \[ { "productoptionid" "" } ] } ], "assetchanges" \[ { "changetype" "", "assetnumber" "", "addons" \[ { "productoptionid" "", "reconfigureeffectivedate" "", "productoptionquantity" "" } ] } ], "products" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "" } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "customer" { "id" "" }, "orderproducts" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "", "addons" \[ { "productoptionid" "" } ] } ], "assetchanges" \[ { "changetype" "", "assetnumber" "", "addons" \[ { "productoptionid" "", "reconfigureeffectivedate" "", "productoptionquantity" "" } ] } ], "products" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "" } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api nue io/orders/invoice preview", 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/orders/invoice preview") 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({ "customer" { "id" "" }, "orderproducts" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "", "addons" \[ { "productoptionid" "" } ] } ], "assetchanges" \[ { "changetype" "", "assetnumber" "", "addons" \[ { "productoptionid" "", "reconfigureeffectivedate" "", "productoptionquantity" "" } ] } ], "products" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "" } ] }) response = https request(request) puts response read body import requests import json url = "https //api nue io/orders/invoice preview" payload = json dumps({ "customer" { "id" "" }, "orderproducts" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "", "addons" \[ { "productoptionid" "" } ] } ], "assetchanges" \[ { "changetype" "", "assetnumber" "", "addons" \[ { "productoptionid" "", "reconfigureeffectivedate" "", "productoptionquantity" "" } ] } ], "products" \[ { "pricebookentryid" "", "quantity" "", "subscriptionstartdate" "" } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // invoice preview computed successfully the response shape depends on the request type { "previewinvoices" \[ { "id" "", "invoicenumber" "", "amount" 0, "amountwithouttax" 0, "currencyisocode" "", "invoicedate" "", "duedate" "", "startdate" "", "enddate" "", "status" "", "items" \[ { "productname" "", "amount" 0, "quantity" 0, "unitprice" 0, "startdate" "", "enddate" "" } ] } ], "previews" \[ { "assetnumber" "", "pricesummary" { "totalprice" 0, "totalamount" 0, "todaychargeprice" 0, "todaychargeamount" 0, "nextbillingperiodprice" 0, "nextbillingperiodamount" 0, "nextbillingdate" "" }, "previewresult" { "assetnumber" "", "quantity" 0, "term" 0, "startdate" "", "enddate" "", "cancellationdate" "", "orderprice" {}, "billingprice" {}, "changes" \[ {} ], "childrenassets" \[ {} ] }, "previewrequest" {} } ] }// validation error { "status" "", "errorcode" "", "message" "" }// unauthorized {}