Table of Contents

Interface IPricingClient

Namespace
Vonage.Pricing
Assembly
Vonage.dll

Exposes Pricing API features for retrieving outbound pricing information for SMS and voice services.

public interface IPricingClient

Methods

RetrievePrefixPricingAsync(string, PricingPrefixRequest, Credentials)

Retrieves the pricing information for countries matching a dialing prefix.

Task<PricingResult> RetrievePrefixPricingAsync(string type, PricingPrefixRequest request, Credentials creds = null)

Parameters

type string

The type of service: "sms", "sms-transit", or "voice".

request PricingPrefixRequest

The request containing the dialing prefix. See PricingPrefixRequest.

creds Credentials

Optional credentials to override the default client credentials.

Returns

Task<PricingResult>

A PricingResult containing pricing details for countries matching the prefix.

Examples

var request = new PricingPrefixRequest { Prefix = "44" };
var pricing = await client.PricingClient.RetrievePrefixPricingAsync("sms", request);
foreach (var country in pricing.Countries)
{
    Console.WriteLine($"{country.Name}: {country.DefaultPrice}");
}

RetrievePricingAllCountriesAsync(string, Credentials)

Retrieves the pricing information for all countries.

Task<PricingResult> RetrievePricingAllCountriesAsync(string type, Credentials creds = null)

Parameters

type string

The type of service: "sms", "sms-transit", or "voice".

creds Credentials

Optional credentials to override the default client credentials.

Returns

Task<PricingResult>

A PricingResult containing pricing details for all available countries.

Examples

var pricing = await client.PricingClient.RetrievePricingAllCountriesAsync("voice");
foreach (var country in pricing.Countries)
{
    Console.WriteLine($"{country.Name}: {country.DefaultPrice}");
}

RetrievePricingCountryAsync(string, PricingCountryRequest, Credentials)

Retrieves the pricing information for a specific country.

Task<Country> RetrievePricingCountryAsync(string type, PricingCountryRequest request, Credentials creds = null)

Parameters

type string

The type of service: "sms", "sms-transit", or "voice".

request PricingCountryRequest

The request containing the country code. See PricingCountryRequest.

creds Credentials

Optional credentials to override the default client credentials.

Returns

Task<Country>

A Country containing pricing details and network information for the specified country.

Examples

var request = new PricingCountryRequest { Country = "US" };
var pricing = await client.PricingClient.RetrievePricingCountryAsync("sms", request);
Console.WriteLine($"Country: {pricing.Name}, Default Price: {pricing.DefaultPrice}");