Skip to main content

Create Customer API

Updated over a week ago

Note: This API creates a customer record and also creates a proposal for the given customer.

Method: POST

Header: Accept: application/json

Key

Sub key

Required/Optional

Description

public_api_key


required

Authentication API key

customer

external_id

required

External provider ID

customer

source

required

Lead source

customer

first_name

required

Customer’s first name

customer

last_name

optional

Customer’s last name

customer

email

required

Customer’s email

customer

phone

optional

Customer’s phone number

customer

street

required

Customer street address

customer

city

required

Customer’s address city name

customer

state

required

Customer’s address state name

customer

postal_code

required

Zip code of address

customer

country

optional

Country name

customer

job_type

required

Job type should contain

any value from this list:

Solar, Roof,HVAC,

Fence, Battery

customer


optional


owner

email

required

Lead’s owner email

address. Using owner email, we assign the lead owner. If this email does not exist in our system, then an error

will be thrown.

Sample Payload:

{
"public_api_key":"API_KEY",
"customer": {
"territory": "Bay Area CA",
"street": "test",
"state": "AK",
"source": "TEST SOURCE",
"postal_code": "78764",
"phone": null,
"last_name": "opp",
"job_type": "Roof",
"first_name": "test opp",
"external_id": "0063t000015F7cbAAC",
"email": "test@test.com",
"country": "US",
"city": "test"
},
"owner": {
"email": "ashish.bansal+2@expansionjs.com"
}
}

Sample Response

Sample Response:
{
"id": 482,
"uuid": "13502bfc-ff0d-43b7-9f95-f3b277244d45",
"contact_id": 138,
"street": "test",
"city": "test",
"territory": "California, CA",
"state": "AK",
"postal_code": "78764",
"country": "US","latitude": 30.27,
"longitude": -97.74,
"img_bbox": null,
"sunroof_building_data": null,
"external_id": "0063t000015F7cbAAC",
"stage": "New",
"stages": null,
"job_stage": null,
"source": "TEST SOURCE",
"lead_source": null,
"lead_sub_source": null,
"aurora_roof_summary": null,
"job_type": "Roof",
"co_signer_email": null,
"co_signer_name": null,
"designs": null,
"sales_rep_first_name": null,
"sales_rep_last_name": null,
"sales_rep_email": null,
"sales_rep_phone": null,
"sales_rep_his_number": null,
"hoa_info": {
"is_hoa": false
},
"with_single_dxf": false,
"vivint_order_id": null,
"vivint_appointment_status": null,
"vivint_appointment_end": null,
"vivint_appointment_start": null,
"vivint_offer_id": null,
"checklist": null,
"existing_roof_type": null,
"roof_type": "Sloped",
"roof_job_type": "existing_roof",
"owner_id": 3,
"utility_company_name": null,
"custom_field_data": null,
"manager_id": 4,
"proposal_layout": "horizontal layout",
"active": true,
"deleted_at": null,
"created_at": "2023-06-22T12:40:06.000000Z","updated_at": "2023-06-22T12:40:06.000000Z",
"parent_id": null,
"cover_image_id": null,
"created_by": 3,
"base_system_cost": 0,
"battery_total": 0,
"gross_amount": 14.04,
"balance": 14.04,
"net_payable_amount": 14.04,
"net_amount": 14.04,
"loan_amount": 0,
"downpayment": 0,
"downpayment_method": null,
"dealer_fee": 0,
"adders_total": 14.04,
"discounts_total": 0,
"incentives_total": 0,
"commission": 0,
"fed_tax_credit": 0,
"state_tax_incentive": 0,
"img_zoom_type": 1,
"tool_type": "basic",
"monthly_usage": null,
"annual_usage": 0,
"no_of_panels": 0,
"no_of_batteries": 0,
"system_size": 0,
"total_square": 0,
"gutter_line_ft": 0,
"fence_line_ft": 0,
"design_tool_platform": "Aurora Solar",
"design_in_aurora": false,
"docusign_public_proposal": false,
"disclosure_data": null,
"mounting_type": null,
"owner_name": "ashish second",
"manager_name": "ashish new",
"finalizeData": [
{
"id": 78,
"proposal_id": 482,
"materials": null,"gutters": null,
"adders": [
{
"name": "test roof adder",
"type": "Gutter",
"unit": "Flat",
"unit_price": 10,
"fixed_amount": 0,
"qty": 1,
"min_qty": 1,
"length": null,
"cost_total": 10,
"auto_added": true,
"already_added_margin": false,
"notes": "test",
"margin": 0,
"db_margin": 0,
"global_margin": 0
},
{
"name": "test",
"type": "Painting",
"unit": "Sq Ft",
"unit_price": 1,
"fixed_amount": 1,
"qty": 1,
"min_qty": 1,
"length": null,
"cost_total": 2.0202020202020203,
"auto_added": true,
"already_added_margin": false,
"notes": "1",
"margin": 1,
"db_margin": 1,
"global_margin": 0
},
{
"name": "Roof Distance auto adder with state",
"type": "Other",
"unit": "Flat",
"unit_price": 1,
"fixed_amount": 1,"qty": 1,
"min_qty": 1,
"length": null,
"cost_total": 2.0202020202020203,
"auto_added": true,
"already_added_margin": false,
"notes": "1",
"margin": 1,
"db_margin": 1,
"global_margin": 0
}
],
"discounts": null,
"incentives": null,
"quotes": null,
"finalized_quote": null,
"adders_total": 14.04,
"discounts_total": 0,
"incentives_total": 0,
"base_system_cost": 0,
"gross_amount": 14.04,
"finalized_option": true,
"new_roof": null,
"created_at": "2023-06-22T12:40:06.000000Z",
"updated_at": "2023-06-22T12:40:06.000000Z",
"balance": 14.04,
"net_amount": 14.04,
"fed_tax_credit": 0,
"loan_amount": 0,
"dealer_fee": 0,
"net_payable_amount": 14.04,
"downpayment": 0,
"downpayment_method": null,
"exclude_auto_adders": null,
"financed_quote": null
}
],
"savings": null,
"public_proposal_url": "http://localhost:4200/public-proposal/13502bfc-ff0d-43b7-9f95-f3b277244d45",
"owner": {
"id": 3,
"first_name": "ashish","last_name": "second",
"email": "ashish.bansal+2@expansionjs.com",
"username": "salesmanager",
"phone": "+1 2356897845",
"country_code": null,
"role": "Design Engineer",
"user_offices": [
{
"office_name": "test",
"office_id": 1,
"role": "test",
"user_id": 3,
"user_name": "test",
"organization_id": "1"
},
{
"office_name": "test",
"office_id": 5,
"role": "test",
"user_id": 3,
"user_name": "test",
"organization_id": "1"
},
{
"user_id": 3,
"user_name": "ashish second",
"role": "Director/VP",
"office_id": 65,
"office_name": "Delfy-Sample Office Two two"
}
],
"his_num": null,
"can_edit_price": true,
"active": true,
"is_sales_support": false,
"manager_id": 4,
"email_verified_at": null,
"organization_id": 1,
"avatar_id": null,
"default_timezone": null,
"last_loggedin": "2023-05-15 06:55:34",
"ip_address": "172.18.0.1","deleted_at": null,
"name": "ashish second",
"default_designer": false,
"display_email": "ashish.bansal+2@expansionjs.com"
},
"manager": {
"id": 4,
"first_name": "ashish",
"last_name": "new",
"email": "ashish.bansal+4@expansionjs.com",
"username": "ashishdem",
"phone": "+1 2356897845",
"country_code": null,
"role": "Design Manager",
"user_offices": null,
"his_num": null,
"can_edit_price": true,
"active": true,
"is_sales_support": false,
"manager_id": null,
"email_verified_at": null,
"organization_id": 1,
"avatar_id": null,
"default_timezone": null,
"last_loggedin": "2022-11-07 03:56:38",
"ip_address": "172.18.0.1",
"deleted_at": null,
"name": "ashish new",
"default_designer": false,
"display_email": "ashish.bansal+4@expansionjs.com"
},
"contact": {
"id": 138,
"first_name": "test opp",
"last_name": "opp",
"email": "test@test.com",
"secret_string": "",
"phone": null,
"country_code": null,
"street": "test",
"city": "test",
"territory": "California, CA","state": "AK",
"postal_code": "78764",
"country": "US",
"owner_id": 3,
"salesforce_response": null,
"active": true,
"deleted_at": null,
"updated_at": "2023-06-22T12:40:05.000000Z",
"name": "test opp opp",
"sales_rabbit_lead_id": null,
"lead_source": null,
"lead_sub_source": null,
"username": "test+12@test.com",
"vivint_customer": false,
"full_name": "Test Opp Opp"
},
"finalize_data": [
{
"id": 78,
"proposal_id": 482,
"materials": null,
"gutters": null,
"adders": [
{
"name": "test roof adder",
"type": "Gutter",
"unit": "Flat",
"unit_price": 10,
"fixed_amount": 0,
"qty": 1,
"min_qty": 1,
"length": null,
"cost_total": 10,
"auto_added": true,
"already_added_margin": false,
"notes": "test",
"margin": 0,
"db_margin": 0,
"global_margin": 0
},
{
"name": "test","type": "Painting",
"unit": "Sq Ft",
"unit_price": 1,
"fixed_amount": 1,
"qty": 1,
"min_qty": 1,
"length": null,
"cost_total": 2.0202020202020203,
"auto_added": true,
"already_added_margin": false,
"notes": "1",
"margin": 1,
"db_margin": 1,
"global_margin": 0
},
{
"name": "Roof Distance auto adder with state",
"type": "Other",
"unit": "Flat",
"unit_price": 1,
"fixed_amount": 1,
"qty": 1,
"min_qty": 1,
"length": null,
"cost_total": 2.0202020202020203,
"auto_added": true,
"already_added_margin": false,
"notes": "1",
"margin": 1,
"db_margin": 1,
"global_margin": 0
}
],
"discounts": null,
"incentives": null,
"quotes": null,
"finalized_quote": null,
"adders_total": 14.04,
"discounts_total": 0,
"incentives_total": 0,
"base_system_cost": 0,
"gross_amount": 14.04,"finalized_option": true,
"new_roof": null,
"created_at": "2023-06-22T12:40:06.000000Z",
"updated_at": "2023-06-22T12:40:06.000000Z",
"balance": 14.04,
"net_amount": 14.04,
"fed_tax_credit": 0,
"loan_amount": 0,
"dealer_fee": 0,
"net_payable_amount": 14.04,
"downpayment": 0,
"downpayment_method": null,
"exclude_auto_adders": null,
"financed_quote": null
}
]
}

Sample required validation error:

{
"message": "The given data was invalid.",
"errors": [
"The customer.external id field is required."
],
"status": 422
}

Sample validation error if customer owner detail not found

{
"message": "The given data was invalid.",
"errors": [
"Error! Owner not found in SubHub. Please contact admin."
],
"status": 422
}
Did this answer your question?