Retrieve pricing for a country
Retrieves pricing for a specified country.
API Endpoint
GET
https://api.plivo.com/v1/Account/{auth_id}/Pricing/
Arguments
country_iso required string | The 2 digit country ISO code. For example, US for United States. |
Returns
The Pricing
object.
Origin-based Pricing Update:
Plivo has started charging for outbound calls on the basis of the origin (caller ID) as well now. The corresponding prices are reflected on the pricing page and the Plivo Console but are not yet reflected on our Pricing API. We will be releasing these new prices on our Pricing APIs as well from February 15, 2021 so that you have enough time to update your implementations, if needed. Please check this guide for more details.
Response
HTTP Status Code: 200
{
"api_id": "7ff5505c-93ca-11e7-9bde-024427e23b8a",
"country": "United States",
"country_code": 1,
"country_iso": "US",
"message": {
"inbound": {
"rate": "0.00000"
},
"outbound": {
"rate": "0.00350"
},
"outbound_networks_list": [{
"group_name": "US",
"rate": "0.00350"
},
{
"group_name": "United States - AT&T Mobility",
"rate": "0.00350"
}
]
},
"phone_numbers": {
"local": {
"rate": "0.80000"
},
"tollfree": {
"rate": "1.00000"
}
},
"voice": {
"inbound": {
"ip": {
"rate": "0.00300"
},
"local": {
"rate": "0.00850"
},
"tollfree": {
"rate": "0.02100"
}
},
"outbound": {
"ip": {
"rate": "0.00300"
},
"local": {
"rate": "0.00750"
},
"rates": [{
"prefix": [
"1"
],
"rate": "0.00750"
}],
"tollfree": {
"rate": null
}
}
}
}
Example Request
1
2
3
4
5
6
import plivo
client = plivo.RestClient()
response = client.pricing.get(
country_iso='GB', )
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#
# Example for Pricing Get
#
require 'rubygems'
require 'plivo'
include Plivo
include Plivo::Exceptions
api = RestClient.new("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
begin
response = api.pricings.get(
'GB'
)
puts response
rescue PlivoRESTError => e
puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example for Pricing get
var plivo = require('plivo');
(function main() {
'use strict';
// As the auth_id and auth_token are unspecified, Plivo will fetch them from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables.
var client = new plivo.Client();
client.pricings.get(
"GB", // country iso
).then(function (response) {
console.log(response);
}, function (err) {
console.error(err);
});
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/**
* Example for Pricing get
*/
require 'vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
try {
$response = $client->pricing->get(
'GB'
);
print_r($response);
}
catch (PlivoRestException $ex) {
print_r($ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.plivo.api.samples.pricing;
import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.pricing.Pricing;
import com.plivo.api.models.pricing.Pricing;
/**
* Example for Pricing get
*/
class PricingGet {
public static void main(String [] args) {
Plivo.init();
try {
Pricing response = Pricing.getter("GB")
.get();
System.out.println(response);
} catch (PlivoRestException | IOException e) {
e.printStackTrace();
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* Example for Pricing Get
*/
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;
namespace PlivoExamples
{
internal class Program
{
public static void Main(string[] args)
{
var api = new PlivoApi("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
try
{
var response = api.Pricing.Get(
countryIso:"GB"
);
Console.WriteLine(response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
1
2
curl -i --user auth_id:auth_token \
https://api.plivo.com/v1/Account/{auth_id}/Pricing/?country_iso=US
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Example for Pricing get
package main
import "fmt"
import "github.com/plivo/plivo-go"
func main() {
client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
if err != nil {
panic(err)
}
response, err := client.Pricing.Get(
"GB",
)
if err != nil {
panic(err)
}
fmt.Printf("Response: %#v\n", response)
}
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input for further improvements!
Subscribe to Updates
Thank you for your feedback!