# Pricing: Trunking Resource

The **Pricing Trunking** resource provides a simple API to pull real-time, account-specific pricing for Twilio's [Elastic SIP Trunking](/docs/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](/docs/voice/pricing), [Messaging](/docs/messaging/api/pricing) and [Phone Number](/docs/phone-numbers/pricing) products.

*Looking for details on pricing for Twilio products? Check out Twilio's [pricing page](https://www.twilio.com/en-us/pricing).*

## Base URL

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

```bash
https://pricing.twilio.com/v2/trunking
```

## Authentication

To authenticate requests to the Twilio APIs, Twilio supports [HTTP Basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). Use your *API key* as the username and your *API key secret* as the password. You can create an API key either [in the Twilio Console](/docs/iam/api-keys/keys-in-console) or [using the API](/docs/iam/api-keys/key-resource-v1).

**Note**: Twilio recommends using API keys for authentication in production apps. For local testing, you can use your Account SID as the username and your Auth token as the password. You can find your Account SID and Auth Token in the [Twilio Console](https://www.twilio.com/console).

Learn more about [Twilio API authentication](/docs/usage/requests-to-twilio).

```bash
curl -G https://pricing.twilio.com/v2/Trunking/Countries/US \
    -u $TWILIO_API_KEY:$TWILIO_API_KEY_SECRET
```

## Pricing Trunking Country List Resource \[#pricing-trunking-country-list]

### Resource URL \[#list-uri]

```bash
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][paging].

### Example

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

Read Country

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listTrunkingCountry() {
  const countries = await client.pricing.v2.countries.list({ limit: 20 });

  countries.forEach((c) => console.log(c.country));
}

listTrunkingCountry();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

countries = client.pricing.v2.countries.list(limit=20)

for record in countries:
    print(record.country)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Pricing.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var countries = await CountryResource.ReadAsync(limit: 20);

        foreach (var record in countries) {
            Console.WriteLine(record.Country);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.pricing.v2.Country;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Country> countries = Country.reader().limit(20).read();

        for (Country record : countries) {
            System.out.println(record.getCountry());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	pricing "github.com/twilio/twilio-go/rest/pricing/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &pricing.ListTrunkingCountryParams{}
	params.SetLimit(20)

	resp, err := client.PricingV2.ListTrunkingCountry(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Country != nil {
				fmt.Println(*resp[record].Country)
			} else {
				fmt.Println(resp[record].Country)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$countries = $twilio->pricing->v2->countries->read(20);

foreach ($countries as $record) {
    print $record->country;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

countries = @client
            .pricing
            .v2
            .countries
            .list(limit: 20)

countries.each do |record|
   puts record.country
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:pricing:v2:trunking:countries:list
```

```bash
curl -X GET "https://pricing.twilio.com/v2/Trunking/Countries?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

### Get Prices for Individual Countries

You can also retrieve pricing information for individual countries.

Get Trunking Prices for Individual Countries

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchTrunkingCountry() {
  const country = await client.pricing.v2.countries("BB").fetch();

  console.log(country.country);
}

fetchTrunkingCountry();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

country = client.pricing.v2.countries("BB").fetch()

print(country.country)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Pricing.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var country = await CountryResource.FetchAsync(pathIsoCountry: "BB");

        Console.WriteLine(country.Country);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.pricing.v2.Country;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Country country = Country.fetcher("BB").fetch();

        System.out.println(country.getCountry());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.PricingV2.FetchTrunkingCountry("BB")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Country != nil {
			fmt.Println(*resp.Country)
		} else {
			fmt.Println(resp.Country)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$country = $twilio->pricing->v2->countries("BB")->fetch();

print $country->country;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

country = @client
          .pricing
          .v2
          .countries('BB')
          .fetch

puts country.country
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:pricing:v2:trunking:countries:fetch \
   --iso-country BB
```

```bash
curl -X GET "https://pricing.twilio.com/v2/Trunking/Countries/BB" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

## Pricing Trunking Country Instance Resource \[#pricing-trunking-country-instance]

### Resource URL \[#list-uri-2]

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

```

where \{Country} is the [ISO 3166-1 alpha-2 format][iso3166] 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 \[#instance-properties]

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

```json
{"type":"object","refName":"pricing.v2.trunking_country","modelName":"pricing_v2_trunking_country","properties":{"country":{"type":"string","nullable":true,"description":"The name of the country."},"iso_country":{"type":"string","format":"iso-country-code","nullable":true,"description":"The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)."},"url":{"type":"string","format":"uri","nullable":true,"description":"The absolute URL of the resource."},"terminating_prefix_prices":{"type":"array","items":{"type":"object","format":"outbound-prefix-price-with-origin","properties":{"origination_prefixes":{"type":"array","items":{"type":"string"}},"destination_prefixes":{"type":"array","items":{"type":"string"}},"base_price":{"type":"number","x-twilio":{"overrideType":"string"}},"current_price":{"type":"number","x-twilio":{"overrideType":"string"}},"friendly_name":{"type":"string"}}},"nullable":true,"description":"The list of [TerminatingPrefixPrice](/docs/voice/pricing#outbound-prefix-price-with-origin) records."},"originating_call_prices":{"type":"array","items":{"type":"object","format":"inbound-call-price","properties":{"base_price":{"type":"number","x-twilio":{"overrideType":"string"}},"current_price":{"type":"number","x-twilio":{"overrideType":"string"}},"number_type":{"type":"string"}}},"nullable":true,"description":"The list of [OriginatingCallPrice](/docs/voice/pricing#inbound-call-price) records."},"price_unit":{"type":"string","format":"currency","nullable":true,"description":"The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`)."}}}
```

### TerminatingPrefixPrices record \[#terminating-prefix-prices]

| Property            | Description                                                                                                                                                                                                                                                                                                          |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DestinationPrefixes | Set of destination phone number prefixes for the requested country with the same pricing                                                                                                                                                                                                                             |
| OriginationPrefixes | Set 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) |
| FriendlyName        | Descriptive text for this set of prefixes                                                                                                                                                                                                                                                                            |
| BasePrice           | In the current version of the API, this value will always be null                                                                                                                                                                                                                                                    |
| CurrentPrice        | The 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 \[#originating-call-price]

| Property     | Description                                                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| NumberType   | The phone number type, either `local`, `mobile`, `national`, or `toll free`                                                         |
| BasePrice    | In the current version of the API, this value will always be null                                                                   |
| CurrentPrice | The 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 \[#pricing-trunking-number-instance]

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 \[#list-uri-3]

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

```

where \{Phone Number} is the phone number in [E.164][e164] format

### Resource Properties \[#instance-properties]

```json
{"type":"object","refName":"pricing.v2.trunking_number","modelName":"pricing_v2_trunking_number","properties":{"destination_number":{"type":"string","format":"phone-number","nullable":true,"description":"The destination phone number in [E.164](/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number."},"origination_number":{"type":"string","format":"phone-number","nullable":true,"description":"The origination phone number in [[E.164](/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number."},"country":{"type":"string","nullable":true,"description":"The name of the country."},"iso_country":{"type":"string","format":"iso-country-code","nullable":true,"description":"The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)"},"terminating_prefix_prices":{"type":"array","nullable":true,"items":{"type":"object","format":"outbound-prefix-price-with-origin","properties":{"origination_prefixes":{"type":"array","items":{"type":"string"}},"destination_prefixes":{"type":"array","items":{"type":"string"}},"base_price":{"type":"number","x-twilio":{"overrideType":"string"}},"current_price":{"type":"number","x-twilio":{"overrideType":"string"}},"friendly_name":{"type":"string"}}}},"originating_call_price":{"type":"object","format":"inbound-call-price","nullable":true,"description":"The [OriginatingCallPrice](/docs/voice/pricing#inbound-call-price) record.","properties":{"base_price":{"type":"number","x-twilio":{"overrideType":"string"}},"current_price":{"type":"number","x-twilio":{"overrideType":"string"}},"number_type":{"type":"string"}}},"price_unit":{"type":"string","format":"currency","nullable":true,"description":"The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`)."},"url":{"type":"string","format":"uri","nullable":true,"description":"The absolute URL of the resource."}}}
```

### TerminatingCallPrices record \[#terminating-call-prices]

| Property            | Description                                                                                                                                                                                                                                                                                                          |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BasePrice           | In the current version of the API, this value will always be null                                                                                                                                                                                                                                                    |
| CurrentPrice        | The current price per minute (which accounts for any volume or custom price discounts) to make a call to this number                                                                                                                                                                                                 |
| OriginationPrefixes | Set 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 \[#example-2]

Retrieve trunking prices for phone number `+15108675310`.

Fetch Number

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchTrunkingNumber() {
  const number = await client.pricing.v2.numbers("+15017122661").fetch();

  console.log(number.destinationNumber);
}

fetchTrunkingNumber();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

number = client.pricing.v2.numbers("+15017122661").fetch()

print(number.destination_number)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Pricing.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var number = await NumberResource.FetchAsync(
            pathDestinationNumber: new Twilio.Types.PhoneNumber("+15017122661"));

        Console.WriteLine(number.DestinationNumber);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.type.PhoneNumber;
import com.twilio.Twilio;
import com.twilio.rest.pricing.v2.Number;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Number number = Number.fetcher(new com.twilio.type.PhoneNumber("+15017122661")).fetch();

        System.out.println(number.getDestinationNumber());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	pricing "github.com/twilio/twilio-go/rest/pricing/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &pricing.FetchTrunkingNumberParams{}

	resp, err := client.PricingV2.FetchTrunkingNumber("+15017122661",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.DestinationNumber != nil {
			fmt.Println(*resp.DestinationNumber)
		} else {
			fmt.Println(resp.DestinationNumber)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$number = $twilio->pricing->v2->numbers("+15017122661")->fetch();

print $number->destinationNumber;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

number = @client
         .pricing
         .v2
         .numbers('+15017122661')
         .fetch

puts number.destination_number
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:pricing:v2:trunking:numbers:fetch \
   --destination-number +15017122661
```

```bash
curl -X GET "https://pricing.twilio.com/v2/Trunking/Numbers/%2B15017122661" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

### Resource URL by Origination Number \[#list-uri-by-origination-number]

```bash
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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchTrunkingNumber() {
  const number = await client.pricing.v2
    .numbers("+11111111111")
    .fetch({ originationNumber: "+15108675310" });

  console.log(number.destinationNumber);
}

fetchTrunkingNumber();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

number = client.pricing.v2.numbers("+11111111111").fetch(
    origination_number="+15108675310"
)

print(number.destination_number)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Pricing.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var number = await NumberResource.FetchAsync(
            pathDestinationNumber: new Twilio.Types.PhoneNumber("+11111111111"),
            originationNumber: new Twilio.Types.PhoneNumber("+15108675310"));

        Console.WriteLine(number.DestinationNumber);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.type.PhoneNumber;
import com.twilio.Twilio;
import com.twilio.rest.pricing.v2.Number;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Number number = Number.fetcher(new com.twilio.type.PhoneNumber("+11111111111"))
                            .setOriginationNumber(new com.twilio.type.PhoneNumber("+15108675310"))
                            .fetch();

        System.out.println(number.getDestinationNumber());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	pricing "github.com/twilio/twilio-go/rest/pricing/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &pricing.FetchTrunkingNumberParams{}
	params.SetOriginationNumber("+15108675310")

	resp, err := client.PricingV2.FetchTrunkingNumber("+11111111111",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.DestinationNumber != nil {
			fmt.Println(*resp.DestinationNumber)
		} else {
			fmt.Println(resp.DestinationNumber)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$number = $twilio->pricing->v2
    ->numbers("+11111111111")
    ->fetch(["originationNumber" => "+15108675310"]);

print $number->destinationNumber;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

number = @client
         .pricing
         .v2
         .numbers('+11111111111')
         .fetch(origination_number: '+15108675310')

puts number.destination_number
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:pricing:v2:trunking:numbers:fetch \
   --destination-number +11111111111 \
   --origination-number +15108675310
```

```bash
curl -X GET "https://pricing.twilio.com/v2/Trunking/Numbers/%2B11111111111?OriginationNumber=%2B15108675310" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

[paging]: /docs/usage/twilios-response#pagination

[e164]: https://en.wikipedia.org/wiki/E.164

[iso3166]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
