[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"
}homes
[Beta] Onboard a site by uploading utility bill PDFs
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-keyx-ws-api-key
WattShift API key
Headers
WattShift API Key
Body
application/json
The name of the site/home
Required string length:
1 - 255The zip code of the site
Pattern:
^\d{5}(?:[- ]\d{4})?$Available options:
residential, commercial, industrial URLs pointing to the utility bill PDF(s)
Required array length:
1 - 5 elementsRequired range:
x > 0Pattern:
^\d+$Available options:
central, window, split, other Required range:
x > 0⌘I
