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": {},
"pricingCycleOrdinal": 1
},
"usageConfig": {
"mode": "CUSTOM",
"usageMap": {
"um.1zcgWalbM2y.qaX5j": 100
}
},
"entitlementOverageConfig": {
"mode": "CUSTOM",
"custom": [
{
"featureId": "feature.1122.ahoiud",
"quantity": 5
},
{
"featureId": "feature.3452.abcaf2",
"quantity": 28
}
]
}
}'
{
"currency": "USD",
"revenueInfo": [
{
"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
}
]
}
]
}
},
{
"revenueSummary": {
"usages": {
"um.fdjal.kdajf": 10
},
"slabRevenues": [
{
"order": 1,
"usage": 10,
"revenue": 100
},
{
"order": 2,
"usage": 0,
"revenue": 0
}
]
}
}
]
}
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": {},
"pricingCycleOrdinal": 1
},
"usageConfig": {
"mode": "CUSTOM",
"usageMap": {
"um.1zcgWalbM2y.qaX5j": 100
}
},
"entitlementOverageConfig": {
"mode": "CUSTOM",
"custom": [
{
"featureId": "feature.1122.ahoiud",
"quantity": 5
},
{
"featureId": "feature.3452.abcaf2",
"quantity": 28
}
]
}
}'
{
"currency": "USD",
"revenueInfo": [
{
"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
}
]
}
]
}
},
{
"revenueSummary": {
"usages": {
"um.fdjal.kdajf": 10
},
"slabRevenues": [
{
"order": 1,
"usage": 10,
"revenue": 100
},
{
"order": 2,
"usage": 0,
"revenue": 0
}
]
}
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Request payload for calculateRevenueAPI
Request to get revenue details
Response payload for calculateRevenueAPI
The response is of type object
.