curl --request POST \
--url https://api.togai.com/price_plans/{price_plan_id}/currencies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "USD",
"usageRates": [
{
"usageMeterId": "um.1zYnCiM9Bpg.1zYn",
"slabRates": [
{
"order": 0,
"rate": 100,
"config": {
"minimumValue": 0
}
}
]
}
]
}
'import requests
url = "https://api.togai.com/price_plans/{price_plan_id}/currencies"
payload = {
"currency": "USD",
"usageRates": [
{
"usageMeterId": "um.1zYnCiM9Bpg.1zYn",
"slabRates": [
{
"order": 0,
"rate": 100,
"config": { "minimumValue": 0 }
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'USD',
usageRates: [
{
usageMeterId: 'um.1zYnCiM9Bpg.1zYn',
slabRates: [{order: 0, rate: 100, config: {minimumValue: 0}}]
}
]
})
};
fetch('https://api.togai.com/price_plans/{price_plan_id}/currencies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/price_plans/{price_plan_id}/currencies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'USD',
'usageRates' => [
[
'usageMeterId' => 'um.1zYnCiM9Bpg.1zYn',
'slabRates' => [
[
'order' => 0,
'rate' => 100,
'config' => [
'minimumValue' => 0
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/price_plans/{price_plan_id}/currencies"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"usageRates\": [\n {\n \"usageMeterId\": \"um.1zYnCiM9Bpg.1zYn\",\n \"slabRates\": [\n {\n \"order\": 0,\n \"rate\": 100,\n \"config\": {\n \"minimumValue\": 0\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.togai.com/price_plans/{price_plan_id}/currencies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"usageRates\": [\n {\n \"usageMeterId\": \"um.1zYnCiM9Bpg.1zYn\",\n \"slabRates\": [\n {\n \"order\": 0,\n \"rate\": 100,\n \"config\": {\n \"minimumValue\": 0\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/price_plans/{price_plan_id}/currencies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"usageRates\": [\n {\n \"usageMeterId\": \"um.1zYnCiM9Bpg.1zYn\",\n \"slabRates\": [\n {\n \"order\": 0,\n \"rate\": 100,\n \"config\": {\n \"minimumValue\": 0\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "pp.20sieTc1u2i.fY8AT",
"name": "grantCheck",
"type": "BILLING",
"status": "ACTIVE",
"pricingSchedule": [
{
"id": "sch.20sieTcdnQ0.ZmseL",
"startDate": "1970-01-01T00:00:00Z",
"endDate": "9999-01-01T00:00:00Z",
"version": 1,
"pricePlanDetails": {
"supportedCurrencies": [
"USD"
],
"activeCurrencies": [
"USD"
],
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "1",
"monthOffset": "NIL"
},
"gracePeriod": 1,
"anniversaryCycle": false
},
"usageRateCards": [
{
"displayName": "rr1",
"usageMeterId": "um.20Ms65CtgMy.nwFP0",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "FLAT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 10,
"slabRateConfig": {}
}
]
}
],
"tag": "1"
}
],
"fixedFeeRateCards": [
{
"id": "addon.20sidL2HJ7o.vvzDT",
"rateValues": [
{
"currency": "USD",
"rate": 50
}
],
"enableProration": false,
"displayName": "normal",
"tag": "1",
"invoiceTiming": "IN_ARREARS",
"type": "RECURRING",
"recurrenceConfig": {
"interval": null,
"offset": null
}
},
{
"id": "addon.20sidQxYRjs.4oBSU",
"rateValues": [
{
"currency": "USD",
"rate": 10
}
],
"enableProration": false,
"displayName": "anotherNormal",
"tag": "2",
"invoiceTiming": "IN_ARREARS",
"type": "RECURRING",
"recurrenceConfig": {
"interval": null,
"offset": null
}
},
{
"id": "addon.20sidzySWoa.Bzrcc",
"rateValues": [
{
"currency": "USD",
"rate": 40
}
],
"enableProration": false,
"displayName": "inadvance",
"tag": "1",
"invoiceTiming": "IN_ADVANCE",
"type": "RECURRING",
"recurrenceConfig": {
"interval": null,
"offset": null
}
}
],
"licenseRateCards": [
{
"id": "addon.20darMuJ6C8.bdgRj",
"enableProration": false,
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "FLAT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 15,
"slabRateConfig": {}
}
]
}
],
"displayName": "license",
"tag": "2",
"config": {
"maxQuantity": null
}
}
],
"billingEntitlementRateCards": [
{
"featureId": "feature.20jxa18BdUW.d4XQw",
"featureConfigs": [
{
"featureCreditLimit": 100,
"effectiveUntil": "P20D"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 1,
"slabRateConfig": null
}
]
}
],
"displayName": "feature1",
"tag": null
},
{
"featureId": "feature.20uE1xqEudk.MMVH8",
"featureConfigs": [
{
"featureCreditLimit": 200,
"effectiveUntil": "P20D"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 2,
"slabRateConfig": null
}
]
}
],
"displayName": "feature2",
"tag": null
}
],
"minimumCommitment": {
"displayName": "Minimum Commitment",
"rateValues": [
{
"currency": "USD",
"rate": 0
}
]
},
"rateDetails": null,
"entitlementRateCards": null,
"creditGrantRateCards": [
{
"id": "addon.20ufMNoJoAC.TUzRi",
"type": "RECURRING",
"displayName": "Credit2",
"rateDetails": {
"pricingModel": "TIERED",
"currencySlabRateDetails": [
{
"currency": "USD",
"creditAmount": 100,
"slabDetails": [
{
"startAfter": 0,
"priceType": "FLAT",
"rate": 10
}
]
}
]
},
"grantDetails": {
"priority": 1,
"expiryType": "PRICING_CYCLE",
"applicableEntityIds": []
},
"invoiceTiming": "IN_ARREARS",
"recurrenceConfig": {
"offset": 0,
"interval": 1
}
},
{
"id": "addon.20ufMNoJoAC.TUzRi",
"type": "RECURRING",
"displayName": "Credit2",
"rateDetails": {
"pricingModel": "TIERED",
"currencySlabRateDetails": [
{
"currency": "USD",
"slabDetails": [
{
"rate": 11,
"endAt": null,
"priceType": "FLAT",
"startAfter": 0,
"slabConfig": {},
"slabRateConfig": {}
}
],
"creditAmount": 11
},
{
"currency": "INR",
"slabDetails": [
{
"rate": 11,
"endAt": null,
"priceType": "FLAT",
"startAfter": 0,
"slabConfig": {},
"slabRateConfig": {}
}
],
"creditAmount": 11
}
]
},
"grantDetails": {
"priority": 1,
"expiryType": "PRICING_CYCLE",
"expiryDuration": null,
"applicableEntityIds": []
},
"invoiceTiming": "IN_ARREARS",
"recurrenceConfig": {
"offset": 0,
"interval": 1
}
}
],
"type": "BILLING"
}
}
],
"description": null
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Add currencies to a price plan
Add currencies to a price plan
curl --request POST \
--url https://api.togai.com/price_plans/{price_plan_id}/currencies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "USD",
"usageRates": [
{
"usageMeterId": "um.1zYnCiM9Bpg.1zYn",
"slabRates": [
{
"order": 0,
"rate": 100,
"config": {
"minimumValue": 0
}
}
]
}
]
}
'import requests
url = "https://api.togai.com/price_plans/{price_plan_id}/currencies"
payload = {
"currency": "USD",
"usageRates": [
{
"usageMeterId": "um.1zYnCiM9Bpg.1zYn",
"slabRates": [
{
"order": 0,
"rate": 100,
"config": { "minimumValue": 0 }
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'USD',
usageRates: [
{
usageMeterId: 'um.1zYnCiM9Bpg.1zYn',
slabRates: [{order: 0, rate: 100, config: {minimumValue: 0}}]
}
]
})
};
fetch('https://api.togai.com/price_plans/{price_plan_id}/currencies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/price_plans/{price_plan_id}/currencies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'USD',
'usageRates' => [
[
'usageMeterId' => 'um.1zYnCiM9Bpg.1zYn',
'slabRates' => [
[
'order' => 0,
'rate' => 100,
'config' => [
'minimumValue' => 0
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/price_plans/{price_plan_id}/currencies"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"usageRates\": [\n {\n \"usageMeterId\": \"um.1zYnCiM9Bpg.1zYn\",\n \"slabRates\": [\n {\n \"order\": 0,\n \"rate\": 100,\n \"config\": {\n \"minimumValue\": 0\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.togai.com/price_plans/{price_plan_id}/currencies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"usageRates\": [\n {\n \"usageMeterId\": \"um.1zYnCiM9Bpg.1zYn\",\n \"slabRates\": [\n {\n \"order\": 0,\n \"rate\": 100,\n \"config\": {\n \"minimumValue\": 0\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/price_plans/{price_plan_id}/currencies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"usageRates\": [\n {\n \"usageMeterId\": \"um.1zYnCiM9Bpg.1zYn\",\n \"slabRates\": [\n {\n \"order\": 0,\n \"rate\": 100,\n \"config\": {\n \"minimumValue\": 0\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "pp.20sieTc1u2i.fY8AT",
"name": "grantCheck",
"type": "BILLING",
"status": "ACTIVE",
"pricingSchedule": [
{
"id": "sch.20sieTcdnQ0.ZmseL",
"startDate": "1970-01-01T00:00:00Z",
"endDate": "9999-01-01T00:00:00Z",
"version": 1,
"pricePlanDetails": {
"supportedCurrencies": [
"USD"
],
"activeCurrencies": [
"USD"
],
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "1",
"monthOffset": "NIL"
},
"gracePeriod": 1,
"anniversaryCycle": false
},
"usageRateCards": [
{
"displayName": "rr1",
"usageMeterId": "um.20Ms65CtgMy.nwFP0",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "FLAT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 10,
"slabRateConfig": {}
}
]
}
],
"tag": "1"
}
],
"fixedFeeRateCards": [
{
"id": "addon.20sidL2HJ7o.vvzDT",
"rateValues": [
{
"currency": "USD",
"rate": 50
}
],
"enableProration": false,
"displayName": "normal",
"tag": "1",
"invoiceTiming": "IN_ARREARS",
"type": "RECURRING",
"recurrenceConfig": {
"interval": null,
"offset": null
}
},
{
"id": "addon.20sidQxYRjs.4oBSU",
"rateValues": [
{
"currency": "USD",
"rate": 10
}
],
"enableProration": false,
"displayName": "anotherNormal",
"tag": "2",
"invoiceTiming": "IN_ARREARS",
"type": "RECURRING",
"recurrenceConfig": {
"interval": null,
"offset": null
}
},
{
"id": "addon.20sidzySWoa.Bzrcc",
"rateValues": [
{
"currency": "USD",
"rate": 40
}
],
"enableProration": false,
"displayName": "inadvance",
"tag": "1",
"invoiceTiming": "IN_ADVANCE",
"type": "RECURRING",
"recurrenceConfig": {
"interval": null,
"offset": null
}
}
],
"licenseRateCards": [
{
"id": "addon.20darMuJ6C8.bdgRj",
"enableProration": false,
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "FLAT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 15,
"slabRateConfig": {}
}
]
}
],
"displayName": "license",
"tag": "2",
"config": {
"maxQuantity": null
}
}
],
"billingEntitlementRateCards": [
{
"featureId": "feature.20jxa18BdUW.d4XQw",
"featureConfigs": [
{
"featureCreditLimit": 100,
"effectiveUntil": "P20D"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 1,
"slabRateConfig": null
}
]
}
],
"displayName": "feature1",
"tag": null
},
{
"featureId": "feature.20uE1xqEudk.MMVH8",
"featureConfigs": [
{
"featureCreditLimit": 200,
"effectiveUntil": "P20D"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 2,
"slabRateConfig": null
}
]
}
],
"displayName": "feature2",
"tag": null
}
],
"minimumCommitment": {
"displayName": "Minimum Commitment",
"rateValues": [
{
"currency": "USD",
"rate": 0
}
]
},
"rateDetails": null,
"entitlementRateCards": null,
"creditGrantRateCards": [
{
"id": "addon.20ufMNoJoAC.TUzRi",
"type": "RECURRING",
"displayName": "Credit2",
"rateDetails": {
"pricingModel": "TIERED",
"currencySlabRateDetails": [
{
"currency": "USD",
"creditAmount": 100,
"slabDetails": [
{
"startAfter": 0,
"priceType": "FLAT",
"rate": 10
}
]
}
]
},
"grantDetails": {
"priority": 1,
"expiryType": "PRICING_CYCLE",
"applicableEntityIds": []
},
"invoiceTiming": "IN_ARREARS",
"recurrenceConfig": {
"offset": 0,
"interval": 1
}
},
{
"id": "addon.20ufMNoJoAC.TUzRi",
"type": "RECURRING",
"displayName": "Credit2",
"rateDetails": {
"pricingModel": "TIERED",
"currencySlabRateDetails": [
{
"currency": "USD",
"slabDetails": [
{
"rate": 11,
"endAt": null,
"priceType": "FLAT",
"startAfter": 0,
"slabConfig": {},
"slabRateConfig": {}
}
],
"creditAmount": 11
},
{
"currency": "INR",
"slabDetails": [
{
"rate": 11,
"endAt": null,
"priceType": "FLAT",
"startAfter": 0,
"slabConfig": {},
"slabRateConfig": {}
}
],
"creditAmount": 11
}
]
},
"grantDetails": {
"priority": 1,
"expiryType": "PRICING_CYCLE",
"expiryDuration": null,
"applicableEntityIds": []
},
"invoiceTiming": "IN_ARREARS",
"recurrenceConfig": {
"offset": 0,
"interval": 1
}
}
],
"type": "BILLING"
}
}
],
"description": null
}{
"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.
Path Parameters
50"pp.1zYnCiM9Bpg.lv25y"
Body
Payload to add currency to price plan
Request to adding currency to a price plan
Currency to be added
List of usage rates
Show child attributes
Show child attributes
Rates for fixed fee rate cards
Show child attributes
Show child attributes
Rates for license rate cards
Show child attributes
Show child attributes
Rates for billing entitlement rate cards
Show child attributes
Show child attributes
Rates for minimum commitment.
List of slab rates
Show child attributes
Show child attributes
Rates for credit grant rate card
Show child attributes
Show child attributes
Rates for entitlement overage rate cards
Show child attributes
Show child attributes
Response
Response for Create and Get price plan requests
Price plan entity
Price plan id
Name of the price plan
50Type of price plan
ENTITLEMENT, BILLING, PURCHASE Status of Price plan
DRAFT, ACTIVE, ARCHIVED Show child attributes
Show child attributes
Description of price plan
255