/payments/analysis/by-rule-revenue-calculator
1 min
POST
https://app.amberflo.io/payments/analysis/by-rule-revenue-calculator
Body Parameters
- bodypayment.analysis.modeling.by_rule.ByRulePriceAnalysisModel.in
- keypayment.analysis.modeling.PriceAnalysisModelKey.in
- accountIdstring
- idstring
- typestringDefaultby-rule
- namestring
- descriptionstring
- timeRangepayment.common.TimeRange.in
- startTimeInSecondsinteger<int64>
- endTimeInSecondsinteger<int64>
- analysisProductPlanspayment.analysis.modeling.AnalysisProductPlan.in[]
- idstring
- referencePlanstring
- planBillingPeriodpayment.pricing.BillingPeriod.in
- intervalpayment.pricing.BillingPeriodInterval.in
- intervalsCountinteger<int32>
- itemToPriceIdsOverridesmap<string, string>
- meterNameToPriceOverridesmap<string, payment.pricing.price.PriceStateMachineNode.in>
- timeGroupingIntervalcom.amberflo.service.common.aggregation.AggregationInterval.in
- updateTimeInSecondsinteger<int64>
- customersBaseQuerypayment.analysis.modeling.by_rule.CustomersSampleSpaceKey.in
- filtersmap<string, string[]>
- takepayment.common.Take.in
- limitinteger<int32>
- isAscendingboolean
- customerSourcepayment.analysis.modeling.by_rule.CustomersSourceType.in
- usageSourcepayment.analysis.modeling.by_rule.UsageSourceType.in
Responses
200
- payment.analysis.modeling.revenue.AnalyzedPlansRevenues.out
- analyzedPlanRevenueListpayment.analysis.modeling.revenue.AnalyzedPlanRevenue.out[]
- analysisPlanIdstring
- revenuenumber
- revenuePercentageDiffFromPivotPlannumber
- customerGroupRevenueMapmap<string, payment.analysis.modeling.revenue.CustomerGroupRevenue.out>
- revenueValuespayment.analysis.modeling.revenue.RevenueValue.out[]
- startTimeInSecondsinteger<int64>
- revenuenumber
- pivotPlanRevenuenumber
- revenuePercentageDiffFromPivotPlannumber
curl
curl --request POST \
--url https://app.amberflo.io/payments/analysis/by-rule-revenue-calculator \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"type": "by-rule"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"type": "by-rule"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/payments/analysis/by-rule-revenue-calculator", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://app.amberflo.io/payments/analysis/by-rule-revenue-calculator")
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({
"type": "by-rule"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/payments/analysis/by-rule-revenue-calculator"
payload = json.dumps({
"type": "by-rule"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Successful request
{
"analyzedPlanRevenueList": [
{
"analysisPlanId": "",
"revenue": 0,
"revenuePercentageDiffFromPivotPlan": 0,
"customerGroupRevenueMap": "",
"revenueValues": [
{
"startTimeInSeconds": "",
"revenue": 0,
"pivotPlanRevenue": 0,
"revenuePercentageDiffFromPivotPlan": 0
}
]
}
]
}