Contracts
The platform allows managing a contract associated with an existing supply point via the Connect API. By including contract prices, the platform is able to accurately calculate the user's energy and power costs based on actual consumption data and to enable all features that rely on euro-based calculations.
To create a contract, the supply point (houseId) must already exist and have a valid CUPS associated. If it does not include a CUPS, the API will return an error and the contract will not be created.
Example Usage
Here is an example of how to use cURL to create a contract:
curl --request POST \
--url https://connect.clever.gy/houses/houseId/contracts \
--header 'accept: application/json' \
--header 'clevergy-api-key: BIzaSyDwdq8dknwUxE8kfi3sdcnwknccK8dlBE1ec' \
--header 'content-type: application/json' \
--data '{
"contractPower": [
3.5,
3.5
],
"startDate": "2022-12-31T23:00:00",
"endDate": "2022-12-31T23:00:00",
"powerPrices": [
0.09,
0.03
],
"energyPrices": [
0.13,
0.12
],
"provider": "EnergyProvider",
"codefare": "2.0TD",
"distributor": "8",
"pvpc": true,
"socialBonus": true,
"tariffName": "Tariff name",
"status": "Active",
"solarPrice": "0.012"
}'
Adding custom energy prices to a contract
If your contract has custom pricing (e.g., hourly prices or any structure other than fixed or 3-period), you can attach a pricing table via a secondary request using the contractId
returned after contract creation including:
startDate
: Start of the pricing interval (format:YYYY-MM-DDTHH:mm:ss
)endDate
: End of the pricing interval (format:YYYY-MM-DDTHH:mm:ss
)price
: Energy price for that interval, in euros per kWh (decimal format)