Create a sub number orders report
Create a CSV report for sub number orders. The report will be generated asynchronously and can be downloaded once complete.
POST
/
sub_number_orders
/
report
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const subNumberOrdersReport = await client.subNumberOrdersReport.create();
console.log(subNumberOrdersReport.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
)
sub_number_orders_report = client.sub_number_orders_report.create()
print(sub_number_orders_report.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"),
)
subNumberOrdersReport, err := client.SubNumberOrdersReport.New(context.TODO(), telnyx.SubNumberOrdersReportNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subNumberOrdersReport.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.subnumberordersreport.SubNumberOrdersReportCreateParams;
import com.telnyx.sdk.models.subnumberordersreport.SubNumberOrdersReportCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SubNumberOrdersReportCreateResponse subNumberOrdersReport = client.subNumberOrdersReport().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
sub_number_orders_report = telnyx.sub_number_orders_report.create
puts(sub_number_orders_report)<?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 {
$subNumberOrdersReport = $client->subNumberOrdersReport->create(
countryCode: 'US',
createdAtGt: new \DateTimeImmutable('2023-04-05T10:22:08.230549Z'),
createdAtLt: new \DateTimeImmutable('2025-06-05T10:22:08.230549Z'),
customerReference: 'STRING',
orderRequestID: '12ade33a-21c0-473b-b055-b3c836e1c293',
status: 'success',
);
var_dump($subNumberOrdersReport);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx sub-number-orders-report create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/sub_number_orders/report \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "success",
"country_code": "US",
"created_at_gt": "2023-04-05T10:22:08.230549Z",
"created_at_lt": "2025-06-05T10:22:08.230549Z",
"order_request_id": "12ade33a-21c0-473b-b055-b3c836e1c293",
"customer_reference": "STRING"
}
'{
"data": {
"order_type": "sub_number_order",
"filters": {
"status": "success",
"country_code": "US",
"created_at_gt": "2023-04-05T10:22:08.230549Z",
"created_at_lt": "2025-06-05T10:22:08.230549Z",
"order_request_id": "991b8ff5-4daf-4826-9a22-e3991b444a9c",
"customer_reference": "STRING"
},
"status": "pending",
"created_at": "2025-06-11T13:21:40.967339+00:00",
"user_id": "0d7ef697-df19-413a-b724-56b0539f5397",
"updated_at": "2025-06-11T13:21:45.753260+00:00",
"id": "cada7e84-122b-4b47-bc66-58c7c3becd40"
}
}{
"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"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Filter by order status
Available options:
pending, success, failure Example:
"success"
Filter by country code
Example:
"US"
Filter for orders created after this date
Example:
"2023-04-05T10:22:08.230549Z"
Filter for orders created before this date
Example:
"2025-06-05T10:22:08.230549Z"
Filter by specific order request ID
Example:
"12ade33a-21c0-473b-b055-b3c836e1c293"
Filter by customer reference
Example:
"STRING"
Response
Sub number orders report response
Show child attributes
Show child attributes
Example:
{
"order_type": "sub_number_order",
"filters": {
"status": "success",
"country_code": "US",
"created_at_gt": "2023-04-05T10:22:08.230549Z",
"created_at_lt": "2025-06-05T10:22:08.230549Z",
"order_request_id": "991b8ff5-4daf-4826-9a22-e3991b444a9c",
"customer_reference": "STRING"
},
"status": "pending",
"created_at": "2025-06-11T13:21:40.967339+00:00",
"user_id": "0d7ef697-df19-413a-b724-56b0539f5397",
"updated_at": "2025-06-11T13:21:45.753260+00:00",
"id": "cada7e84-122b-4b47-bc66-58c7c3becd40"
}
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 subNumberOrdersReport = await client.subNumberOrdersReport.create();
console.log(subNumberOrdersReport.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
)
sub_number_orders_report = client.sub_number_orders_report.create()
print(sub_number_orders_report.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"),
)
subNumberOrdersReport, err := client.SubNumberOrdersReport.New(context.TODO(), telnyx.SubNumberOrdersReportNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subNumberOrdersReport.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.subnumberordersreport.SubNumberOrdersReportCreateParams;
import com.telnyx.sdk.models.subnumberordersreport.SubNumberOrdersReportCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SubNumberOrdersReportCreateResponse subNumberOrdersReport = client.subNumberOrdersReport().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
sub_number_orders_report = telnyx.sub_number_orders_report.create
puts(sub_number_orders_report)<?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 {
$subNumberOrdersReport = $client->subNumberOrdersReport->create(
countryCode: 'US',
createdAtGt: new \DateTimeImmutable('2023-04-05T10:22:08.230549Z'),
createdAtLt: new \DateTimeImmutable('2025-06-05T10:22:08.230549Z'),
customerReference: 'STRING',
orderRequestID: '12ade33a-21c0-473b-b055-b3c836e1c293',
status: 'success',
);
var_dump($subNumberOrdersReport);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx sub-number-orders-report create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/sub_number_orders/report \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "success",
"country_code": "US",
"created_at_gt": "2023-04-05T10:22:08.230549Z",
"created_at_lt": "2025-06-05T10:22:08.230549Z",
"order_request_id": "12ade33a-21c0-473b-b055-b3c836e1c293",
"customer_reference": "STRING"
}
'{
"data": {
"order_type": "sub_number_order",
"filters": {
"status": "success",
"country_code": "US",
"created_at_gt": "2023-04-05T10:22:08.230549Z",
"created_at_lt": "2025-06-05T10:22:08.230549Z",
"order_request_id": "991b8ff5-4daf-4826-9a22-e3991b444a9c",
"customer_reference": "STRING"
},
"status": "pending",
"created_at": "2025-06-11T13:21:40.967339+00:00",
"user_id": "0d7ef697-df19-413a-b724-56b0539f5397",
"updated_at": "2025-06-11T13:21:45.753260+00:00",
"id": "cada7e84-122b-4b47-bc66-58c7c3becd40"
}
}{
"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"
}
}
]
}