---
title: "Calculate Charge Cost"
method: POST
path: "/spark/charge_curve/cost"
tags: ["Spark"]
---

# Calculate Charge Cost

`POST /spark/charge_curve/cost`

Provided a charge curve starting at a particular time of day, calculates the electricity cost of that charge curve for a particular `UtilityAccount` or [Genability tariff](https://developer.genability.com/api-reference/tariff-api/tariff/).

## Headers

- `Arcadia-Version` string, required

## Request body

- ChargeCostRequestBodyParams
  - `utility_account_id` integer — (Beta - due to limited coverage) The unique ID of the utility account that this calculation is being run against. Either a `utility_account_id` or `main_tariff_id` is required for a valid request.
  - `main_tariff_id` string — The Genability 'masterTariffId' unique identifier for this tariff. See [Genability documentation](https://developer.genability.com/api-reference/tariff-api/tariff/) for details. Either a `utility_account_id` or `main_tariff_id` is required for a valid request.
  - `start_time` string, date-time, required — ISO8601 timestamp of when the charge begins. Note that the timestamp will be normalized down to the start of latest charge block resolution. For example, if the `charge_block_resolution` is `1h` and the charging session starts at `2021-06-24T14:59:59Z`, the `start_time` used to calculate the curve's cost will be normalized to `2021-06-24T14:00:00Z`. If the `charge_block_resolution` is `15m`, the `start_time` would be normalized to `2021-06-24T14:45:00Z`. This normalization technique eliminates ambiguity around charging that occurs across time-of-use on/mid/off-peak window boundaries.
  - `charge_block_resolution` '5m' | '10m' | '15m' | '30m' | '1h' — The duration of the charge blocks provided in the `energy_usage_kwh` param.
  - `energy_usage_kwh` number[], required — The load curve being priced. An array of charge blocks with each block representing the kWh of power consumed or to be consumed in that block.

## Response `200`

Success

- ChargeCostResponse
  - `utility_account_id` integer, nullable
  - `tariff` MostRecentTariff, required — The most recent Tariff seen on this utility account.
    - `main_tariff_id` string, required — The Genability 'masterTariffId' unique identifier for this tariff. See [Genability documentation](https://developer.genability.com/api-reference/tariff-api/tariff/) for details.
    - `property_inputs` object[] — Properties applied to this tariff which may affect the calculated cost of electricity.
      - `id` string, required
      - `value` union, required
        - boolean
        - number
        - string
    - `supplier_name` string, nullable — The name of the retail electricity supplier or the community choice aggregator. If there is no retail electricity supplier or community choice aggregator, this field is null.
    - `tariff_code` string, required — Abbreviation code of the tariff used for this calculation.
    - `tariff_name` string, required — Full name of the tariff used for this calculation.
    - `utility_name` string, required — Name of the utility associated with this tariff
    - `tariff_as_of_date` string, date, nullable, required — The statement date of the utility statement that reported use of this tariff.
  - `normalized_start_time` string, date-time, required — The start_time normalized down to the resolution that lines up with any TOU periods on the tariff (generally hourly).
  - `normalized_consumption_kwh` number[], required — The `energy_usage_kwh` aggregated into periods that line up with any TOU periods on the tariff (generally hourly).
  - `cost_cents` integer, required — Cost of the charging curve on the utility account's tariff, in cents.

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `422` — Unprocessable Entity

---

[API](https://skmtc.dev/arcadia/apis/arcadia-api-reference.md) · [All operations](https://skmtc.dev/arcadia/apis/arcadia-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/arcadia/arcadia-api-reference/revisions/468f1c903722/schema)
