Get project details
Easy PV and Heatpunk generate a full bill of materials for a project, and for our UK and Ireland sites you can very quickly place an order for the components from Midsummer. So you may like to import the shopping cart into your application and display an ordering link. Users love the ease of ordering all the kit for an installation.
The cart is based on the bill of materials generated by the software for a given project. The bill of materials for the project is refreshed every time the overview page of the project is opened by a user in Easy PV or Heatpunk.
To fetch project data, including the cart and order link, use the api/v1/projects/data
endpoint. You need to pass in the project ID, and the user you are acting as. The user must have view rights to the project.
Sample request:
curl --location 'https://heatpunk.co.uk/api/v1/projects/data?projectId=[YOUR PROJECT ID]&userEmail=[YOUR USER EMAIL]' \
--header 'accept: application/json' \
--header 'X-API-KEY: [YOUR API KEY]'
What to expect in the response:
You will get back a projectData
object which will include core project and customer information. For example:
{
"status": "success",
"projectData": {
"lat": 52.23060119001846,
"lng": 0.1403758374017583,
"zoom": 21,
"address": "91 Kings Hedges Rd, Cambridge , UK",
"postcode": "CB4 2QD",
"dateCreated": "2024-07-31 10:48:44",
"dateModified": "2024-11-06 09:11:14",
"projectName": "Clone of Tue Jul 30 2024",
"customerName": "Mart",
"buildDate": "pre2000",
"customerPhone": "Ergnes",
"customerEmail": "mart.ergnes@outlook.com",
"projectType": "heat",
"userID": "1316",
"status": "Lead",
"projectID": "25062",
"altitude": 12.3244800567627,
"geography": {
"altitude": null,
"distance": null,
"hillSlope": null,
"hillZone": null,
"terrain": null,
"topography": null,
"windZone": null
},
"cart": [
{
"name": "Samsung EHS Split 4kW",
"qty": 1,
"item": 1047.14,
"line": 1047.14,
"dbID": "4944",
"availableFrom": {
"midsummer": {
"ID": "4944",
"price": 1047.14
}
}
},
{
"name": "2.5mm² H07RN-F Flexible Cable, 3 Core, Rubber, Black (25m reel)",
"qty": 1,
"item": 55.03,
"line": 55.03,
"dbID": "6704",
"availableFrom": {
"midsummer": {
"ID": 6704,
"price": 55.03
}
}
}
],
"midsummerOrderLink": "https://midsummerwholesale.co.uk/upload/?order=eyJpdGVtcyI6eyI0OTQ0Ijp7InRpdGxlIjoiU2Ftc3VuZyBFSFMgU3BsaXQgNGtXIiwicXR5IjoxfSwiNjcwNCI6eyJ0aXRsZSI6IjIuNW1tsiBUd2luICZhbXA7IEVhcnRoIEFDIENhYmxlICgyNW0gcmVlbCkiLCJxdHkiOjF9fSwic2hpcHBpbmdBZGRyZXNzIjp7InBvc3Rjb2RlIjoiVEEyMCA4TEIiLCJhZGQxIjoiRHVuYmxvYmJpbiciLCJhZGQyIjoiQ3JpbmtsZXkgQm90dG9tIiwiYWRkMyI6IkNyaWNrZXQgU3QgVGhvbWFzIiwiYWRkNCI6IiIsImVtYWlsIjoiIiwicGhvbmUiOiIwMTIyMyA4NTg0MTQiLCJmaXJzdG5hbWUiOiIiLCJsYXN0bmFtZSI6IkJsb2JieSJ9LCJ0cmFjZSI6eyJzcmMiOiJlYXN5LXB2IiwibW9kZSI6ImhlYXRwdW5rLXVrIiwicHJvamVjdElEIjoiMjcxIiwic3ViZG9tYWluIjoiZGV2In19"
}
}
Notable Fields:
Cart
The cart
array contains the full bill of materials as a JSON object. This contains details of all the products that have been specified in the project.
midsummerOrderLink
The midsummerOrderLink
is a URL that can be used to order everything needed for a project from Midsummer.
You can create a customised order link by following this guide.