Interface IPricingClient
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
typestringThe type of service: "sms", "sms-transit", or "voice".
requestPricingPrefixRequestThe request containing the dialing prefix. See PricingPrefixRequest.
credsCredentialsOptional 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
typestringThe type of service: "sms", "sms-transit", or "voice".
credsCredentialsOptional 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
typestringThe type of service: "sms", "sms-transit", or "voice".
requestPricingCountryRequestThe request containing the country code. See PricingCountryRequest.
credsCredentialsOptional 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}");