Skip to main content
POST
/
v1
/
homes
/
bill-upload
[Beta] Onboard a site by uploading utility bill PDFs
curl --request POST \
  --url https://api.example.com/v1/homes/bill-upload \
  --header 'Content-Type: application/json' \
  --header 'x-ws-api-key: <api-key>' \
  --data '
{
  "name": "My home",
  "zipcode": "94107",
  "customerClass": "residential",
  "billPDFs": [
    "https://example.com/bills/january.pdf"
  ],
  "solarSystemSizeKw": 5,
  "isNonNetMetered": false,
  "hasEvCharger": true
}
'
import requests

url = "https://api.example.com/v1/homes/bill-upload"

payload = {
"name": "My home",
"zipcode": "94107",
"customerClass": "residential",
"billPDFs": ["https://example.com/bills/january.pdf"],
"solarSystemSizeKw": 5,
"isNonNetMetered": False,
"hasEvCharger": True
}
headers = {
"x-ws-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-ws-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My home',
zipcode: '94107',
customerClass: 'residential',
billPDFs: ['https://example.com/bills/january.pdf'],
solarSystemSizeKw: 5,
isNonNetMetered: false,
hasEvCharger: true
})
};

fetch('https://api.example.com/v1/homes/bill-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/homes/bill-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My home',
'zipcode' => '94107',
'customerClass' => 'residential',
'billPDFs' => [
'https://example.com/bills/january.pdf'
],
'solarSystemSizeKw' => 5,
'isNonNetMetered' => false,
'hasEvCharger' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ws-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/v1/homes/bill-upload"

payload := strings.NewReader("{\n \"name\": \"My home\",\n \"zipcode\": \"94107\",\n \"customerClass\": \"residential\",\n \"billPDFs\": [\n \"https://example.com/bills/january.pdf\"\n ],\n \"solarSystemSizeKw\": 5,\n \"isNonNetMetered\": false,\n \"hasEvCharger\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-ws-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/v1/homes/bill-upload")
.header("x-ws-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My home\",\n \"zipcode\": \"94107\",\n \"customerClass\": \"residential\",\n \"billPDFs\": [\n \"https://example.com/bills/january.pdf\"\n ],\n \"solarSystemSizeKw\": 5,\n \"isNonNetMetered\": false,\n \"hasEvCharger\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/homes/bill-upload")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-ws-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My home\",\n \"zipcode\": \"94107\",\n \"customerClass\": \"residential\",\n \"billPDFs\": [\n \"https://example.com/bills/january.pdf\"\n ],\n \"solarSystemSizeKw\": 5,\n \"isNonNetMetered\": false,\n \"hasEvCharger\": true\n}"

response = http.request(request)
puts response.read_body
{
  "id": "ws_home_123456789",
  "status": "processing"
}

Authorizations

x-ws-api-key
string
header
required

WattShift API key

Headers

x-ws-api-key
string

WattShift API Key

Body

application/json
name
string
required

The name of the site/home

Required string length: 1 - 255
zipcode
string
required

The zip code of the site

Pattern: ^\d{5}(?:[- ]\d{4})?$
customerClass
enum<string>
required
Available options:
residential,
commercial,
industrial
billPDFs
string<uri>[]
required

URLs pointing to the utility bill PDF(s)

Required array length: 1 - 5 elements
solarSystemSizeKw
number
Required range: x > 0
isNonNetMetered
boolean
utilityEIAId
string
Pattern: ^\d+$
ratePlanId
string
userId
string
hasEvCharger
boolean | null
hasElectricHeater
boolean | null
hasSmartWaterHeater
boolean | null
hasElectricWaterHeater
boolean | null
hasAC
boolean | null
acType
enum<string> | null
Available options:
central,
window,
split,
other
peakDemand
number
Required range: x > 0

Response

200 - application/json
id
string
required

The newly created home ID

status
enum<string>
required
Available options:
processing,
completed,
failed