import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const chargesBreakdown = await client.chargesBreakdown.retrieve({ start_date: '2025-05-01' });
console.log(chargesBreakdown.data);{
"data": {
"user_id": "0db0b4aa-a83d-4d4f-ad9b-3ba7c1ac2ce8",
"start_date": "2025-05-01",
"end_date": "2025-06-01",
"user_email": "user@example.com",
"currency": "USD",
"results": [
{
"tn": "+15551234567",
"charge_type": "local",
"service_owner_user_id": "0db0b4aa-a83d-4d4f-ad9b-3ba7c1ac2ce8",
"service_owner_email": "user@example.com",
"services": [
{
"cost_type": "MRC",
"name": "Local DIDs",
"cost": "1.50"
}
]
}
]
}
}Retrieve a detailed breakdown of monthly charges for phone numbers in a specified date range. The date range cannot exceed 31 days.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const chargesBreakdown = await client.chargesBreakdown.retrieve({ start_date: '2025-05-01' });
console.log(chargesBreakdown.data);{
"data": {
"user_id": "0db0b4aa-a83d-4d4f-ad9b-3ba7c1ac2ce8",
"start_date": "2025-05-01",
"end_date": "2025-06-01",
"user_email": "user@example.com",
"currency": "USD",
"results": [
{
"tn": "+15551234567",
"charge_type": "local",
"service_owner_user_id": "0db0b4aa-a83d-4d4f-ad9b-3ba7c1ac2ce8",
"service_owner_email": "user@example.com",
"services": [
{
"cost_type": "MRC",
"name": "Local DIDs",
"cost": "1.50"
}
]
}
]
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Start date for the charges breakdown in ISO date format (YYYY-MM-DD)
"2025-05-01"
End date for the charges breakdown in ISO date format (YYYY-MM-DD). If not provided, defaults to start_date + 1 month. The date is exclusive, data for the end_date itself is not included in the report. The interval between start_date and end_date cannot exceed 31 days.
"2025-06-01"
Response format
json, csv "json"
Monthly charges breakdown
Show child attributes
User identifier
"0db0b4aa-a83d-4d4f-ad9b-3ba7c1ac2ce8"
Start date of the breakdown period
"2025-05-01"
End date of the breakdown period
"2025-06-01"
User email address
"user@example.com"
Currency code
"USD"
List of phone number charge breakdowns
Show child attributes
Phone number
"+15551234567"
Type of charge for the number
"local"
User ID of the service owner
"0db0b4aa-a83d-4d4f-ad9b-3ba7c1ac2ce8"
Email address of the service owner
"user@example.com"
List of services associated with this number
Was this page helpful?