import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
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);{
"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,
"status": "pending",
"national_destination_code": "<string>",
"phone_number[starts_with]": "<string>",
"phone_number[ends_with]": "<string>",
"phone_number[contains]": "<string>",
"administrative_area": "<string>",
"strategy": "always",
"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"
}
}Create an inexplicit number order to programmatically purchase phone numbers without specifying exact numbers.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
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);{
"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,
"status": "pending",
"national_destination_code": "<string>",
"phone_number[starts_with]": "<string>",
"phone_number[ends_with]": "<string>",
"phone_number[contains]": "<string>",
"administrative_area": "<string>",
"strategy": "always",
"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"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Group(s) of numbers to order. You can have multiple ordering_groups objects added to a single request.
Show child attributes
Country where you would like to purchase phone numbers. Allowable values: US, CA
US, CA Quantity of phone numbers to order
Number type (local, toll-free, etc.)
Filter by area code
Phone number search criteria
Show child attributes
Filter for phone numbers in a given state / province
Filter for phone numbers in a given city / region / rate center
Filter for phone numbers that have the features to satisfy your use case (e.g., ["voice"])
Ordering strategy. Define what action should be taken if we don't have enough phone numbers to fulfill your request. Allowable values are: always = proceed with ordering phone numbers, regardless of current inventory levels; never = do not place any orders unless there are enough phone numbers to satisfy the request. If not specified, the always strategy will be enforced.
always, never 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
Successful response with details about an inexplicit number order.
Show child attributes
Unique identifier for the inexplicit number order
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
Show child attributes
Country where you would like to purchase phone numbers
Number type
Quantity of phone numbers requested
Quantity of phone numbers allocated
Status of the ordering group
pending, processing, failed, success, partial_success Filter by area code
Filter by the starting digits of the phone number
Filter by the ending digits of the phone number
Filter for phone numbers that contain the digits specified
Filter for phone numbers in a given state / province
Ordering strategy used
always, never Error reason if applicable
ISO 8601 formatted date indicating when the ordering group was created
ISO 8601 formatted date indicating when the ordering group was updated
ISO 8601 formatted date indicating when the resource was created
ISO 8601 formatted date indicating when the resource was updated
Was this page helpful?