Skip to main content
POST
/
advanced_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 advancedOrder = await client.advancedOrders.create();

console.log(advancedOrder.id);
{
  "country_code": "US",
  "comments": "",
  "quantity": 1,
  "area_code": "",
  "phone_number_type": "",
  "features": [
    "sms"
  ],
  "customer_reference": "",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": [
    "pending"
  ],
  "orders": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "requirement_group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
country_code
string
default:US
Required string length: 2
comments
string
default:""
Maximum string length: 255
quantity
integer
default:1
Required range: 1 <= x <= 10000
area_code
string
default:""
Maximum string length: 3
phone_number_type
enum<string>
default:local
Available options:
local,
mobile,
toll_free,
shared_cost,
national,
landline
features
enum<string>[]
Available options:
sms,
mms,
voice,
fax,
emergency
customer_reference
string
default:""
requirement_group_id
string<uuid>

The ID of the requirement group to associate with this advanced order

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

Response

An Advanced Order Response

country_code
string
default:US
Required string length: 2
comments
string
default:""
Maximum string length: 255
quantity
integer
default:1
Required range: 1 <= x <= 10000
area_code
string
default:""
Maximum string length: 3
phone_number_type
enum<string>[]
Available options:
local,
mobile,
toll_free,
shared_cost,
national,
landline
features
enum<string>[]
Available options:
sms,
mms,
voice,
fax,
emergency
customer_reference
string
default:""
id
string<uuid>
status
enum<string>[]
Available options:
pending,
processing,
ordered
orders
string<uuid>[]
requirement_group_id
string<uuid>

The ID of the requirement group associated with this advanced order

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"