Amberflo API
Quote the CPQ Usage Cost.
Quote the CPQ Usage Price
1 min
code examples curl location 'https //app amberflo io/payments/pricing/amberflo/customer commitment quote' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "customerid" "", "customproductplangenerator" { "id" "", "billingperiod" {}, "planname" "", "entitlements" \[ { "id" "", "apiname" "" } ], "pricegenerators" { "dimensionkeys" \[], "productitemid" "", "pricetiers" \[ { "leafnodetype" "" } ] }, "invoicebasedfees" {} }, "intervalusages" \[ { "timerange" {}, "meterusages" \[ { "meterapiname" "", "dimensionkeys" \[], "variantusages" \[ { "dimensionvalues" \[], "usagevalue" "", "usagefrequency" "" } ] } ], "promotions" \[ { "existingpromotionid" "", "inlinepromotion" { "id" "", "promotionname" "" } } ] } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "customerid" "", "customproductplangenerator" { "id" "", "billingperiod" {}, "planname" "", "entitlements" \[ { "id" "", "apiname" "" } ], "pricegenerators" { "dimensionkeys" \[], "productitemid" "", "pricetiers" \[ { "leafnodetype" "" } ] }, "invoicebasedfees" {} }, "intervalusages" \[ { "timerange" {}, "meterusages" \[ { "meterapiname" "", "dimensionkeys" \[], "variantusages" \[ { "dimensionvalues" \[], "usagevalue" "", "usagefrequency" "" } ] } ], "promotions" \[ { "existingpromotionid" "", "inlinepromotion" { "id" "", "promotionname" "" } } ] } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //app amberflo io/payments/pricing/amberflo/customer commitment quote", 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 //app amberflo io/payments/pricing/amberflo/customer commitment quote") 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({ "customerid" "", "customproductplangenerator" { "id" "", "billingperiod" {}, "planname" "", "entitlements" \[ { "id" "", "apiname" "" } ], "pricegenerators" { "dimensionkeys" \[], "productitemid" "", "pricetiers" \[ { "leafnodetype" "" } ] }, "invoicebasedfees" {} }, "intervalusages" \[ { "timerange" {}, "meterusages" \[ { "meterapiname" "", "dimensionkeys" \[], "variantusages" \[ { "dimensionvalues" \[], "usagevalue" "", "usagefrequency" "" } ] } ], "promotions" \[ { "existingpromotionid" "", "inlinepromotion" { "id" "", "promotionname" "" } } ] } ] }) response = https request(request) puts response read body import requests import json url = "https //app amberflo io/payments/pricing/amberflo/customer commitment quote" payload = json dumps({ "customerid" "", "customproductplangenerator" { "id" "", "billingperiod" {}, "planname" "", "entitlements" \[ { "id" "", "apiname" "" } ], "pricegenerators" { "dimensionkeys" \[], "productitemid" "", "pricetiers" \[ { "leafnodetype" "" } ] }, "invoicebasedfees" {} }, "intervalusages" \[ { "timerange" {}, "meterusages" \[ { "meterapiname" "", "dimensionkeys" \[], "variantusages" \[ { "dimensionvalues" \[], "usagevalue" "", "usagefrequency" "" } ] } ], "promotions" \[ { "existingpromotionid" "", "inlinepromotion" { "id" "", "promotionname" "" } } ] } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful request { "usagequoterequest" { "customerid" "", "customproductplangenerator" {}, "productplanid" "", "intervalusages" \[ { "timerange" { "starttimeinseconds" "", "endtimeinseconds" "" }, "meterusages" \[ { "meterapiname" "", "dimensionkeys" \[ "" ], "variantusages" \[ { "dimensionvalues" \[ "" ], "usagevalue" 0, "usagefrequency" "" } ] } ], "promotions" \[ { "existingpromotionid" "", "inlinepromotion" {} } ] } ] }, "intervalquotes" \[ { "itemquotes" \[ { "itemquote" { "quotedusagecostbeforediscount" 0, "quotedusagecostdiscount" 0, "quotedusagecostafterdiscount" 0, "quotedfixedcostbeforediscount" 0, "quotedfixedcostdiscount" 0, "quotedfixedcostafterdiscount" 0, "quotedcostbeforediscount" 0, "quotedcostdiscount" 0, "quotedcostafterdiscount" 0, "totalmeterunits" 0 } } ], "intervalquote" { "quotedusagecostbeforediscount" 0, "quotedusagecostdiscount" 0, "quotedusagecostafterdiscount" 0, "quotedfixedcostbeforediscount" 0, "quotedfixedcostdiscount" 0, "quotedfixedcostafterdiscount" 0, "quotedcostbeforediscount" 0, "quotedcostdiscount" 0, "quotedcostafterdiscount" 0, "totalmeterunits" 0 } } ], "totalquote" { "quotedusagecostbeforediscount" 0, "quotedusagecostdiscount" 0, "quotedusagecostafterdiscount" 0, "quotedfixedcostbeforediscount" 0, "quotedfixedcostdiscount" 0, "quotedfixedcostafterdiscount" 0, "quotedcostbeforediscount" 0, "quotedcostdiscount" 0, "quotedcostafterdiscount" 0, "totalmeterunits" 0 } }