Skip to main content
POST
/
v1
/
homes
/
{id}
/
bill
/
period
calculate period bill
curl --request POST \
  --url https://api.example.com/v1/homes/{id}/bill/period \
  --header 'Content-Type: application/json' \
  --header 'x-ws-api-key: <api-key>' \
  --data '
{
  "usage": [
    [
      123
    ]
  ],
  "startDate": "<string>",
  "endDate": "<string>",
  "export": [
    [
      123
    ]
  ],
  "debug": true
}
'
{
  "totalBill": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.wattshift.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-ws-api-key
string
header
required

Headers

x-ws-api-key
string

WattShift API Key

Path Parameters

id
string
required

Body

application/json
usage
number[][]
required

Array of daily usage arrays. Each inner array must have 96 values (15-minute intervals). Number of days must match the date range between startDate and endDate.

Minimum array length: 1
startDate
string
required

Start date of the billing period (YYYY-MM-DD or ISO 8601 datetime format). Must be before endDate.

endDate
string
required

End date of the billing period (YYYY-MM-DD or ISO 8601 datetime format). Must be after startDate.

export
number[][]

Optional array of daily export arrays (solar export to grid). Each inner array must have 96 values (15-minute intervals). Number of days must match usage array length.

debug
boolean

Enable debug mode to return additional information

Response

200 - application/json
totalBill
number
required