> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telzino.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Billing Report

> Returns billing data with voice minutes and agent counts for organizations

## Query Parameters

<ParamField query="start_date" type="string" required>
  Start date in ISO format (YYYY-MM-DD).

  **Example:** `2025-01-01`
</ParamField>

<ParamField query="end_date" type="string" required>
  End date in ISO format (YYYY-MM-DD).

  **Example:** `2025-01-31`
</ParamField>

<ParamField query="reseller_ids" type="string">
  Filter by reseller IDs. Can be comma-separated or passed as array parameters.

  **Example:** `reseller_ids=id1,id2` or `reseller_ids[]=id1&reseller_ids[]=id2`
</ParamField>

<ParamField query="organization_ids" type="string">
  Filter by organization IDs. Can be comma-separated or passed as array parameters.

  **Example:** `organization_ids=id1,id2`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.telzino.com/v1/billing-report?start_date=2025-01-01&end_date=2025-01-31" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.telzino.com/v1/billing-report?start_date=2025-01-01&end_date=2025-01-31',
    { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } }
  );

  const { data, period } = await response.json();

  // Process billing data
  data.forEach(item => {
    console.log(`${item.organization_name}: ${item.voice_minutes} minutes, ${item.agent_count} agents`);
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.telzino.com/v1/billing-report',
      params={
          'start_date': '2025-01-01',
          'end_date': '2025-01-31'
      },
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
  )

  data = response.json()

  # Process billing data
  for item in data['data']:
      print(f"{item['organization_name']}: {item['voice_minutes']} minutes")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "organization_id": "123e4567-e89b-12d3-a456-426614174000",
        "organization_name": "Acme Solar",
        "reseller_id": "987fcdeb-51a2-3bc4-d567-890123456789",
        "reseller_name": "Partner Corp",
        "voice_minutes": 1250.5,
        "agent_count": 5
      },
      {
        "organization_id": "456e7890-e89b-12d3-a456-426614174001",
        "organization_name": "Best Plumbing",
        "reseller_id": "987fcdeb-51a2-3bc4-d567-890123456789",
        "reseller_name": "Partner Corp",
        "voice_minutes": 890.25,
        "agent_count": 3
      }
    ],
    "period": {
      "start_date": "01/01/2025",
      "end_date": "01/31/2025"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "invalid_request",
    "details": [
      {"path": ["start_date"], "message": "Invalid date format (use YYYY-MM-DD)"}
    ]
  }
  ```

  ```json 401 theme={null}
  {
    "error": "unauthorized",
    "error_description": "User payload not found"
  }
  ```
</ResponseExample>

## Response Fields

### Data Array

| Field               | Type   | Description                            |
| ------------------- | ------ | -------------------------------------- |
| `organization_id`   | string | Organization UUID                      |
| `organization_name` | string | Display name of the organization       |
| `reseller_id`       | string | Parent reseller UUID                   |
| `reseller_name`     | string | Display name of the reseller           |
| `voice_minutes`     | number | Total voice minutes used in the period |
| `agent_count`       | number | Number of agents active in the period  |

### Period Object

| Field        | Type   | Description                          |
| ------------ | ------ | ------------------------------------ |
| `start_date` | string | Start date in US format (MM/DD/YYYY) |
| `end_date`   | string | End date in US format (MM/DD/YYYY)   |

<Note>
  **Date Format:** Input dates use ISO format (YYYY-MM-DD), but response dates are returned in US format (MM/DD/YYYY).
</Note>
