Skip to content

Contracts

Every CPE must have a contract that defines the commercial terms between the member and their energy retailer. Contracts are used by the settlement engine to compute grid costs, member savings, and KPIs such as the comparison between collective self-consumption (CSC) and individual self-consumption (ISC).

Contracts are attached to a CPE meter and scoped to a member via user_id.

Contract Fields

Field Required Description
buy_type How buy-side tariff values are provided — FIXED, INDEXED, INDEXED_SIMPLIFIED, or NO_VALUES
sell_type How sell-side tariff values are provided — same options as buy_type
contracted_power Contracted power of the meter (kVA)
voltage_level Voltage level (MAT, AT, MT, BT, BTN simples, etc.)
tariff_cycle Tariff cycle per Portuguese regulation (e.g. TETRA_SEMANAL, BI_HORARIA)
with_holidays Whether public holidays are treated as Sundays for tariff period calculations
validity Start date from which this contract applies (ISO 8601 date)
user_id UUID of the community member this contract belongs to
meter_id UUID of the CPE meter this contract is attached to

Buy and Sell Payloads

When buy_type or sell_type is FIXED, a payload must be provided with tariff values per period:

Field Description
peak_value Tariff value during peak hours (€/kWh)
mid_peak_value Tariff value during mid-peak hours (€/kWh)
off_peak_value Tariff value during off-peak hours (€/kWh)
super_off_peak_value Tariff value during super off-peak hours (€/kWh)
multiplierPMD Multiplier applied to the network access tariff (PMD) component
multiplierERSE Multiplier applied to the ERSE peak hour power tariff component

Contracts without values

Setting buy_type and sell_type to NO_VALUES creates a valid contract structure without tariff data. This is sufficient for market clearing but will prevent settlement from computing cost-related KPIs.