# Accounting fields

The `accountingDetail` dataset of the GraphQL API returns the usage Azion accounted for your account, per region, for each period, product, and metric. The accounting endpoint, `https://api.azion.com/v4/accounting/graphql`, serves it to a `POST` request with the header `Authorization: Token [TOKEN VALUE]`. The arguments a query accepts are on [Datasets and query arguments](/en/documentation/devtools/graphql/features/).

---

## accountingDetail

A query on `accountingDetail` returns only the fields it selects, from the table below:

| Field           | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Example                                              |
| --------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `billId`        | Int    | Unique identifier of the bill.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | —                                                    |
| `clientId`      | String | Unique identifier of the client on Azion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `1234u`                                              |
| `periodFrom`    | Date   | Start date of the accounted data, in year-month-day format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | `2026-09-01`                                         |
| `periodTo`      | Date   | End date of the accounted data, in year-month-day format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `2026-09-30`                                         |
| `invoiceNumber` | String | Unique identifier of the invoice generated for the client bill.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | —                                                    |
| `productSlug`   | String | Identifier of the accounted product. Values include `application`, `content_delivery`, `application_acceleration`, `edge_firewall`, `waf`, `live_ingest`, `load_balancer`, `image_optimization`, `ddos_protection_20gbps`, `ddos_protection_50gbps`, `ddos_protection_unlimited`, `ddos_protection_data_transferred`, `support_enterprise`, `support_mission_critical`, `realtime_events`, `data_streaming`, `edge_functions`, `intelligent_dns`, `layer_two_cache`, `plan_business`, `plan_enterprise`, `plan_missioncritical`, `edge_storage`, `bot_manager`, `connector`, `workload`, `cache`, `support_developer`, `support`, and `support_fee`. | `application`                                        |
| `metricSlug`    | String | Identifier of the accounted metric. For more information, refer to [Terms of Service](/en/documentation/agreements/tos/#21-billing-metrics).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | `data_transferred`, `load_balancer_data_transferred` |
| `regionName`    | String | Region the metric was accounted to: `United States`, `Canada`, `Europe`, `Brazil`, `Latam`, `All Other Regions`, or `No Region`. For more information, refer to [Pricing](/en/documentation/fundamentals/pricing/).                                                                                                                                                                                                                                                                                                                                                                                                                                  | `All Other Regions`                                  |
| `accounted`     | Float  | Total usage of the product accounted per region in the bill detail of the client.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | `0.007995243`                                        |

When a query sets the `aggregate` argument, the dataset also returns the output fields `count`, `sum`, `max`, `min`, and `avg`. For more information, refer to [Queries](/en/documentation/devtools/graphql/queries/).

---

## Example query

An `accountingDetail` query needs no filter. This query returns the latest accounted rows, sorted by `periodFrom`, latest first:

```graphql
query {
  accountingDetail(limit: 5, orderBy: [periodFrom_DESC]) {
    clientId
    periodFrom
    periodTo
    productSlug
    metricSlug
    regionName
    accounted
  }
}
```

The response holds five rows, cut here after the third:

```json
{
  "data": {
    "accountingDetail": [
      {
        "clientId": "1234u",
        "periodFrom": "2026-10-01",
        "periodTo": "2026-10-01",
        "productSlug": "application",
        "metricSlug": "data_transferred",
        "regionName": "All Other Regions",
        "accounted": 0.0
      },
      {
        "clientId": "1234u",
        "periodFrom": "2026-10-01",
        "periodTo": "2026-10-01",
        "productSlug": "application",
        "metricSlug": "data_transferred",
        "regionName": "Latam",
        "accounted": 0.0
      },
      {
        "clientId": "1234u",
        "periodFrom": "2026-10-01",
        "periodTo": "2026-10-01",
        "productSlug": "application",
        "metricSlug": "data_transferred",
        "regionName": "Canada",
        "accounted": 0.0
      },
      …
    ]
  }
}
```

---

## Related resources

- [Queries](/en/documentation/devtools/graphql/queries.md): The query shape of each kind of data, with an accounted-data query for one month and its response.
- [Billing fields](/en/documentation/devtools/graphql/gql-billing-fields.md): The fields of the billing datasets, which return the billed amounts of each period.
- [Datasets and query arguments](/en/documentation/devtools/graphql/features.md): The datasets of each endpoint and the filter, sort, and pagination arguments a query accepts.
- [GraphQL API limits](/en/documentation/devtools/graphql/limits.md): The row, field, and time-window bounds a query runs within.
