> For the complete documentation index, see [llms.txt](https://developer.sahamati.org.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.sahamati.org.in/sahamatinet-agent-sna/billing/api-reference/billing-payload.md).

# Billing Payload

SNA pushes a billing payload to the Sahamati endpoint every 10 minutes. The payload captures billable data fetches for each FIU, broken down by FIP and by period. The tag for this payload is `req-billing-aa`.

#### Schema Reference

| Field                                      | Type           | Description                                                                        |
| ------------------------------------------ | -------------- | ---------------------------------------------------------------------------------- |
| agentVersion                               | string         | <p>Version of the SahamatiNet Agent generating data for the Sahamati API endpoint. |
| <br>Note: Required only when using SNA</p> |                |                                                                                    |
| jsonVersion                                | string         | Version of the JSON schema used for the Sahamati API endpoint. (e.g. "1.0.0")      |
| tag                                        | string         | `req-billing-aa` identifies this as a billing payload                              |
| txnId                                      | string         | Unique transaction ID for this push request                                        |
| metricCollectionId                         | string         | <p>Identifier for the input request                                                |
| <br>Note: Required only when using SNA</p> |                |                                                                                    |
| fromDateTime                               | string         | Start of the 10-minute reporting window (ISO 8601, UTC)                            |
| toDateTime                                 | string         | End of the 10-minute reporting window (ISO 8601, UTC)                              |
| duration                                   | int            | Duration in seconds of the reporting window (600 for 10 minutes)                   |
| aaId                                       | string         | Entity ID of the Account Aggregator. Must match the authenticated AA.              |
| enums.period                               | array\[string] | Ordered list of period buckets. See Period Enum.                                   |
| fius\[].fiuId                              | string         | Entity ID of the FIU for which billing data is reported in this block              |
| fius\[].fips\[].fipId                      | string         | Entity ID of the FIP from which data was fetched for this FIU                      |
| fius\[].fips\[].counts                     | array\[int]    | Counts positionally aligned to `enums.period`                                      |

The `counts` array must have the same length as `enums.period`. `fius` may be an empty array if there is no billable activity in the reporting window.

#### Period Enum

The `counts` array for each FIU–FIP pair is positionally aligned to the following periods, in this exact order. Each count is the number of FI/fetch requests whose data range falls within that period.

<table><thead><tr><th width="89.66668701171875">Position</th><th width="90.3333740234375">Period</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>13mo</td><td>Count of accounts in FI/fetch with data range ≥ 13 months</td></tr><tr><td>2</td><td>7mo</td><td>Count of accounts in FI/fetch with data range ≥ 7 months and &#x3C; 13 months</td></tr><tr><td>3</td><td>4mo</td><td>Count of accounts in FI/fetch with data range ≥ 4 months and &#x3C; 7 months</td></tr><tr><td>4</td><td>1mo</td><td>Count of accounts in FI/fetch with data range ≥ 1 month and &#x3C; 4 months</td></tr><tr><td>5</td><td>1w</td><td>Count of accounts in FI/fetch with data range ≥ 1 week and &#x3C; 1 month</td></tr><tr><td>6</td><td>5d</td><td>Count of accounts in FI/fetch with data range ≥ 5 days and &#x3C; 1 week</td></tr><tr><td>7</td><td>1d</td><td>Count of accounts in FI/fetch with data range ≥ 1 day and &#x3C; 5 days</td></tr><tr><td>8</td><td>ps</td><td>Count of accounts in FI/fetch with profile and summary fetches.</td></tr><tr><td>9</td><td>other</td><td>Count of accounts in FI/request that could not be mapped to a profile and summary fetch or a transaction fetch</td></tr></tbody></table>

#### Sample Payload

All values below are synthetic and for illustration only.

```json
{
  "agentVersion": "1.0.0",
  "jsonVersion": "1.0.0",
  "tag": "req-billing-aa",
  "txnId": "00000000-0000-0000-0000-000000000001",
  "metricCollectionId": "mc-test-0001",
  "fromDateTime": "2026-01-01T10:00:00Z",
  "toDateTime": "2026-01-01T10:10:00Z",
  "duration": 600,
  "aaId": "aa-test-001",
  "enums": { "period": ["13mo", "7mo", "4mo", "1mo", "1w", "5d", "1d", "ps", "other"] },
  "fius": [
    {
      "fiuId": "fiu-test-001",
      "fips": [
        {
          "fipId": "fip-test-001",
          "counts": [12, 3, 4, 5, 6, 13, 1, 3, 0]
        }
      ]
    }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.sahamati.org.in/sahamatinet-agent-sna/billing/api-reference/billing-payload.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
