curl --request POST \
--url https://api.togai.com/revenue_calculator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currencyConfig": {
"mode": "CUSTOM",
"currency": "USD"
},
"pricePlanDetailsConfig": {
"mode": "PRICE_PLAN",
"pricePlanId": "pp.fdhkf.djf",
"effectiveOn": "2020-01-01T00:00:00Z",
"pricingCycleOrdinal": 1
},
"usageConfig": {
"mode": "CUSTOM",
"usageMap": {
"um.1zcgWalbM2y.qaX5j": 100
}
},
"licenseEntriesConfig": {
"mode": "CUSTOM",
"custom": [
{
"licenseId": "license.1zcgWalbM2y.qaX5j",
"quantity": 10,
"effectiveFrom": "2020-01-01T00:00:00Z"
}
]
},
"entitlementOverageConfig": {
"mode": "CUSTOM",
"custom": [
{
"featureId": "feature.1122.ahoiud",
"quantity": 5
},
{
"featureId": "feature.3452.abcaf2",
"quantity": 28
}
]
}
}
'{
"currency": "USD",
"pricePlanDetails": {
"supportedCurrencies": [
"USD"
],
"activeCurrencies": [
"USD"
],
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "1",
"monthOffset": "NIL"
},
"gracePeriod": 1,
"anniversaryCycle": false
},
"usageRateCards": [
{
"displayName": "AfterShip Shipments1",
"usageMeterId": "um.1zcgWalbM2y.qaX5j",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"priceType": "PER_UNIT",
"startAfter": 0,
"order": 1
},
{
"priceType": "PACKAGE",
"startAfter": 2,
"order": 2,
"slabConfig": {
"packageSize": "10"
}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 10,
"slabRateConfig": {
"minimumRate": "1",
"maximumRate": "10"
}
},
{
"order": 2,
"rate": 20
}
]
}
],
"tag": "1"
}
],
"type": "BILLING"
},
"revenueInfo": [
{
"usages": {
"um.fdjal.kdajf": 10
},
"usageRateCard": {
"displayName": "AfterShip Shipments1",
"usageMeterId": "um.1zcgWalbM2y.qaX5j",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"priceType": "PER_UNIT",
"startAfter": 0,
"order": 1
},
{
"priceType": "PACKAGE",
"startAfter": 2,
"order": 2,
"slabConfig": {
"packageSize": "10"
}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 10,
"slabRateConfig": {
"minimumRate": 1,
"maximumRate": 10
}
},
{
"order": 2,
"rate": 20
}
]
}
]
},
"slabRevenueSummaries": [
{
"order": 1,
"usage": 10,
"revenue": 100
},
{
"order": 2,
"usage": 0,
"revenue": 0
}
]
}
]
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}(DEPRECATED) Calculate and return the revenue for a existing or new price plan
Calculate and return the revenue for a existing or new price plan
curl --request POST \
--url https://api.togai.com/revenue_calculator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currencyConfig": {
"mode": "CUSTOM",
"currency": "USD"
},
"pricePlanDetailsConfig": {
"mode": "PRICE_PLAN",
"pricePlanId": "pp.fdhkf.djf",
"effectiveOn": "2020-01-01T00:00:00Z",
"pricingCycleOrdinal": 1
},
"usageConfig": {
"mode": "CUSTOM",
"usageMap": {
"um.1zcgWalbM2y.qaX5j": 100
}
},
"licenseEntriesConfig": {
"mode": "CUSTOM",
"custom": [
{
"licenseId": "license.1zcgWalbM2y.qaX5j",
"quantity": 10,
"effectiveFrom": "2020-01-01T00:00:00Z"
}
]
},
"entitlementOverageConfig": {
"mode": "CUSTOM",
"custom": [
{
"featureId": "feature.1122.ahoiud",
"quantity": 5
},
{
"featureId": "feature.3452.abcaf2",
"quantity": 28
}
]
}
}
'{
"currency": "USD",
"pricePlanDetails": {
"supportedCurrencies": [
"USD"
],
"activeCurrencies": [
"USD"
],
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "1",
"monthOffset": "NIL"
},
"gracePeriod": 1,
"anniversaryCycle": false
},
"usageRateCards": [
{
"displayName": "AfterShip Shipments1",
"usageMeterId": "um.1zcgWalbM2y.qaX5j",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"priceType": "PER_UNIT",
"startAfter": 0,
"order": 1
},
{
"priceType": "PACKAGE",
"startAfter": 2,
"order": 2,
"slabConfig": {
"packageSize": "10"
}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 10,
"slabRateConfig": {
"minimumRate": "1",
"maximumRate": "10"
}
},
{
"order": 2,
"rate": 20
}
]
}
],
"tag": "1"
}
],
"type": "BILLING"
},
"revenueInfo": [
{
"usages": {
"um.fdjal.kdajf": 10
},
"usageRateCard": {
"displayName": "AfterShip Shipments1",
"usageMeterId": "um.1zcgWalbM2y.qaX5j",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"priceType": "PER_UNIT",
"startAfter": 0,
"order": 1
},
{
"priceType": "PACKAGE",
"startAfter": 2,
"order": 2,
"slabConfig": {
"packageSize": "10"
}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 10,
"slabRateConfig": {
"minimumRate": 1,
"maximumRate": 10
}
},
{
"order": 2,
"rate": 20
}
]
}
]
},
"slabRevenueSummaries": [
{
"order": 1,
"usage": 10,
"revenue": 100
},
{
"order": 2,
"usage": 0,
"revenue": 0
}
]
}
]
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request payload for calculateRevenueAPI
Request to get revenue details
Configuration for getting the currency
Show child attributes
Show child attributes
Configuration for getting the usage rate card
Show child attributes
Show child attributes
Configuration for getting the usage
Show child attributes
Show child attributes
Configuration for getting the license entries
Show child attributes
Show child attributes
Configuration for getting the named license entries
Show child attributes
Show child attributes
Configuration for getting the proration, if not provided no proration will be applied
Show child attributes
Show child attributes
Configuration for getting the entitlement overages
Show child attributes
Show child attributes
Response
Response payload for calculateRevenueAPI
