curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"object\":\"RatePlan\", \"id\":\"rateplan_1234\", \"description\":\"Combo: Each, Usage, Flat1\", \"multiply_rated_units_by\":\"EachRespectiveTier\", \"rated_unit\":{ \"object\":\"RatedUnit\", \"name_singular\":\"License\", \"name_plural\":\"Licenses\" }, \"tier\":[ { \"object\":\"RatePlanTier\", \"name\":\"Tier 1\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":11, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":1 }, { \"object\":\"RatePlanTier\", \"name\":\"Tier 2\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":50, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":11 } ], \"rounding_decimals\":0, \"included_units\":0, \"minimum_fee\":[ { \"object\":\"RatePlanPrice\", \"amount\":10, \"currency\":\"USD\" } ], \"maximum_fee\":[], \"rate_plan_model\":\"UsageBased\", \"status\":\"Active\", \"has_event_recorded\":true }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}"
payload = "{ \"object\":\"RatePlan\", \"id\":\"rateplan_1234\", \"description\":\"Combo: Each, Usage, Flat1\", \"multiply_rated_units_by\":\"EachRespectiveTier\", \"rated_unit\":{ \"object\":\"RatedUnit\", \"name_singular\":\"License\", \"name_plural\":\"Licenses\" }, \"tier\":[ { \"object\":\"RatePlanTier\", \"name\":\"Tier 1\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":11, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":1 }, { \"object\":\"RatePlanTier\", \"name\":\"Tier 2\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":50, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":11 } ], \"rounding_decimals\":0, \"included_units\":0, \"minimum_fee\":[ { \"object\":\"RatePlanPrice\", \"amount\":10, \"currency\":\"USD\" } ], \"maximum_fee\":[], \"rate_plan_model\":\"UsageBased\", \"status\":\"Active\", \"has_event_recorded\":true }"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify('{ "object":"RatePlan", "id":"rateplan_1234", "description":"Combo: Each, Usage, Flat1", "multiply_rated_units_by":"EachRespectiveTier", "rated_unit":{ "object":"RatedUnit", "name_singular":"License", "name_plural":"Licenses" }, "tier":[ { "object":"RatePlanTier", "name":"Tier 1", "rate_price":[ { "object":"RatePlanPrice", "amount":11, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":1 }, { "object":"RatePlanTier", "name":"Tier 2", "rate_price":[ { "object":"RatePlanPrice", "amount":50, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":11 } ], "rounding_decimals":0, "included_units":0, "minimum_fee":[ { "object":"RatePlanPrice", "amount":10, "currency":"USD" } ], "maximum_fee":[], "rate_plan_model":"UsageBased", "status":"Active", "has_event_recorded":true }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}",
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('{ "object":"RatePlan", "id":"rateplan_1234", "description":"Combo: Each, Usage, Flat1", "multiply_rated_units_by":"EachRespectiveTier", "rated_unit":{ "object":"RatedUnit", "name_singular":"License", "name_plural":"Licenses" }, "tier":[ { "object":"RatePlanTier", "name":"Tier 1", "rate_price":[ { "object":"RatePlanPrice", "amount":11, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":1 }, { "object":"RatePlanTier", "name":"Tier 2", "rate_price":[ { "object":"RatePlanPrice", "amount":50, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":11 } ], "rounding_decimals":0, "included_units":0, "minimum_fee":[ { "object":"RatePlanPrice", "amount":10, "currency":"USD" } ], "maximum_fee":[], "rate_plan_model":"UsageBased", "status":"Active", "has_event_recorded":true }'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}"
payload := strings.NewReader("\"{ \\\"object\\\":\\\"RatePlan\\\", \\\"id\\\":\\\"rateplan_1234\\\", \\\"description\\\":\\\"Combo: Each, Usage, Flat1\\\", \\\"multiply_rated_units_by\\\":\\\"EachRespectiveTier\\\", \\\"rated_unit\\\":{ \\\"object\\\":\\\"RatedUnit\\\", \\\"name_singular\\\":\\\"License\\\", \\\"name_plural\\\":\\\"Licenses\\\" }, \\\"tier\\\":[ { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 1\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":11, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":1 }, { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 2\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":50, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":11 } ], \\\"rounding_decimals\\\":0, \\\"included_units\\\":0, \\\"minimum_fee\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":10, \\\"currency\\\":\\\"USD\\\" } ], \\\"maximum_fee\\\":[], \\\"rate_plan_model\\\":\\\"UsageBased\\\", \\\"status\\\":\\\"Active\\\", \\\"has_event_recorded\\\":true }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"object\\\":\\\"RatePlan\\\", \\\"id\\\":\\\"rateplan_1234\\\", \\\"description\\\":\\\"Combo: Each, Usage, Flat1\\\", \\\"multiply_rated_units_by\\\":\\\"EachRespectiveTier\\\", \\\"rated_unit\\\":{ \\\"object\\\":\\\"RatedUnit\\\", \\\"name_singular\\\":\\\"License\\\", \\\"name_plural\\\":\\\"Licenses\\\" }, \\\"tier\\\":[ { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 1\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":11, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":1 }, { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 2\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":50, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":11 } ], \\\"rounding_decimals\\\":0, \\\"included_units\\\":0, \\\"minimum_fee\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":10, \\\"currency\\\":\\\"USD\\\" } ], \\\"maximum_fee\\\":[], \\\"rate_plan_model\\\":\\\"UsageBased\\\", \\\"status\\\":\\\"Active\\\", \\\"has_event_recorded\\\":true }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "\"{ \\\"object\\\":\\\"RatePlan\\\", \\\"id\\\":\\\"rateplan_1234\\\", \\\"description\\\":\\\"Combo: Each, Usage, Flat1\\\", \\\"multiply_rated_units_by\\\":\\\"EachRespectiveTier\\\", \\\"rated_unit\\\":{ \\\"object\\\":\\\"RatedUnit\\\", \\\"name_singular\\\":\\\"License\\\", \\\"name_plural\\\":\\\"Licenses\\\" }, \\\"tier\\\":[ { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 1\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":11, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":1 }, { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 2\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":50, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":11 } ], \\\"rounding_decimals\\\":0, \\\"included_units\\\":0, \\\"minimum_fee\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":10, \\\"currency\\\":\\\"USD\\\" } ], \\\"maximum_fee\\\":[], \\\"rate_plan_model\\\":\\\"UsageBased\\\", \\\"status\\\":\\\"Active\\\", \\\"has_event_recorded\\\":true }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"RatePlan\", \"id\": \"rateplan_1234\", \"vid\": \"4a276f4854085d7c0b5665f61ecf8988bbfe481d\", \"description\": \"Combo: Each, Usage, Flat1\", \"multiply_rated_units_by\": \"EachRespectiveTier\", \"rated_unit\": { \"object\": \"RatedUnit\", \"name_singular\": \"License\", \"name_plural\": \"Licenses\" }, \"tier\": [ { \"object\": \"RatePlanTier\", \"name\": \"Tier 1\", \"rate_price\": [ { \"object\": \"RatePlanPrice\", \"amount\": 11, \"currency\": \"USD\" } ], \"charge_customer\": \"FlatFee\", \"begins_at_level\": 1 }, { \"object\": \"RatePlanTier\", \"name\": \"Tier 2\", \"rate_price\": [ { \"object\": \"RatePlanPrice\", \"amount\": 50, \"currency\": \"USD\" } ], \"charge_customer\": \"FlatFee\", \"begins_at_level\": 11 } ], \"rounding_decimals\": 0, \"included_units\": 0, \"minimum_fee\": [ { \"object\": \"RatePlanPrice\", \"amount\": 10, \"currency\": \"USD\" } ], \"maximum_fee\": [], \"rate_plan_model\": \"UsageBased\", \"status\": \"Active\", \"has_event_recorded\": false, \"created\": \"2022-07-05T14:57:23+00:00\" }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Update an Existing Rate Plan
Update an existing RatePlan.
Note:- Once a Rate Plan is in use (assigned to at least one Subscription Item with at least one usage Event recorded) most parameters may not be redefined. Pricing and descriptions can always be updated, and will take affect on the next billing of Items using this plan, with the exception of pre-notification guarantees which will be honored for the next billing before changing the price.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"object\":\"RatePlan\", \"id\":\"rateplan_1234\", \"description\":\"Combo: Each, Usage, Flat1\", \"multiply_rated_units_by\":\"EachRespectiveTier\", \"rated_unit\":{ \"object\":\"RatedUnit\", \"name_singular\":\"License\", \"name_plural\":\"Licenses\" }, \"tier\":[ { \"object\":\"RatePlanTier\", \"name\":\"Tier 1\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":11, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":1 }, { \"object\":\"RatePlanTier\", \"name\":\"Tier 2\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":50, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":11 } ], \"rounding_decimals\":0, \"included_units\":0, \"minimum_fee\":[ { \"object\":\"RatePlanPrice\", \"amount\":10, \"currency\":\"USD\" } ], \"maximum_fee\":[], \"rate_plan_model\":\"UsageBased\", \"status\":\"Active\", \"has_event_recorded\":true }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}"
payload = "{ \"object\":\"RatePlan\", \"id\":\"rateplan_1234\", \"description\":\"Combo: Each, Usage, Flat1\", \"multiply_rated_units_by\":\"EachRespectiveTier\", \"rated_unit\":{ \"object\":\"RatedUnit\", \"name_singular\":\"License\", \"name_plural\":\"Licenses\" }, \"tier\":[ { \"object\":\"RatePlanTier\", \"name\":\"Tier 1\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":11, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":1 }, { \"object\":\"RatePlanTier\", \"name\":\"Tier 2\", \"rate_price\":[ { \"object\":\"RatePlanPrice\", \"amount\":50, \"currency\":\"USD\" } ], \"charge_customer\":\"FlatFee\", \"begins_at_level\":11 } ], \"rounding_decimals\":0, \"included_units\":0, \"minimum_fee\":[ { \"object\":\"RatePlanPrice\", \"amount\":10, \"currency\":\"USD\" } ], \"maximum_fee\":[], \"rate_plan_model\":\"UsageBased\", \"status\":\"Active\", \"has_event_recorded\":true }"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify('{ "object":"RatePlan", "id":"rateplan_1234", "description":"Combo: Each, Usage, Flat1", "multiply_rated_units_by":"EachRespectiveTier", "rated_unit":{ "object":"RatedUnit", "name_singular":"License", "name_plural":"Licenses" }, "tier":[ { "object":"RatePlanTier", "name":"Tier 1", "rate_price":[ { "object":"RatePlanPrice", "amount":11, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":1 }, { "object":"RatePlanTier", "name":"Tier 2", "rate_price":[ { "object":"RatePlanPrice", "amount":50, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":11 } ], "rounding_decimals":0, "included_units":0, "minimum_fee":[ { "object":"RatePlanPrice", "amount":10, "currency":"USD" } ], "maximum_fee":[], "rate_plan_model":"UsageBased", "status":"Active", "has_event_recorded":true }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}",
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('{ "object":"RatePlan", "id":"rateplan_1234", "description":"Combo: Each, Usage, Flat1", "multiply_rated_units_by":"EachRespectiveTier", "rated_unit":{ "object":"RatedUnit", "name_singular":"License", "name_plural":"Licenses" }, "tier":[ { "object":"RatePlanTier", "name":"Tier 1", "rate_price":[ { "object":"RatePlanPrice", "amount":11, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":1 }, { "object":"RatePlanTier", "name":"Tier 2", "rate_price":[ { "object":"RatePlanPrice", "amount":50, "currency":"USD" } ], "charge_customer":"FlatFee", "begins_at_level":11 } ], "rounding_decimals":0, "included_units":0, "minimum_fee":[ { "object":"RatePlanPrice", "amount":10, "currency":"USD" } ], "maximum_fee":[], "rate_plan_model":"UsageBased", "status":"Active", "has_event_recorded":true }'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}"
payload := strings.NewReader("\"{ \\\"object\\\":\\\"RatePlan\\\", \\\"id\\\":\\\"rateplan_1234\\\", \\\"description\\\":\\\"Combo: Each, Usage, Flat1\\\", \\\"multiply_rated_units_by\\\":\\\"EachRespectiveTier\\\", \\\"rated_unit\\\":{ \\\"object\\\":\\\"RatedUnit\\\", \\\"name_singular\\\":\\\"License\\\", \\\"name_plural\\\":\\\"Licenses\\\" }, \\\"tier\\\":[ { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 1\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":11, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":1 }, { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 2\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":50, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":11 } ], \\\"rounding_decimals\\\":0, \\\"included_units\\\":0, \\\"minimum_fee\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":10, \\\"currency\\\":\\\"USD\\\" } ], \\\"maximum_fee\\\":[], \\\"rate_plan_model\\\":\\\"UsageBased\\\", \\\"status\\\":\\\"Active\\\", \\\"has_event_recorded\\\":true }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"object\\\":\\\"RatePlan\\\", \\\"id\\\":\\\"rateplan_1234\\\", \\\"description\\\":\\\"Combo: Each, Usage, Flat1\\\", \\\"multiply_rated_units_by\\\":\\\"EachRespectiveTier\\\", \\\"rated_unit\\\":{ \\\"object\\\":\\\"RatedUnit\\\", \\\"name_singular\\\":\\\"License\\\", \\\"name_plural\\\":\\\"Licenses\\\" }, \\\"tier\\\":[ { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 1\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":11, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":1 }, { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 2\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":50, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":11 } ], \\\"rounding_decimals\\\":0, \\\"included_units\\\":0, \\\"minimum_fee\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":10, \\\"currency\\\":\\\"USD\\\" } ], \\\"maximum_fee\\\":[], \\\"rate_plan_model\\\":\\\"UsageBased\\\", \\\"status\\\":\\\"Active\\\", \\\"has_event_recorded\\\":true }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/rate_plans/{rate_plan}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "\"{ \\\"object\\\":\\\"RatePlan\\\", \\\"id\\\":\\\"rateplan_1234\\\", \\\"description\\\":\\\"Combo: Each, Usage, Flat1\\\", \\\"multiply_rated_units_by\\\":\\\"EachRespectiveTier\\\", \\\"rated_unit\\\":{ \\\"object\\\":\\\"RatedUnit\\\", \\\"name_singular\\\":\\\"License\\\", \\\"name_plural\\\":\\\"Licenses\\\" }, \\\"tier\\\":[ { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 1\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":11, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":1 }, { \\\"object\\\":\\\"RatePlanTier\\\", \\\"name\\\":\\\"Tier 2\\\", \\\"rate_price\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":50, \\\"currency\\\":\\\"USD\\\" } ], \\\"charge_customer\\\":\\\"FlatFee\\\", \\\"begins_at_level\\\":11 } ], \\\"rounding_decimals\\\":0, \\\"included_units\\\":0, \\\"minimum_fee\\\":[ { \\\"object\\\":\\\"RatePlanPrice\\\", \\\"amount\\\":10, \\\"currency\\\":\\\"USD\\\" } ], \\\"maximum_fee\\\":[], \\\"rate_plan_model\\\":\\\"UsageBased\\\", \\\"status\\\":\\\"Active\\\", \\\"has_event_recorded\\\":true }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"RatePlan\", \"id\": \"rateplan_1234\", \"vid\": \"4a276f4854085d7c0b5665f61ecf8988bbfe481d\", \"description\": \"Combo: Each, Usage, Flat1\", \"multiply_rated_units_by\": \"EachRespectiveTier\", \"rated_unit\": { \"object\": \"RatedUnit\", \"name_singular\": \"License\", \"name_plural\": \"Licenses\" }, \"tier\": [ { \"object\": \"RatePlanTier\", \"name\": \"Tier 1\", \"rate_price\": [ { \"object\": \"RatePlanPrice\", \"amount\": 11, \"currency\": \"USD\" } ], \"charge_customer\": \"FlatFee\", \"begins_at_level\": 1 }, { \"object\": \"RatePlanTier\", \"name\": \"Tier 2\", \"rate_price\": [ { \"object\": \"RatePlanPrice\", \"amount\": 50, \"currency\": \"USD\" } ], \"charge_customer\": \"FlatFee\", \"begins_at_level\": 11 } ], \"rounding_decimals\": 0, \"included_units\": 0, \"minimum_fee\": [ { \"object\": \"RatePlanPrice\", \"amount\": 10, \"currency\": \"USD\" } ], \"maximum_fee\": [], \"rate_plan_model\": \"UsageBased\", \"status\": \"Active\", \"has_event_recorded\": false, \"created\": \"2022-07-05T14:57:23+00:00\" }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The id or the vid of the RatePlan to retrieve
Query Parameters
If set to true, allows updating a Rate Plan the is in use (assigned to at least one Subscription item with at lease one usage Event recorded)
Body
JSON - This request supports the same arguments as ‘create’ (a full Rate Plan object) excepting the behavior of the id; providing an id or vid in the URL indicates to Subscribe that this is an update, not a create – as such, id and vid cannot be updated.
Rate Plans represents a pre-defined rating schedule - tier-based pricing for rated products (e.g. usage). Both pre-paid (aka License-based) and post-paid (metered, aka usage-based) services use pre-defined tiers to rate recorded events. Rate Plans support flat and per-unit pricing, volume discounts, standard consumption-based prices, included units with overage, and maximum/minimum charge limits.
Value is "RatePlan"
RatePlan A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The date/time the object was created.
Optional description of the rated service offering.
Tier pricing rule. EachRespective charges units “in” that tier at its price; HighestApplicable is volume pricing, charging at the peak unit level’s tier for all units. Values can be EachRespectiveTier,HighestApplicableTier.
EachRespectiveTier, HighestApplicableTier Defined rating unit of measure.
Show child attributes
Show child attributes
Successive pricing tiers based on unit “from/to” limits
Show child attributes
Show child attributes
Number of digits for rounding; Excel’s ROUND function- 0 = nearest integer, 2 = 2 decimal places, -2 means = nearest hundred, etc.
Number of units included for free; tier 1 starts after included units have been recorded.
Minimum charge per billing period (one price per currency)
Show child attributes
Show child attributes
Maximum charge per billing period (one price per currency)
Show child attributes
Show child attributes
Determines pre-paid (licenses or seats billed in advance) or post-paid (usage recorded throughout the period and billed at period end. Values can be LicenseBased,UsageBased
LicenseBased, UsageBased Merchants may define whether they want to declare a plan as available to offer. Values can be Active,Suspended.
Active, Suspended Read-only field that tells whether this RatePlan has had any events recorded on it or not.
A set of key/value pairs that you can attach to an object. Useful for storing additional information.
Response
JSON A full RatePlan object.
Rate Plans represents a pre-defined rating schedule - tier-based pricing for rated products (e.g. usage). Both pre-paid (aka License-based) and post-paid (metered, aka usage-based) services use pre-defined tiers to rate recorded events. Rate Plans support flat and per-unit pricing, volume discounts, standard consumption-based prices, included units with overage, and maximum/minimum charge limits.
Value is "RatePlan"
RatePlan A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The date/time the object was created.
Optional description of the rated service offering.
Tier pricing rule. EachRespective charges units “in” that tier at its price; HighestApplicable is volume pricing, charging at the peak unit level’s tier for all units. Values can be EachRespectiveTier,HighestApplicableTier.
EachRespectiveTier, HighestApplicableTier Defined rating unit of measure.
Show child attributes
Show child attributes
Successive pricing tiers based on unit “from/to” limits
Show child attributes
Show child attributes
Number of digits for rounding; Excel’s ROUND function- 0 = nearest integer, 2 = 2 decimal places, -2 means = nearest hundred, etc.
Number of units included for free; tier 1 starts after included units have been recorded.
Minimum charge per billing period (one price per currency)
Show child attributes
Show child attributes
Maximum charge per billing period (one price per currency)
Show child attributes
Show child attributes
Determines pre-paid (licenses or seats billed in advance) or post-paid (usage recorded throughout the period and billed at period end. Values can be LicenseBased,UsageBased
LicenseBased, UsageBased Merchants may define whether they want to declare a plan as available to offer. Values can be Active,Suspended.
Active, Suspended Read-only field that tells whether this RatePlan has had any events recorded on it or not.
A set of key/value pairs that you can attach to an object. Useful for storing additional information.

