curl --request POST \
--url https://api.valyx.com/billing/ratecard \
--header 'Content-Type: application/json' \
--header 'X-Valyx-Signature: <x-valyx-signature>' \
--data '
{
"name": "<string>",
"feeComponentId": "<string>"
}
'import requests
url = "https://api.valyx.com/billing/ratecard"
payload = {
"name": "<string>",
"feeComponentId": "<string>"
}
headers = {
"X-Valyx-Signature": "<x-valyx-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Valyx-Signature': '<x-valyx-signature>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', feeComponentId: '<string>'})
};
fetch('https://api.valyx.com/billing/ratecard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'X-Valyx-Signature': '<x-valyx-signature>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', feeComponentId: '<string>'})
};
fetch('https://api.valyx.com/billing/ratecard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valyx.com/billing/ratecard"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Valyx-Signature", "<x-valyx-signature>")
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.valyx.com/billing/ratecard")
.header("X-Valyx-Signature", "<x-valyx-signature>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyx.com/billing/ratecard",
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([
'name' => '<string>',
'feeComponentId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Valyx-Signature: <x-valyx-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.valyx.com/billing/ratecard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Valyx-Signature"] = '<x-valyx-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"name": "<string>",
"feeComponentId": "<string>"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.valyx.com/billing/ratecard")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"X-Valyx-Signature": "<x-valyx-signature>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}")
val request = Request.Builder()
.url("https://api.valyx.com/billing/ratecard")
.post(body)
.addHeader("X-Valyx-Signature", "<x-valyx-signature>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()using RestSharp;
var options = new RestClientOptions("https://api.valyx.com/billing/ratecard");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Valyx-Signature", "<x-valyx-signature>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"error": "<string>",
"message": "<string>",
"data": {
"id": "<string>"
}
}Create Ratecard
curl --request POST \
--url https://api.valyx.com/billing/ratecard \
--header 'Content-Type: application/json' \
--header 'X-Valyx-Signature: <x-valyx-signature>' \
--data '
{
"name": "<string>",
"feeComponentId": "<string>"
}
'import requests
url = "https://api.valyx.com/billing/ratecard"
payload = {
"name": "<string>",
"feeComponentId": "<string>"
}
headers = {
"X-Valyx-Signature": "<x-valyx-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Valyx-Signature': '<x-valyx-signature>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', feeComponentId: '<string>'})
};
fetch('https://api.valyx.com/billing/ratecard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'X-Valyx-Signature': '<x-valyx-signature>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', feeComponentId: '<string>'})
};
fetch('https://api.valyx.com/billing/ratecard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valyx.com/billing/ratecard"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Valyx-Signature", "<x-valyx-signature>")
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.valyx.com/billing/ratecard")
.header("X-Valyx-Signature", "<x-valyx-signature>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyx.com/billing/ratecard",
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([
'name' => '<string>',
'feeComponentId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Valyx-Signature: <x-valyx-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.valyx.com/billing/ratecard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Valyx-Signature"] = '<x-valyx-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"name": "<string>",
"feeComponentId": "<string>"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.valyx.com/billing/ratecard")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"X-Valyx-Signature": "<x-valyx-signature>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}")
val request = Request.Builder()
.url("https://api.valyx.com/billing/ratecard")
.post(body)
.addHeader("X-Valyx-Signature", "<x-valyx-signature>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()using RestSharp;
var options = new RestClientOptions("https://api.valyx.com/billing/ratecard");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Valyx-Signature", "<x-valyx-signature>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"feeComponentId\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"error": "<string>",
"message": "<string>",
"data": {
"id": "<string>"
}
}Rate Card Description
- Flat Fee
- Per Unit Fee
- Volume Based
- Graduated
- Billing Scheme (Required)- defines type of the rate card being used. Should be passed as
FIXED_RATEfor flat fee rate card. - Fixed Price(Required) - Fixed price that is to be charged irrespective of usage
{
"billingScheme": "FIXED_RATE",
"fixedPrice": 100
}
- Billing Scheme (Required)- defines type of the rate card being used. Should be passed as
PER_UNITfor per unit fee rate card. - Per Unit Price (Required) - Fixed price that is to be charged per unit of usage.
- Is Percentage (Optional) - Determines if the rate is a percentage of usage value. Default to False.
| Per Unit Price | Is Percentage | Usage Value | Amount Charged |
|---|---|---|---|
| 10 | False | 50 | 500 |
| 10 | False | 50 | 5 |
{
"billingScheme": "PER_UNIT",
"perUnitPrice": 10,
"isPercentage": False
}
- Billing Scheme (Required)- defines type of the rate card being used. Should be passed as
VOLUMEfor volume based rate card. - Tiers (Required) - Defines different tiers in the rate card -
- Name (Required) - Name of the tier
- UpTo (Required) - The upper usage limit of the tier (inclusive)
- Unit Price (Required) - Price per usage for this tier
- Flat Price (Optional) - Additional flat fee charged for this tier
- Is Percentage (Optional) - Determines if the rate is a percentage of usage value. Default to False.
- Repeat Tier (Optional) - If set to true, all the immediately following tiers will be ignored and this tier will be repeated at the same interval all the way to infinity. Defaults to False.
{
"billingScheme": "VOLUME",
"tiers": [
{
"name": "10_rs_for_quantity_below_100",
"upTo": 100,
"unitPrice": 10,
"flatPrice": 50
}, {
"name": "8_rs_for_quantity_above_100_but_less_than_500",
"upTo": 500,
"unitPrice": 8
}, {
"name": "2_percent_for_quantity_above_500",
"upTo": infinity,
"unitPrice": 2,
"isPercentage": True
}
]
}
- Billing Scheme (Required)- defines type of the rate card being used. Should be passed as
GRADUATEDfor volume based rate card. - Tiers (Required) - Defines different tiers in the rate card -
- Name (Required) - Name of the tier
- UpTo (Required) - The upper usage limit of the tier (inclusive)
- Unit Price (Required) - Price per usage for this tier
- Flat Price (Optional) - Additional flat fee charged for this tier
- Is Percentage (Optional) - Determines if the rate is a percentage of usage value. Default to False.
- Repeat Tier (Optional) - If set to true, all the immediately following tiers will be ignored and this tier will be repeated at the same interval all the way to infinity. Defaults to False.
{
"billingScheme": "GRADUATED",
"tiers": [
{
"name": "10_rs_for_quantity_below_100",
"upTo": 100,
"unitPrice": 10,
"flatPrice": 50
}, {
"name": "8_rs_for_quantity_above_100_but_less_than_500",
"upTo": 500,
"unitPrice": 8
}, {
"name": "2_percent_for_quantity_above_500",
"upTo": infinity,
"unitPrice": 2,
"isPercentage": True
}
]
}
Headers
Auth key to authenticate the request
Body
The name of the rate card.
Identifier of the fee component associated with this rate card.
Pricing strategy details for the rate card, including billing scheme, tiers, and prorated settings.
Currency used for this rate card. Must be a valid ISO 4217 currency code. See: https://www.iso.org/iso-4217-currency-codes.html
"INR"
Optional currency identifier if multiple currencies are supported.
Custom key-value tags for categorizing or labeling the rate card. Multiple key-value pairs can be added dynamically.
Show child attributes
Show child attributes
Detailed description of the rate card, visible to users. See: https://docs.valyx.com/api-reference/endpoint/ratecard#rate-card-description
Optional associated contract ID for this rate card.
Indicates whether this rate card is the default for the company.
Indicates if tier-wise split pricing is enabled. Only valid for graduated billing schemes.
Optional start date of the rate card.
Optional end date of the rate card.
Required if the rate card has start or end dates; used as fallback for timed rate cards.