import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const subNumberOrdersReport = await client.subNumberOrdersReport.create();
console.log(subNumberOrdersReport.data);{
"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"
}
}Create a CSV report for sub number orders. The report will be generated asynchronously and can be downloaded once complete.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const subNumberOrdersReport = await client.subNumberOrdersReport.create();
console.log(subNumberOrdersReport.data);{
"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"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Filter by order status
pending, success, failure "success"
Filter by country code
"US"
Filter for orders created after this date
"2023-04-05T10:22:08.230549Z"
Filter for orders created before this date
"2025-06-05T10:22:08.230549Z"
Filter by specific order request ID
"12ade33a-21c0-473b-b055-b3c836e1c293"
Filter by customer reference
"STRING"
Sub number orders report response
Show child attributes
Identifies the resource.
"cada7e84-122b-4b47-bc66-58c7c3becd40"
The type of order report.
"sub_number_order"
The filters that were applied to generate this report
Show child attributes
"success"
"US"
"2023-04-05T10:22:08.230549Z"
"2025-06-05T10:22:08.230549Z"
"991b8ff5-4daf-4826-9a22-e3991b444a9c"
"STRING"
Indicates the completion level of the sub number orders report. The report must have a status of 'success' before it can be downloaded.
pending, success, failed, expired "pending"
The ID of the user who created the report.
"0d7ef697-df19-413a-b724-56b0539f5397"
ISO 8601 formatted date indicating when the resource was created.
"2025-06-11T13:21:40.967339+00:00"
ISO 8601 formatted date indicating when the resource was updated.
"2025-06-11T13:21:45.753260+00:00"
{
"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?