Get a price plan
curl --request GET \
--url https://api.togai.com/v2/price_plans/{price_plan_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/v2/price_plans/{price_plan_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/v2/price_plans/{price_plan_id}', 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/v2/price_plans/{price_plan_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/v2/price_plans/{price_plan_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.togai.com/v2/price_plans/{price_plan_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/v2/price_plans/{price_plan_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"name": "<string>",
"type": "BILLING",
"supportedCurrencies": [
"<string>"
],
"id": "<string>",
"referenceId": "<string>",
"version": 123,
"status": "DRAFT",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"pricingCycleConfig": {
"interval": "WEEKLY",
"gracePeriod": 3,
"startOffset": {
"dayOffset": "<string>",
"monthOffset": "<string>"
},
"anniversaryCycle": true
},
"deferredRevenue": true,
"allowOngoingCycleUpdates": true
}Price Plan V2
Get a price plan
Get a price plan
GET
/
v2
/
price_plans
/
{price_plan_id}
Get a price plan
curl --request GET \
--url https://api.togai.com/v2/price_plans/{price_plan_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/v2/price_plans/{price_plan_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/v2/price_plans/{price_plan_id}', 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/v2/price_plans/{price_plan_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/v2/price_plans/{price_plan_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.togai.com/v2/price_plans/{price_plan_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/v2/price_plans/{price_plan_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"name": "<string>",
"type": "BILLING",
"supportedCurrencies": [
"<string>"
],
"id": "<string>",
"referenceId": "<string>",
"version": 123,
"status": "DRAFT",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"pricingCycleConfig": {
"interval": "WEEKLY",
"gracePeriod": 3,
"startOffset": {
"dayOffset": "<string>",
"monthOffset": "<string>"
},
"anniversaryCycle": true
},
"deferredRevenue": true,
"allowOngoingCycleUpdates": true
}Authorizations
Query Parameters
Response
Response for Create and Get price plan requests
Request to create a price plan
This option can be enabled while creating a price plan to opt for deferred revenue finalization. i.e, Togai will assume that the price plan may change any time during the pricing cycle and thereby does not compute the revenue in near-real time. This gives the flexibility of editing rate cards in price plan from beginning of the pricing cycle. Enabling this mode comes with the following limitations.
- Following rate cards are not supported under a
deferredRevenueplan- creditGrantRateCards,
- billingEntitlementRateCards,
- entitlementOverageRateCards,
- IN_ADVANCE fixedFeeRateCards,
- IN_ADVANCE licenseRateCards
- Metrics API return revenue metrics only after the grace period of the account's pricing cycle (i.e, only once the invoice becomes DUE)
