GET https://solarproof.com.au/apidata.php

Description

Retrieves comprehensive details about a specific customer using their email address. The response includes customer contact information, owner user details, customer notes, status, and a complete list of all associated projects with full solar system specifications.

Lookup Method: This endpoint uses the customer's email address as the identifier. If you have the customer ID instead, you can also use this endpoint (it accepts both).

Request Parameters

Query Parameters

Parameter Type Required Description
api_key string Required Your Solar Proof API key
action string Required Must be set to "getcustomerByemail"
customer_email string Required The email address of the customer you want to retrieve

Response

Success Response (200 OK)

Returns a comprehensive customer object with all associated data.

Response Body JSON
{
  "customer_id": "71705",
  "gst_status": "Not GST Registered",
  "customer_first_name": "John",
  "customer_last_name": "Smith",
  "customer_phone_1": "0499399399",
  "customer_phone_2": "",
  "customer_email": "john.smith@example.com",
  "customer_type": "Residential",
  "company_name": "",
  "company_phone": "",
  "owner_user_info": {
    "user_id": "221",
    "first_name": "Chris",
    "last_name": "User",
    "phone_number": "0415 644 644",
    "email": "chris@solarproof.com.au",
    "work_title": "Director",
    "username": "user1"
  },
  "creation_date": "2020-11-19",
  "customer_notes": [
    {
      "datetime": "2020-11-20 14:30:00",
      "note": "Customer interested in 10kW system"
    }
  ],
  "customer_status": "Signed",
  "projects": [
    {
      "project_id": "849",
      "project_title": "Project #849",
      "site_address": {
        "streetnum": "418",
        "street": "Murray Street",
        "suburb": "Perth",
        "state": "WA",
        "postcode": "6000",
        "country": "Australia"
      },
      "solar_panel_quantity": "56",
      "solar_panel_type": "320W - SUNPOWER - (SPR-E19-320)",
      "inverter_type": "SMA Australia 20kW (STP20000TL-30)",
      "inverter_quantity": "1",
      "system_size": "17.92kW",
      "proposal_link": "/uploads/pdfs/849/proposal_849.pdf"
    }
  ]
}

Response Fields

For a complete breakdown of all fields in the response, see the tables below:

Customer Fields

Field Type Description
customer_id string Unique identifier for the customer
gst_status string "GST Registered" or "Not GST Registered"
customer_first_name string Customer's first name
customer_last_name string Customer's last name
customer_phone_1 string Primary phone number
customer_phone_2 string Secondary phone number (may be empty)
customer_email string Customer's email address
customer_type string "Residential", "Commercial", or "Large-Scale"
company_name string Company name (for commercial customers)
company_phone string Company phone number
creation_date datetime When the customer was created (e.g., 2025-10-14 23:10:07)
customer_status string Current customer status

Owner User Info Object

Field Type Description
user_id string ID of the user who created this customer
first_name string User's first name
last_name string User's last name
phone_number string User's phone number
email string User's email address
work_title string User's job title
username string User's username

Customer Notes Array

Field Type Description
datetime datetime When the note was created (e.g., 2025-10-14 23:10:07)
note string The note text entered by the owner user

Projects Array

Field Type Description
project_id string Unique identifier for the project
project_title string Display title of the project
site_address object Address components: streetnum, street, suburb, state, postcode, country
solar_panel_quantity string Number of solar panels
solar_panel_type string Solar panel model and specifications
inverter_quantity string Number of inverters
inverter_type string Inverter model and specifications
system_size string Total system size in kilowatts (e.g., "17.92kW")
proposal_link string URL path to the proposal PDF (empty if not published)

Error Response (4xx/5xx)

Error Response JSON
{
  "code": "CUSTOMER_NOT_FOUND",
  "message": "No customer found with the provided email"
}
Error Code Description
INVALID_API_KEY The provided API key is invalid or missing
INVALID_PARAMETERS Required parameter customer_email is missing
CUSTOMER_NOT_FOUND No customer exists with the specified email address

Example Request

cURL bash
curl -X GET "https://solarproof.com.au/apidata.php?action=getcustomerByemail&customer_email=john.smith@example.com&api_key=YOUR_API_KEY"
JavaScript (Fetch) javascript
const apiKey = 'YOUR_API_KEY';
const customerEmail = 'john.smith@example.com';
const url = `https://solarproof.com.au/apidata.php?action=getcustomerByemail&customer_email=${encodeURIComponent(customerEmail)}&api_key=${apiKey}`;

fetch(url)
  .then(response => response.json())
  .then(customer => {
    console.log('Customer:', customer.customer_first_name, customer.customer_last_name);
    console.log('Email:', customer.customer_email);
    console.log('Type:', customer.customer_type);
    console.log('Projects:', customer.projects.length);
    console.log('Notes:', customer.customer_notes.length);
  })
  .catch(error => console.error('Error:', error));
PHP php
<?php
$apiKey = 'YOUR_API_KEY';
$customerEmail = 'john.smith@example.com';
$url = "https://solarproof.com.au/apidata.php?action=getcustomerByemail&customer_email=" 
     . urlencode($customerEmail) 
     . "&api_key={$apiKey}";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

$customer = json_decode($response, true);

echo "Customer: {$customer['customer_first_name']} {$customer['customer_last_name']}\n";
echo "Email: {$customer['customer_email']}\n";
echo "Type: {$customer['customer_type']}\n";
echo "Projects: " . count($customer['projects']) . "\n";
echo "Notes: " . count($customer['customer_notes']) . "\n";
?>
Python python
import requests
from urllib.parse import urlencode

api_key = 'YOUR_API_KEY'
customer_email = 'john.smith@example.com'

params = {
    'action': 'getcustomerByemail',
    'customer_email': customer_email,
    'api_key': api_key
}

url = f'https://solarproof.com.au/apidata.php?{urlencode(params)}'
response = requests.get(url)
customer = response.json()

print(f"Customer: {customer['customer_first_name']} {customer['customer_last_name']}")
print(f"Email: {customer['customer_email']}")
print(f"Type: {customer['customer_type']}")
print(f"Projects: {len(customer['projects'])}")
print(f"Notes: {len(customer['customer_notes'])}")

Common Use Cases

Customer Profile Display

Build customer profile pages in your application showing all details, projects, and interaction history.

Customer Verification

Verify customer existence and status before allowing portal access or processing transactions.

Project History Review

Retrieve complete project history for a customer to analyze past installations and system specifications.

Related Endpoints