Skip to main content
POST
/
v2
/
price_plans
/
{price_plan_id}
/
rate_cards
Bulk rate card operations of a price plan
curl --request POST \
  --url https://api.togai.com/v2/price_plans/{price_plan_id}/rate_cards \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "operations": [
    {
      "rateCardName": "<string>"
    }
  ]
}
'
import requests

url = "https://api.togai.com/v2/price_plans/{price_plan_id}/rate_cards"

payload = { "operations": [{ "rateCardName": "<string>" }] }
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({operations: [{rateCardName: '<string>'}]})
};

fetch('https://api.togai.com/v2/price_plans/{price_plan_id}/rate_cards', 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}/rate_cards",
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([
'operations' => [
[
'rateCardName' => '<string>'
]
]
]),
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/v2/price_plans/{price_plan_id}/rate_cards"

payload := strings.NewReader("{\n \"operations\": [\n {\n \"rateCardName\": \"<string>\"\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/v2/price_plans/{price_plan_id}/rate_cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"rateCardName\": \"<string>\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.togai.com/v2/price_plans/{price_plan_id}/rate_cards")

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 \"operations\": [\n {\n \"rateCardName\": \"<string>\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "rateCards": [
    {
      "billableId": "<string>",
      "displayName": "<string>",
      "rateCardDetails": {
        "fixedFeeRateCard": {
          "id": "<string>",
          "rateValues": [
            {
              "currency": "<string>",
              "rate": 123
            }
          ],
          "enableProration": false,
          "displayName": "<string>",
          "name": "<string>",
          "tag": "<string>",
          "recurrenceConfig": {
            "interval": 3,
            "offset": 5
          }
        },
        "billingEntitlementRateCard": {
          "featureId": "<string>",
          "featureConfigs": [
            {
              "effectiveUntil": "<string>",
              "featureCreditLimit": 1,
              "effectiveFrom": "<string>"
            }
          ],
          "ratePlan": {
            "slabs": [
              {
                "order": 5,
                "startAfter": 123,
                "slabConfig": {}
              }
            ]
          },
          "rateValues": [
            {
              "currency": "<string>",
              "slabRates": [
                {
                  "order": 123,
                  "rate": 123,
                  "slabRateConfig": {}
                }
              ],
              "rateConfig": {}
            }
          ],
          "tag": "<string>",
          "displayName": "<string>",
          "name": "<string>",
          "recurrenceConfig": {
            "interval": 3,
            "offset": 5
          }
        },
        "creditGrantRateCard": {
          "id": "<string>",
          "grantDetails": {
            "priority": 1,
            "expiryDuration": "<string>",
            "applicableEntityIds": [
              "<string>"
            ]
          },
          "rateDetails": {
            "currencySlabRateDetails": [
              {
                "currency": "<string>",
                "creditAmount": 1,
                "slabDetails": [
                  {
                    "startAfter": 123,
                    "rate": 123,
                    "slabConfig": {},
                    "slabRateConfig": {}
                  }
                ],
                "rateConfig": {}
              }
            ]
          },
          "displayName": "<string>",
          "name": "<string>",
          "tag": "<string>",
          "recurrenceConfig": {
            "interval": 3,
            "offset": 5
          }
        },
        "usageRateCard": {
          "usageMeterId": "um.1zYnCiM9Bpg.1zYn",
          "ratePlan": {
            "slabs": [
              {
                "order": 5,
                "startAfter": 123,
                "slabConfig": {}
              }
            ]
          },
          "rateValues": [
            {
              "currency": "<string>",
              "slabRates": [
                {
                  "order": 123,
                  "rate": 123,
                  "slabRateConfig": {}
                }
              ],
              "rateConfig": {}
            }
          ],
          "displayName": "<string>",
          "name": "<string>",
          "tag": "<string>"
        },
        "licenseRateCard": {
          "id": "<string>",
          "enableProration": false,
          "ratePlan": {
            "slabs": [
              {
                "order": 5,
                "startAfter": 123,
                "slabConfig": {}
              }
            ]
          },
          "rateValues": [
            {
              "currency": "<string>",
              "slabRates": [
                {
                  "order": 123,
                  "rate": 123,
                  "slabRateConfig": {}
                }
              ],
              "rateConfig": {}
            }
          ],
          "displayName": "<string>",
          "name": "<string>",
          "tag": "<string>",
          "config": {
            "maxQuantity": 100,
            "maxQuantityBreachAction": "DO_NOTHING"
          }
        },
        "entitlementOverageRateCard": {
          "featureId": "<string>",
          "ratePlan": {
            "slabs": [
              {
                "order": 5,
                "startAfter": 123,
                "slabConfig": {}
              }
            ]
          },
          "rateValues": [
            {
              "currency": "<string>",
              "slabRates": [
                {
                  "order": 123,
                  "rate": 123,
                  "slabRateConfig": {}
                }
              ],
              "rateConfig": {}
            }
          ],
          "displayName": "<string>",
          "name": "<string>",
          "tag": "<string>",
          "maxQuantity": 123,
          "billingConfig": {
            "interval": 3,
            "startOffset": 5
          }
        },
        "minimumCommitmentRateCard": {
          "displayName": "<string>",
          "rateValues": [
            {
              "currency": "<string>",
              "rate": 123
            }
          ]
        }
      },
      "name": "<string>",
      "referenceId": "<string>",
      "referenceType": "<string>",
      "pricePlanId": "<string>",
      "tag": "<string>",
      "currencies": [
        "<string>"
      ],
      "accountId": "<string>"
    }
  ]
}
{
"message": "<Reason message>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

price_plan_id
string
required
Maximum string length: 50
Example:

"pp.1zYnCiM9Bpg.lv25y"

Body

application/json

Payload to bulk rate card operations

Bulk rate card operations for price plan

operations
object[]
required

Response

Response for bulk rate card operations of a price plan

Bulk rate card operations response

rateCards
object[]
required