Pricing and Billing
Pricing Plans
Customer Pricing Plan Details
4min
there are two static factors that influence how your customers are billed their (current) pricing plan their (active) promotions for context, the dynamic factors would include their actual usage, rewards they earned from that usage, etc if you need to share a view of the static factors with your customers, you can use the get pricing plan details docid\ dyysimjt1epwwkk truxi in this guide, we will describe this api in a bit more detail pricing plan first, a customer is assigned a pricing plan (aka productplan in the api schema) the pricing plan has a static (fixed) component, fee, and a dynamic (variable) component, product item price the following snippet shows the shape of the "product plan" part of the api response by looking at the productplan fees\[i] and the productplan productitems\[i] productitemprice prices one can understand how the customer will be billed given some usage the price object is explained in build any pricing and billing model (price machine) docid\ ogmoe1tk5ljyz7jkd76j8 { "productplan" { "id" " ", "fees" \[ { "id" " " }, ], "productitems" \[ { "id" " ", "productitemprice" { "id" " ", "price" { "type" " ", } } }, ] }, } promotions a customer may be assigned to multiple promotions the following snippet shows the shape of the "promotions" part of the api response by looking at promotions\[i] promotion , one can see the details of each active promotion of the customer { , "promotions" \[ { , "appliedtimeinseconds" 1655555555, "promotion" { "id" " ", } }, ] } appendix sample here is a sample of a full api response { "productplan" { "id" "6a00892e 3e02 42c8 9559 6d2e95957848", "productid" "1", "billingperiod" { "interval" "month", "intervalscount" 1 }, "planlevelfreetier" 10, "productplanname" "pricing plan 1", "description" "", "lastupdatetimeinmillis" 1654722838307, "lockingstatus" "close to changes", "isdefault" true, "successorplanid" null, "transitionstrategy" null, "fees" \[ { "id" "b9c46a7b ca07 4164 b2ba e75a77fdc4e7", "name" "fixed rate add on 1", "description" "one time fee", "cost" 10, "isonetimefee" true, "isprorated" false, "proratetoday" false, "discountable" true, "prepayable" true } ], "productitems" \[ { "lockingstatus" "close to deletions", "lastupdatetimeinmillis" 1654722838307, "productitemprice" { "id" "ab408cd7 3444 4280 b1c5 68b424da4a92", "price" { "type" "priceperunitleafnode", "tiers" \[ { "startafterunit" 100, "batchsize" 1, "priceperbatch" 2 } ], "allowpartialbatch" false }, "productitempricename" "ab408cd7 3444 4280 b1c5 68b424da4a92", "lockingstatus" "close to changes", "lastupdatetimeinmillis" 1654722838307 }, "id" "ef79342b 814c 4df3 bac7 e36875b2c870" }, { "lockingstatus" "close to deletions", "lastupdatetimeinmillis" 1654722838307, "productitemprice" { "id" "968fdf41 dda1 4f7b a0c8 d9f5cf86258b", "price" { "type" "max reducer", "granularity" "hourly", "nextnode" { "type" "leafnode", "tiers" \[ { "startafterunit" 1, "batchsize" 100, "priceperbatch" 20 }, { "startafterunit" 10001, "batchsize" 100, "priceperbatch" 15 } ], "allowpartialbatch" false } }, "productitempricename" "968fdf41 dda1 4f7b a0c8 d9f5cf86258b", "lockingstatus" "close to changes", "lastupdatetimeinmillis" 1654722838307 }, "id" "3ac48ee8 e7f9 4d3c a7c7 1f2ad0206da3" } ] }, "promotions" \[ { "productid" "1", "appliedtimeinseconds" 1654723079, "promotion" { "targetproductitemid" "ef79342b 814c 4df3 bac7 e36875b2c870", "promotiontimelimit" { "cycles" 1, "months" 0 }, "discount" 50, "totalmaxdiscount" null, "id" "a21bc4d7 a826 4895 a92d 5bde340bd0e3", "type" "time limited absolute item discount", "promotionname" "promotion 2", "description" "", "lockingstatus" "close to changes", "lastupdatetimeinmillis" 1654722948604 } } ] }