Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Pricing: Trunking Resource


The Pricing Trunking resource provides a simple API to pull real-time, account-specific pricing for Twilio's Elastic SIP Trunking.

Prices can be retrieved at a country level via the Pricing Trunking Countries resource or for a specific phone number via the Pricing Trunking Numbers resource.

You may also wish to check out our Pricing API resources for Twilio's Voice, Messaging and Phone Number products.

Looking for details on pricing for Twilio products? Check out Twilio's pricing page.


Base URL

All URLs in the reference documentation use the following base URL:


_10
https://pricing.twilio.com/v2/trunking


Authentication

HTTP requests to the REST API are protected with HTTP Basic authentication. To learn more about how Twilio handles authentication, please refer to our security documentation. In short, you will use your Twilio account SID as the username and your auth token as the password for HTTP Basic authentication.


_10
curl -G https://pricing.twilio.com/v2/Trunking/Countries/US \
_10
-u '[YOUR ACCOUNT SID]:[YOUR AUTH TOKEN]'

You can find your account SID and auth token on your dashboard.


Pricing Trunking Country List Resource

Resource URL


_10
https://pricing.twilio.com/v2/Trunking/Countries

This resource returns a list of countries where Twilio trunking services are available and the corresponding URL for retrieving the country specific trunking prices. This list includes paging information.

Example

Retrieve a list of countries where Twilio trunking services are available.

Read Country

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function listTrunkingCountry() {
_16
const countries = await client.pricing.v2.countries.list({ limit: 20 });
_16
_16
countries.forEach((c) => console.log(c.country));
_16
}
_16
_16
listTrunkingCountry();

Output

_18
{
_18
"countries": [
_18
{
_18
"country": "Andorra",
_18
"iso_country": "AD",
_18
"url": "https://pricing.twilio.com/v2/Trunking/Countries/AD"
_18
}
_18
],
_18
"meta": {
_18
"first_page_url": "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=50&Page=0",
_18
"key": "countries",
_18
"next_page_url": null,
_18
"page": 0,
_18
"page_size": 50,
_18
"previous_page_url": null,
_18
"url": "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=50&Page=0"
_18
}
_18
}

Get Prices for Individual Countries

You can also retrieve pricing information for individual countries.

Get Trunking Prices for Individual Countries

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function fetchTrunkingCountry() {
_16
const country = await client.pricing.v2.countries("JZ").fetch();
_16
_16
console.log(country.country);
_16
}
_16
_16
fetchTrunkingCountry();

Output

_69
{
_69
"country": "United States",
_69
"originating_call_prices": [
_69
{
_69
"base_price": null,
_69
"current_price": "0.0085",
_69
"number_type": "local"
_69
},
_69
{
_69
"base_price": null,
_69
"current_price": "0.022",
_69
"number_type": "toll free"
_69
}
_69
],
_69
"iso_country": "JZ",
_69
"terminating_prefix_prices": [
_69
{
_69
"base_price": null,
_69
"current_price": "0.090",
_69
"destination_prefixes": [
_69
"1907"
_69
],
_69
"friendly_name": "Outbound Trunking Minute - United States - Alaska",
_69
"origination_prefixes": [
_69
"ALL"
_69
]
_69
},
_69
{
_69
"base_price": null,
_69
"current_price": "0.013",
_69
"destination_prefixes": [
_69
"1808"
_69
],
_69
"friendly_name": "Outbound Trunking Minute - United States - Hawaii",
_69
"origination_prefixes": [
_69
"ALL"
_69
]
_69
},
_69
{
_69
"base_price": null,
_69
"current_price": "0.013",
_69
"destination_prefixes": [
_69
"1800",
_69
"1844",
_69
"1855",
_69
"1866",
_69
"1877",
_69
"1888"
_69
],
_69
"friendly_name": "Outbound Trunking Minute - United States & Canada - Toll Free",
_69
"origination_prefixes": [
_69
"ALL"
_69
]
_69
},
_69
{
_69
"base_price": null,
_69
"current_price": "0.013",
_69
"destination_prefixes": [
_69
"1"
_69
],
_69
"friendly_name": "Outbound Trunking Minute - United States & Canada",
_69
"origination_prefixes": [
_69
"ALL"
_69
]
_69
}
_69
],
_69
"price_unit": "USD",
_69
"url": "https://pricing.twilio.com/v2/Trunking/Countries/US"
_69
}


Pricing Trunking Country Instance Resource

Resource URL


_10
https://pricing.twilio.com/v2/Trunking/Countries/{Country}

where {Country} is the ISO 3166-1 alpha-2 format country code

This resource represents prices to make trunking calls to phone numbers in a given country, organized by phone number prefix (TerminatingPrefixPriceWithOrigin), and the prices to receive trunking calls on Twilio phone numbers in this country, organized by phone number type (OriginatingCallPrices).

Resource Properties

A Pricing Trunking Country resource is represented by the following properties:

Property nameTypePIIDescription
countrystring
Not PII

The name of the country.


iso_countrystring<iso-country-code>

urlstring<uri>

The absolute URL of the resource.


terminating_prefix_pricesarray[object<outbound-prefix-price-with-origin>]

The list of TerminatingPrefixPrice records.


originating_call_pricesarray[object<inbound-call-price>]

The list of OriginatingCallPrice records.


price_unitstring<currency>

The currency in which prices are measured, specified in ISO 4127 format (e.g. usd, eur, jpy).

TerminatingPrefixPrices record

PropertyDescription
DestinationPrefixesSet of destination phone number prefixes for the requested country with the same pricing
OriginationPrefixesSet of origination phone number prefixes for the requested country with the same pricing. Valid set elements include specific prefixes, ALL (representing the entire set of all valid prefixes), or ROW (representing the rest-of-world, which is the set of remaining prefixes that aren't specifically listed)
FriendlyNameDescriptive text for this set of prefixes
BasePriceIn the current version of the API, this value will always be null
CurrentPriceThe current price per minute (which accounts for any volume or custom price discounts) to make a call to numbers matching this prefix list.

OriginatingCallPrice record

PropertyDescription
NumberTypeThe phone number type, either local, mobile, national, or toll free
BasePriceIn the current version of the API, this value will always be null
CurrentPriceThe current price per minute (which accounts for any volume or custom price discounts) to receive a call to this phone number type.

Pricing Trunking Number Instance Resource

This resource represents the prices to make trunking calls to a given phone number (TerminatingPrefixPrices) and the prices to receive trunking calls to this Twilio phone number (OriginatingCallPrice).

Resource URL


_10
https://pricing.twilio.com/v2/Trunking/Numbers/{Phone Number}

where {Phone Number} is the phone number in E.164 format

Resource Properties

Property nameTypePIIDescription
destination_numberstring<phone-number>

The destination phone number in E.164 format, which consists of a + followed by the country code and subscriber number.


origination_numberstring<phone-number>

The origination phone number in [E.164 format, which consists of a + followed by the country code and subscriber number.


countrystring

The name of the country.


iso_countrystring<iso-country-code>

terminating_prefix_pricesarray[object<outbound-prefix-price-with-origin>]

originating_call_priceobject<inbound-call-price>

price_unitstring<currency>

The currency in which prices are measured, specified in ISO 4127 format (e.g. usd, eur, jpy).


urlstring<uri>

The absolute URL of the resource.

TerminatingCallPrices record

PropertyDescription
BasePriceIn the current version of the API, this value will always be null
CurrentPriceThe current price per minute (which accounts for any volume or custom price discounts) to make a call to this number
OriginationPrefixesSet of origination phone number prefixes for the requested country with the same pricing. Valid set elements include specific prefixes, ALL (representing the entire set of all valid prefixes), or ROW (representing the rest-of-world, which is the set of remaining prefixes that aren't specifically listed)

Example

Retrieve trunking prices for phone number +15108675310.

Fetch Number

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function fetchTrunkingNumber() {
_16
const number = await client.pricing.v2.numbers("+15017122661").fetch();
_16
_16
console.log(number.destinationNumber);
_16
}
_16
_16
fetchTrunkingNumber();

Output

_26
{
_26
"country": "United States",
_26
"destination_number": "+15017122661",
_26
"originating_call_price": {
_26
"base_price": null,
_26
"current_price": null,
_26
"number_type": null
_26
},
_26
"iso_country": "US",
_26
"origination_number": null,
_26
"terminating_prefix_prices": [
_26
{
_26
"base_price": null,
_26
"current_price": "0.013",
_26
"destination_prefixes": [
_26
"1800"
_26
],
_26
"friendly_name": "Trunking Outbound Minute - United States Zone 1b",
_26
"origination_prefixes": [
_26
"ALL"
_26
]
_26
}
_26
],
_26
"price_unit": "USD",
_26
"url": "https://pricing.twilio.com/v2/Trunking/Numbers/+18001234567"
_26
}

Resource URL by Origination Number


_10
https://pricing.twilio.com/v2/Trunking/Numbers/{Destination Number}?OriginationNumber={Origination Number}

Filter by Origination Number Example

Retrieve trunking prices for phone number +15108675310 where the Origination Number is +18001234567.

Get Trunking Prices for Number by Origination Number

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchTrunkingNumber() {
_18
const number = await client.pricing.v2
_18
.numbers("+272335444623")
_18
.fetch({ originationNumber: "+15108675310" });
_18
_18
console.log(number.destinationNumber);
_18
}
_18
_18
fetchTrunkingNumber();

Output

_26
{
_26
"country": "United States",
_26
"destination_number": "+272335444623",
_26
"originating_call_price": {
_26
"base_price": null,
_26
"current_price": null,
_26
"number_type": null
_26
},
_26
"iso_country": "US",
_26
"origination_number": "+15108675310",
_26
"terminating_prefix_prices": [
_26
{
_26
"base_price": null,
_26
"current_price": "0.013",
_26
"destination_prefixes": [
_26
"1800"
_26
],
_26
"friendly_name": "Trunking Outbound Minute - United States Zone 1b",
_26
"origination_prefixes": [
_26
"ALL"
_26
]
_26
}
_26
],
_26
"price_unit": "USD",
_26
"url": "https://pricing.twilio.com/v2/Trunking/Numbers/+18001234567"
_26
}


Rate this page: