Contract Model
The Contract model represents the snapshot data sent as a contract webhook. It includes all relevant contract information, including user, duration, type, financials, and lifecycle metadata.
Fields
| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier of the contract. |
collective_id | uuid (nullable) | Collective identifier associated with the contract. |
energy_contract_type | EnergyContractType | Type of energy contract. |
is_company | boolean | Indicates if the contract belongs to a company. |
contract_duration | ContractDuration | Duration of the contract. |
contract_variables | ContractPayload | Payload for contract variables. |
has_tax_credit_right | boolean | Indicates if the contract has tax credit rights. |
contract_phase | ContractPhase | Phase of the contract. |
transfer_type | TransferType | Type of transfer. |
user_id | uuid | Identifier of the user associated with the contract. |
number | integer | Contract number. |
monthly_deposit | MonthlyDeposit | Monthly deposit amount and breakdown. |
contract_labels | ContractLabels[] | Labels associated with the contract. |
accepted_at | datetime (nullable) | Date when the contract was accepted. |
created_at | datetime | Date when the contract was created. |
updated_at | datetime | Date when the contract was last updated. |
deleted_at | datetime (nullable) | Date when the contract was deleted, if applicable. |
MonthlyDeposit
Represents the monthly deposit amount associated with a contract.
| Field | Type | Description |
|---|---|---|
total_excl | decimal (nullable) | Total amount excluding VAT. |
total_incl | decimal (nullable) | Total amount including VAT. |
vat | decimal (nullable) | Value-added tax. |
products | Product[] | List of products associated with the deposit. |
Product
Represents a product or service associated with a contract.
| Field | Type | Description |
|---|---|---|
name | string (nullable) | Name of the product. |
monthly_price | Price | Monthly price of the product. |
price_lines | PriceLine[] | List of price lines for the product. |
PriceLine
Represents a price line associated with a product.
| Field | Type | Description |
|---|---|---|
description | string (nullable) | Description of the price line. |
unit_price | Price | Unit price of the price line. |
quantity | decimal (nullable) | Quantity of the unit. |
interval | integer (nullable) | Interval of the price line. |
price | Price | Total price of the price line. |
ContractPayload
Payload data for a contract, including yearly estimates and period dates.
| Field | Type | Description |
|---|---|---|
yearly_estimate_electricity | integer (nullable) | Yearly estimate for electricity usage. |
yearly_estimate_production | integer (nullable) | Yearly estimate for electricity production. |
yearly_estimate_gas | integer (nullable) | Yearly estimate for gas usage. |
electricity_distribution | integer (nullable) | Electricity distribution value. |
start_date | datetime (nullable) | Start date of the contract. |
end_date | datetime (nullable) | End date of the contract. |
stopped_date | datetime (nullable) | Stopped date of the contract. |
current_period_start_date | datetime (nullable) | Start date of the current period. |
ContractLabels
Represents a label associated with a contract.
| Field | Type | Description |
|---|---|---|
name | string | Name of the label. |
value | string | Value of the label. |
Enums
EnergyContractType
Type of energy contract:
FixedVariableDynamic
ContractDuration
Duration of the contract:
MonthHalfYearYearTwoYearsThreeYearsFiveYears
ContractPhase
Phase of the contract (selected values):
UserInputUserAgreementMeteringPointsCheckedRetrievedVerificationDateCheckedSmartMeterCheckedUsageCheckedSmartMeterFoundFirstInvoiceSendFirstPaymentDoneDeliveryPlannedDeliveryStartedDeliveryFailedDeliveryStoppedNeverDeliveredMeterUnderConstructionDemoContractCreatedInsightContractActiveInsightNeverActiveInsightContractStoppedSmartChargingContractCreatedSmartChargingCarAttachedSmartChargingActiveSmartChargingStopped
TransferType
Type of transfer:
SwitchRehousing
Example Contract JSON
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"collective_id": null,
"energy_contract_type": "Fixed",
"is_company": false,
"contract_duration": "Year",
"contract_variables": {
"yearly_estimate_electricity": 3500,
"yearly_estimate_production": 0,
"yearly_estimate_gas": 1200,
"electricity_distribution": 1,
"start_date": "2024-01-01T00:00:00Z",
"end_date": "2025-01-01T00:00:00Z",
"stopped_date": null,
"current_period_start_date": "2024-01-01T00:00:00Z"
},
"has_tax_credit_right": true,
"contract_phase": "UserAgreement",
"transfer_type": "Switch",
"user_id": "c9bf9e57-1685-4c89-bafb-ff5af830be8a",
"number": 12345,
"monthly_deposit": {
"total_excl": "100.00",
"total_incl": "121.00",
"vat": "21.00",
"products": [
{
"name": "Electricity",
"monthly_price": "80.00",
"price_lines": [
{
"description": "Base fee",
"unit_price": "40.00",
"quantity": "2",
"interval": 1,
"price": "80.00"
}
]
}
]
},
"contract_labels": [
{ "name": "Green", "value": "Yes" }
],
"accepted_at": "2024-01-02T12:00:00Z",
"created_at": "2024-01-01T09:00:00Z",
"updated_at": "2024-01-02T12:00:00Z",
"deleted_at": null
}
See Also
Price(referenced in Product and PriceLine)- API endpoints that use the
Contractmodel