HomeGuidesAPI ReferenceChangelog
Log In
Guides

Step 2: Retrieve Hourly Pre-Solar Cost

Run an hourly Account Cost Calculation for the pre-solar scenario and inspect baseline cost line items.

Retrieve hourly pre-solar cost so you can validate the baseline side of a Savings Analysis.

Use this step to recreate the baseline, or pre-solar, scenario with an Account Cost Calculation. The response returns hourly cost line items that you can compare against the post-solar calculation in the next step.

Pre-solar cost workflow

  1. Use the account identified in Step 1.
  2. Confirm the account or request uses the pre-solar tariff.
  3. Run an Account Cost Calculation for the validation date range.
  4. Set detailLevel to CHARGE_TYPE.
  5. Set groupBy to HOUR.
  6. Inspect hourly items[] entries for itemQuantity, rateAmount, cost, and chargeType.

Retrieve hourly pre-solar cost

You can use a providerAccountId (pid) or system-generated account ID.

POST /rest/v1/accounts/pid/example-1/calculate/

Or use the system-generated account ID:

POST /rest/v1/accounts/{accountId}/calculate/

This request inspects one day in July 2023:

{
  "fromDateTime": "2023-07-01",
  "toDateTime": "2023-07-02",
  "useIntelligentBaselining": "true",
  "includeDefaultProfile": "true",
  "autoBaseline": "true",
  "minimums": "false",
  "detailLevel": "CHARGE_TYPE",
  "groupBy": "HOUR",
  "fields": "EXT"
}
FieldPurpose
fromDateTime / toDateTimeSets the validation period.
useIntelligentBaseliningAllows algorithmic interpolation and extrapolation of usage data.
includeDefaultProfileAllows the calculation to use the default ELECTRICITY profile on the account.
autoBaselineEnables baseline handling for the calculation.
minimumsExcludes minimum charge handling for this hourly validation request.
detailLevelReturns line items grouped by charge type.
groupByReturns results by hour.
fieldsIncludes extended fields in the response.

If you pass a profile that is not the default account profile, set includeDefaultProfile to false. Otherwise, the calculation may also include the default profile.

Review the response

The following response has been shortened to show the first hourly items[] entries:

{
  "status": "success",
  "count": 1,
  "type": "CalculatedCost",
  "requestId": "0a0fb410-8a18-4738-ae16-8b88f050c497",
  "results": [
    {
      "calculatedCostId": "09f878a3-012b-4d45-b866-a66bebfe0de7",
      "masterTariffId": 522,
      "tariffName": "Residential",
      "totalCost": 10.28000000,
      "fromDateTime": "2023-07-01T00:00:00-07:00",
      "toDateTime": "2023-07-02T00:00:00-07:00",
      "currency": "USD",
      "summary": {
        "ELECTRICITY": {
          "kWh": 28.82,
          "kW": 3.75
        },
        "subTotalCost": 10.28,
        "taxCost": 0.00,
        "totalCost": 10.28,
        "adjustedTotalCost": 10.29,
        "kWh": 28.82,
        "kW": 1.93
      },
      "accuracy": 100.00000000,
      "items": [
        {
          "fromDateTime": "2023-07-01T00:00:00-07:00",
          "toDateTime": "2023-07-01T01:00:00-07:00",
          "quantityKey": "fixed",
          "rateAmount": 0.00000000,
          "itemQuantity": 0.00000000,
          "cost": 0.00000000,
          "chargeType": "FIXED_PRICE"
        },
        {
          "fromDateTime": "2023-07-01T00:00:00-07:00",
          "toDateTime": "2023-07-01T01:00:00-07:00",
          "quantityKey": "consumption",
          "rateAmount": 0.35701223,
          "itemQuantity": 0.86398500,
          "cost": 0.30845321,
          "chargeType": "CONSUMPTION_BASED"
        }
      ]
    }
  ]
}

Each hourly interval can include multiple charge types. In this example, the interval includes both FIXED_PRICE and CONSUMPTION_BASED line items. For validation, focus first on CONSUMPTION_BASED items because they show the relationship between hourly usage, rate, and cost.

What to compare later

Save or export the hourly items[] values so you can compare them against the post-solar calculation in Step 3.

FieldWhy it matters
fromDateTime / toDateTimeAligns the pre-solar and post-solar hourly intervals.
chargeTypeIdentifies comparable charge buckets.
itemQuantityShows hourly consumption quantity.
rateAmountShows the hourly rate used for that charge line.
costShows the hourly cost for that charge line.

Next step

After you retrieve the baseline hourly cost, retrieve hourly post-solar cost.