# Get calculations for an accounting point

Use this workflow to retrieve calculated consumption and cost for an Accounting Point.

This is typically used when an external system needs to display consumption, calculated amounts, or aggregated settlement values for a customer and Accounting Point.

## Endpoint

```http
GET /v1/se/calculation/GetCalculation?customer={customerGuid}&meteringpoint={accountingPointIdentification}&firstDay={firstDay}&lastDay={lastDay}&agg={aggregation}
```

## When to use

Use this workflow when an external system needs calculated values for a specific customer and Accounting Point.

Typical use cases include:

- displaying calculated consumption in a customer portal
- showing daily, monthly, or yearly cost information
- retrieving settlement-related values for a specific period
- presenting consumption and calculated amount in a CRM or customer support system
- validating that meter values and product prices produce expected calculated results

## Request parameters

| Parameter | Description |
|---|---|
| `customer` | UtilityCloud GUID of the Customer. |
| `meteringpoint` | Accounting Point identification. |
| `firstDay` | Start of the calculation period. Use ISO date/time in UTC. |
| `lastDay` | End of the calculation period. Use ISO date/time in UTC. |
| `agg` | Aggregation level. Supported values are `h`, `d`, `m`, and `y`. |

## Aggregation values

| Value | Description |
|---|---|
| `h` | Hour |
| `d` | Day |
| `m` | Month |
| `y` | Year |

## Example request

```http
GET /v1/se/calculation/GetCalculation?customer=9c571be0-a689-4b83-9343-4043b5328836&meteringpoint=707057500012345678&firstDay=2022-06-01&lastDay=2022-07-01&agg=d
```

## Response

A successful request returns calculated values for the selected period and aggregation level.

```json
{
  "calculations": [
    {
      "start": "2022-05-31T22:00:00Z",
      "end": "2022-06-01T21:59:59.999Z",
      "consumption": 47.684,
      "price": 0.21558781247378576,
      "amount": 10.28008925
    }
  ],
  "acknowledge": {
    "responseCode": "0000000000",
    "responseText": "OK"
  }
}
```

## Response fields

| Field | Description |
|---|---|
| `calculations` | List of calculated values for the selected period. |
| `start` | Start of the calculated interval. |
| `end` | End of the calculated interval. |
| `consumption` | Calculated consumption for the interval, typically in kWh. |
| `price` | Price used for the interval, typically in the relevant currency per kWh. |
| `amount` | Calculated amount for the interval, typically in the relevant currency. |
| `acknowledge` | Response status information. |
| `responseCode` | Response code. `0000000000` indicates a successful request. |
| `responseText` | Response text. |

## Notes

Meter values are used as input to calculation. As meter values are received, consumption and cost are calculated for the relevant Accounting Point and period.

Use `agg` to control whether the returned values are aggregated by hour, day, month, or year.

For successful requests, `responseCode` is `0000000000`.

Date values should be provided as ISO date/time values in UTC.

The returned values depend on available meter values, product setup, prices, settlement rules, and tenant configuration.

## Related endpoints

```http
GET /v1/se/calculation/GetCalculation?customer={customerGuid}&meteringpoint={accountingPointIdentification}&firstDay={firstDay}&lastDay={lastDay}&agg={aggregation}
GET /se/v2/GetPriceInformation?customer={customerGuid}&ap={accountingPointIdentification}&date={date}
POST /v1/se/general-mv-adapter/CreateMeterValuesSeries
```