Create an inexplicit number order
Create an inexplicit number order to programmatically purchase phone numbers without specifying exact numbers.
POST
/
inexplicit_number_orders
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const inexplicitNumberOrder = await client.inexplicitNumberOrders.create({
ordering_groups: [
{
count_requested: 'count_requested',
country_iso: 'US',
phone_number_type: 'phone_number_type',
},
],
});
console.log(inexplicitNumberOrder.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
inexplicit_number_order = client.inexplicit_number_orders.create(
ordering_groups=[{
"count_requested": "count_requested",
"country_iso": "US",
"phone_number_type": "phone_number_type",
}],
)
print(inexplicit_number_order.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
inexplicitNumberOrder, err := client.InexplicitNumberOrders.New(context.TODO(), telnyx.InexplicitNumberOrderNewParams{
OrderingGroups: []telnyx.InexplicitNumberOrderNewParamsOrderingGroup{{
CountRequested: "count_requested",
CountryISO: "US",
PhoneNumberType: "phone_number_type",
}},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", inexplicitNumberOrder.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.inexplicitnumberorders.InexplicitNumberOrderCreateParams;
import com.telnyx.sdk.models.inexplicitnumberorders.InexplicitNumberOrderCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
InexplicitNumberOrderCreateParams params = InexplicitNumberOrderCreateParams.builder()
.addOrderingGroup(InexplicitNumberOrderCreateParams.OrderingGroup.builder()
.countRequested("count_requested")
.countryIso(InexplicitNumberOrderCreateParams.OrderingGroup.CountryIso.US)
.phoneNumberType("phone_number_type")
.build())
.build();
InexplicitNumberOrderCreateResponse inexplicitNumberOrder = client.inexplicitNumberOrders().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
inexplicit_number_order = telnyx.inexplicit_number_orders.create(
ordering_groups: [{count_requested: "count_requested", country_iso: :US, phone_number_type: "phone_number_type"}]
)
puts(inexplicit_number_order)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$inexplicitNumberOrder = $client->inexplicitNumberOrders->create(
orderingGroups: [
[
'countRequested' => 'count_requested',
'countryISO' => 'US',
'phoneNumberType' => 'phone_number_type',
'administrativeArea' => 'administrative_area',
'excludeHeldNumbers' => true,
'features' => ['string'],
'locality' => 'locality',
'nationalDestinationCode' => 'national_destination_code',
'phoneNumber' => [
'contains' => 'contains',
'endsWith' => 'ends_with',
'startsWith' => 'starts_with',
],
'quickship' => true,
'strategy' => 'always',
],
],
billingGroupID: 'billing_group_id',
connectionID: 'connection_id',
customerReference: 'customer_reference',
messagingProfileID: 'messaging_profile_id',
);
var_dump($inexplicitNumberOrder);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx inexplicit-number-orders create \
--api-key 'My API Key' \
--ordering-group '{count_requested: count_requested, country_iso: US, phone_number_type: phone_number_type}'curl --request POST \
--url https://api.telnyx.com/v2/inexplicit_number_orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ordering_groups": [
{
"count_requested": "<string>",
"phone_number_type": "<string>",
"national_destination_code": "<string>",
"phone_number": {
"starts_with": "<string>",
"ends_with": "<string>",
"contains": "<string>"
},
"administrative_area": "<string>",
"locality": "<string>",
"features": [
"<string>"
],
"strategy": "always",
"quickship": true,
"exclude_held_numbers": true
}
],
"connection_id": "<string>",
"messaging_profile_id": "<string>",
"customer_reference": "<string>",
"billing_group_id": "<string>"
}
'{
"data": {
"id": "<string>",
"connection_id": "<string>",
"messaging_profile_id": "<string>",
"customer_reference": "<string>",
"billing_group_id": "<string>",
"ordering_groups": [
{
"country_iso": "<string>",
"phone_number_type": "<string>",
"count_requested": 123,
"count_allocated": 123,
"national_destination_code": "<string>",
"phone_number[starts_with]": "<string>",
"phone_number[ends_with]": "<string>",
"phone_number[contains]": "<string>",
"administrative_area": "<string>",
"quickship": true,
"exclude_held_numbers": true,
"error_reason": "<string>",
"orders": [
{
"number_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sub_number_order_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Group(s) of numbers to order. You can have multiple ordering_groups objects added to a single request.
Show child attributes
Show child attributes
Connection id to apply to phone numbers that are purchased
Messaging profile id to apply to phone numbers that are purchased
Reference label for the customer
Billing group id to apply to phone numbers that are purchased
Response
Successful response with details about an inexplicit number order.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const inexplicitNumberOrder = await client.inexplicitNumberOrders.create({
ordering_groups: [
{
count_requested: 'count_requested',
country_iso: 'US',
phone_number_type: 'phone_number_type',
},
],
});
console.log(inexplicitNumberOrder.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
inexplicit_number_order = client.inexplicit_number_orders.create(
ordering_groups=[{
"count_requested": "count_requested",
"country_iso": "US",
"phone_number_type": "phone_number_type",
}],
)
print(inexplicit_number_order.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
inexplicitNumberOrder, err := client.InexplicitNumberOrders.New(context.TODO(), telnyx.InexplicitNumberOrderNewParams{
OrderingGroups: []telnyx.InexplicitNumberOrderNewParamsOrderingGroup{{
CountRequested: "count_requested",
CountryISO: "US",
PhoneNumberType: "phone_number_type",
}},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", inexplicitNumberOrder.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.inexplicitnumberorders.InexplicitNumberOrderCreateParams;
import com.telnyx.sdk.models.inexplicitnumberorders.InexplicitNumberOrderCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
InexplicitNumberOrderCreateParams params = InexplicitNumberOrderCreateParams.builder()
.addOrderingGroup(InexplicitNumberOrderCreateParams.OrderingGroup.builder()
.countRequested("count_requested")
.countryIso(InexplicitNumberOrderCreateParams.OrderingGroup.CountryIso.US)
.phoneNumberType("phone_number_type")
.build())
.build();
InexplicitNumberOrderCreateResponse inexplicitNumberOrder = client.inexplicitNumberOrders().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
inexplicit_number_order = telnyx.inexplicit_number_orders.create(
ordering_groups: [{count_requested: "count_requested", country_iso: :US, phone_number_type: "phone_number_type"}]
)
puts(inexplicit_number_order)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$inexplicitNumberOrder = $client->inexplicitNumberOrders->create(
orderingGroups: [
[
'countRequested' => 'count_requested',
'countryISO' => 'US',
'phoneNumberType' => 'phone_number_type',
'administrativeArea' => 'administrative_area',
'excludeHeldNumbers' => true,
'features' => ['string'],
'locality' => 'locality',
'nationalDestinationCode' => 'national_destination_code',
'phoneNumber' => [
'contains' => 'contains',
'endsWith' => 'ends_with',
'startsWith' => 'starts_with',
],
'quickship' => true,
'strategy' => 'always',
],
],
billingGroupID: 'billing_group_id',
connectionID: 'connection_id',
customerReference: 'customer_reference',
messagingProfileID: 'messaging_profile_id',
);
var_dump($inexplicitNumberOrder);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx inexplicit-number-orders create \
--api-key 'My API Key' \
--ordering-group '{count_requested: count_requested, country_iso: US, phone_number_type: phone_number_type}'curl --request POST \
--url https://api.telnyx.com/v2/inexplicit_number_orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ordering_groups": [
{
"count_requested": "<string>",
"phone_number_type": "<string>",
"national_destination_code": "<string>",
"phone_number": {
"starts_with": "<string>",
"ends_with": "<string>",
"contains": "<string>"
},
"administrative_area": "<string>",
"locality": "<string>",
"features": [
"<string>"
],
"strategy": "always",
"quickship": true,
"exclude_held_numbers": true
}
],
"connection_id": "<string>",
"messaging_profile_id": "<string>",
"customer_reference": "<string>",
"billing_group_id": "<string>"
}
'{
"data": {
"id": "<string>",
"connection_id": "<string>",
"messaging_profile_id": "<string>",
"customer_reference": "<string>",
"billing_group_id": "<string>",
"ordering_groups": [
{
"country_iso": "<string>",
"phone_number_type": "<string>",
"count_requested": 123,
"count_allocated": 123,
"national_destination_code": "<string>",
"phone_number[starts_with]": "<string>",
"phone_number[ends_with]": "<string>",
"phone_number[contains]": "<string>",
"administrative_area": "<string>",
"quickship": true,
"exclude_held_numbers": true,
"error_reason": "<string>",
"orders": [
{
"number_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sub_number_order_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}