Check out our upcoming events and meetups! View events →
Retrieve a paginated list of invoices.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const invoiceListResponse of client.invoices.list()) {
console.log(invoiceListResponse.file_id);
}{
"meta": {
"total_results": 20,
"total_pages": 1,
"page_number": 1,
"page_size": 20
},
"data": [
{
"invoice_id": "48eff763-ea80-4345-b688-78249eb165a8",
"file_id": "454ea3b0-9eaa-4fa9-992e-6d9f31c0a37e",
"period_start": "2023-11-01",
"period_end": "2023-11-30",
"paid": true,
"url": "https://api.telnyx.com:443/v2/invoices/48eff763-ea80-4345-b688-78249eb165a8"
}
]
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Specifies the sort order for results.
period_start, -period_start "period_start"
Consolidated page parameter (deepObject style). Originally: page[number], page[size]
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const invoiceListResponse of client.invoices.list()) {
console.log(invoiceListResponse.file_id);
}{
"meta": {
"total_results": 20,
"total_pages": 1,
"page_number": 1,
"page_size": 20
},
"data": [
{
"invoice_id": "48eff763-ea80-4345-b688-78249eb165a8",
"file_id": "454ea3b0-9eaa-4fa9-992e-6d9f31c0a37e",
"period_start": "2023-11-01",
"period_end": "2023-11-30",
"paid": true,
"url": "https://api.telnyx.com:443/v2/invoices/48eff763-ea80-4345-b688-78249eb165a8"
}
]
}