Create a porting order
Creates a new porting order object.
POST
/
porting_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 portingOrder = await client.portingOrders.create({
phone_numbers: ['+13035550000', '+13035550001', '+13035550002'],
});
console.log(portingOrder.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
)
porting_order = client.porting_orders.create(
phone_numbers=["+13035550000", "+13035550001", "+13035550002"],
)
print(porting_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"),
)
portingOrder, err := client.PortingOrders.New(context.TODO(), telnyx.PortingOrderNewParams{
PhoneNumbers: []string{"+13035550000", "+13035550001", "+13035550002"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", portingOrder.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portingorders.PortingOrderCreateParams;
import com.telnyx.sdk.models.portingorders.PortingOrderCreateResponse;
import java.util.List;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PortingOrderCreateParams params = PortingOrderCreateParams.builder()
.phoneNumbers(List.of(
"+13035550000",
"+13035550001",
"+13035550002"
))
.build();
PortingOrderCreateResponse portingOrder = client.portingOrders().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
porting_order = telnyx.porting_orders.create(phone_numbers: ["+13035550000", "+13035550001", "+13035550002"])
puts(porting_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 {
$portingOrder = $client->portingOrders->create(
phoneNumbers: ['+13035550000', '+13035550001', '+13035550002'],
customerGroupReference: 'Group-456',
customerReference: 'Acct 123abc',
);
var_dump($portingOrder);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx porting-orders create \
--api-key 'My API Key' \
--phone-number "'+13035550000'" \
--phone-number "'+13035550001'" \
--phone-number "'+13035550002'"curl --request POST \
--url https://api.telnyx.com/v2/porting_orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"+13035550000",
"+13035550001",
"+13035550002"
],
"customer_reference": "Acct 123abc",
"customer_group_reference": "Group-456"
}
'{
"data": [
{
"activation_settings": {
"activation_status": null,
"fast_port_eligible": true,
"foc_datetime_actual": null,
"foc_datetime_requested": null
},
"created_at": "2022-03-17T18:01:01Z",
"customer_reference": null,
"customer_group_reference": null,
"description": "FP Telnyx",
"documents": {
"loa": null,
"invoice": null
},
"end_user": {
"admin": {
"account_number": null,
"auth_person_name": null,
"billing_phone_number": null,
"business_identifier": null,
"entity_name": null,
"pin_passcode": null,
"tax_identifier": null
},
"location": {
"administrative_area": null,
"country_code": null,
"extended_address": null,
"locality": null,
"postal_code": null,
"street_address": null
}
},
"id": "b0ea6d6f-de31-4079-a536-992e0c98b037",
"misc": null,
"old_service_provider_ocn": "Unreal Communications",
"parent_support_key": null,
"phone_number_configuration": {
"billing_group_id": null,
"connection_id": null,
"emergency_address_id": null,
"messaging_profile_id": null,
"tags": []
},
"phone_number_type": "local",
"phone_numbers": [
{
"activation_status": "Activate RDY",
"phone_number": "{e.164 TN}",
"phone_number_type": "local",
"portability_status": "confirmed",
"porting_order_id": "b0ea6d6f-de31-4079-a536-992e0c98b037",
"porting_order_status": "draft",
"record_type": "porting_phone_number",
"requirements_status": "requirement-info-pending",
"support_key": "sr_10b316"
}
],
"porting_phone_numbers_count": 1,
"record_type": "porting_order",
"requirements": [],
"requirements_met": false,
"status": {
"details": [],
"value": "draft"
},
"support_key": null,
"updated_at": "2022-03-17T18:01:01Z",
"user_feedback": {
"user_comment": null,
"user_rating": null
},
"messaging": {
"messaging_capable": true,
"enable_messaging": false,
"messaging_port_status": "not_applicable",
"messaging_port_completed": false
},
"user_id": "40d68ba2-0847-4df2-be9c-b0e0cb673e75",
"webhook_url": null
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The list of +E.164 formatted phone numbers
Example:
[
"+13035550000",
"+13035550001",
"+13035550002"
]A customer-specified reference number for customer bookkeeping purposes
Example:
"Acct 123abc"
A customer-specified group reference for customer bookkeeping purposes
Example:
"Group-456"
Response
Successful response
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 portingOrder = await client.portingOrders.create({
phone_numbers: ['+13035550000', '+13035550001', '+13035550002'],
});
console.log(portingOrder.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
)
porting_order = client.porting_orders.create(
phone_numbers=["+13035550000", "+13035550001", "+13035550002"],
)
print(porting_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"),
)
portingOrder, err := client.PortingOrders.New(context.TODO(), telnyx.PortingOrderNewParams{
PhoneNumbers: []string{"+13035550000", "+13035550001", "+13035550002"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", portingOrder.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portingorders.PortingOrderCreateParams;
import com.telnyx.sdk.models.portingorders.PortingOrderCreateResponse;
import java.util.List;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PortingOrderCreateParams params = PortingOrderCreateParams.builder()
.phoneNumbers(List.of(
"+13035550000",
"+13035550001",
"+13035550002"
))
.build();
PortingOrderCreateResponse portingOrder = client.portingOrders().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
porting_order = telnyx.porting_orders.create(phone_numbers: ["+13035550000", "+13035550001", "+13035550002"])
puts(porting_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 {
$portingOrder = $client->portingOrders->create(
phoneNumbers: ['+13035550000', '+13035550001', '+13035550002'],
customerGroupReference: 'Group-456',
customerReference: 'Acct 123abc',
);
var_dump($portingOrder);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx porting-orders create \
--api-key 'My API Key' \
--phone-number "'+13035550000'" \
--phone-number "'+13035550001'" \
--phone-number "'+13035550002'"curl --request POST \
--url https://api.telnyx.com/v2/porting_orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"+13035550000",
"+13035550001",
"+13035550002"
],
"customer_reference": "Acct 123abc",
"customer_group_reference": "Group-456"
}
'{
"data": [
{
"activation_settings": {
"activation_status": null,
"fast_port_eligible": true,
"foc_datetime_actual": null,
"foc_datetime_requested": null
},
"created_at": "2022-03-17T18:01:01Z",
"customer_reference": null,
"customer_group_reference": null,
"description": "FP Telnyx",
"documents": {
"loa": null,
"invoice": null
},
"end_user": {
"admin": {
"account_number": null,
"auth_person_name": null,
"billing_phone_number": null,
"business_identifier": null,
"entity_name": null,
"pin_passcode": null,
"tax_identifier": null
},
"location": {
"administrative_area": null,
"country_code": null,
"extended_address": null,
"locality": null,
"postal_code": null,
"street_address": null
}
},
"id": "b0ea6d6f-de31-4079-a536-992e0c98b037",
"misc": null,
"old_service_provider_ocn": "Unreal Communications",
"parent_support_key": null,
"phone_number_configuration": {
"billing_group_id": null,
"connection_id": null,
"emergency_address_id": null,
"messaging_profile_id": null,
"tags": []
},
"phone_number_type": "local",
"phone_numbers": [
{
"activation_status": "Activate RDY",
"phone_number": "{e.164 TN}",
"phone_number_type": "local",
"portability_status": "confirmed",
"porting_order_id": "b0ea6d6f-de31-4079-a536-992e0c98b037",
"porting_order_status": "draft",
"record_type": "porting_phone_number",
"requirements_status": "requirement-info-pending",
"support_key": "sr_10b316"
}
],
"porting_phone_numbers_count": 1,
"record_type": "porting_order",
"requirements": [],
"requirements_met": false,
"status": {
"details": [],
"value": "draft"
},
"support_key": null,
"updated_at": "2022-03-17T18:01:01Z",
"user_feedback": {
"user_comment": null,
"user_rating": null
},
"messaging": {
"messaging_capable": true,
"enable_messaging": false,
"messaging_port_status": "not_applicable",
"messaging_port_completed": false
},
"user_id": "40d68ba2-0847-4df2-be9c-b0e0cb673e75",
"webhook_url": null
}
]
}