Installers
This section covers the API endpoints for managing installers. You can use these endpoints to retrieve, create, update, and delete installer information in your application.
The installer model
The installer model contains information about solar installation companies. Here are the properties included in the installer model:
Properties
-
- Name
id
- Type
- integer
- Description
-
Unique identifier for the installer.
-
- Name
name
- Type
- string
- Description
-
Name of the installer company.
-
- Name
email
- Type
- string
- Description
-
Email address of the installer (corresponds to the user object).
-
- Name
created_at
- Type
- timestamp
- Description
-
Timestamp of when the installer was created.
-
- Name
updated_at
- Type
- timestamp
- Description
-
Timestamp of when the installer was last updated.
Calculate SREC Earnings
This endpoint calculates the estimated SREC (Solar Renewable Energy Certificate) earnings for a solar system based on its capacity and location. It provides earnings estimates for different time periods and includes system details.
Required parameters
-
- Name
city
- Type
- string
- Description
-
Name of the city where the solar system is located. Optional.
-
- Name
state
- Type
- string
- Description
-
Two-letter state code (e.g. NJ, PA, MD). Must be a state with an active SREC market.
-
- Name
capacity_kw
- Type
- numeric
- Description
-
System capacity in kilowatts (kW). Must be greater than 0.
Request
curl -G https://api.getcurrents.com/v1/installers/calculate-srec-earnings \
-H "Authorization: Bearer {token}" \
-d state=PA \
-d city=Philadelphia \
-d capacity_kw=10
Response
{
"estimates": {
"monthly": 44.40,
"yearly": 532.80,
"5_year": 2664.00,
"10_year": 5328.00,
"15_year": 7992.00
},
"system_details": {
"state": "PA",
"city": "Philadelphia",
"capacity_kw": 10,
"estimated_monthly_kwh": 1200,
"srec_price": 37
}
}
List all installers
This endpoint allows you to retrieve a paginated list of all installers that belong to your account. By default, a maximum of ten installers are shown per page.
Optional parameters
-
- Name
limit
- Type
- integer
- Description
-
Limit the number of installers returned (default: 10, max: 100).
-
- Name
page
- Type
- integer
- Description
-
Page number for pagination (default: 1).
Request
curl -G https://api.getcurrents.com/v1/installers \
-H "Authorization: Bearer {token}" \
-d limit=10 \
-d page=1
Response
{
"data": [
{
"id": 1,
"name": "Solar Installers Inc.",
"email": "contact@solarinstallers.com",
"created_at": "2023-10-02T18:24:47.000000Z",
"updated_at": "2023-10-02T18:24:47.000000Z"
},
// ... more installers
],
"links": {
"first": "https://api.getcurrents.com/v1/installers?page=1",
"last": "https://api.getcurrents.com/v1/installers?page=5",
"prev": null,
"next": "https://api.getcurrents.com/v1/installers?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"path": "https://api.getcurrents.com/v1/installers",
"per_page": 10,
"to": 10,
"total": 50
}
}
Create an installer
This endpoint allows you to add a new installer to your application. You need to provide the required installer information in the request body.
Required attributes
-
- Name
name
- Type
- string
- Description
-
Name of the installer company.
-
- Name
email
- Type
- string
- Description
-
Email address of the installer.
Request
curl https://api.getcurrents.com/v1/installers \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Solar Installers Inc.",
"email": "contact@solarinstallers.com"
}'
Response
{
"id": 1,
"name": "Solar Installers Inc.",
"email": "contact@solarinstallers.com",
"created_at": "2023-10-02T18:24:47.000000Z",
"updated_at": "2023-10-02T18:24:47.000000Z"
}
Retrieve an installer
This endpoint allows you to retrieve an installer's details by providing the installer ID.
Request
curl https://api.getcurrents.com/v1/installers/1 \
-H "Authorization: Bearer {token}"
Response
{
"id": 1,
"name": "Solar Installers Inc.",
"email": "contact@solarinstallers.com",
"created_at": "2023-10-02T18:24:47.000000Z",
"updated_at": "2023-10-02T18:24:47.000000Z"
}
Update an installer
This endpoint allows you to update an existing installer's information.
Optional attributes
-
- Name
name
- Type
- string
- Description
-
Name of the installer company.
-
- Name
email
- Type
- string
- Description
-
Email address of the installer.
Request
curl -X PUT https://api.getcurrents.com/v1/installers/1 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "New Solar Installers Inc.",
"email": "newcontact@solarinstallers.com"
}'
Response
{
"id": 1,
"name": "New Solar Installers Inc.",
"email": "newcontact@solarinstallers.com",
"created_at": "2023-10-02T18:24:47.000000Z",
"updated_at": "2023-10-02T19:30:00.000000Z"
}
Delete an installer
This endpoint allows you to delete an installer from your application. Note: This action cannot be undone.
Request
curl -X DELETE https://api.getcurrents.com/v1/installers/1 \
-H "Authorization: Bearer {token}"
Response
{
"message": "Installer deleted successfully"
}