Skip to content

MonopolX Contracts API v1 (Alpha)

Contracts

Manage contracts

Get

Get a contract by its id and tenant id.

Output: Contract

DeviceInfo aka. Geräteinfosatz.

Field Type Rules Description
*tenant string string pattern: ^[0-9a-z-]+$ The tenant the contract belongs to.
*id string string min. length: 1 The contract's ID in the tenant's scope.
installation enpowerx.types.TenantScopedResource Installation number of a device.
external_contract_number string The external contract id to the tenant.
type Type Type of the contract.
customer_businesspartner_number string Id of the customer business partner.
supplier_businesspartner_number string Id of the supplier business partner.
filing_cancellation_date google.type.Date Date of filing the contract cancellation.
cancelling_entity CancelledBy The entity who cancelled the contract.
cancellation_reason string Reason for cancellation.
revoked_date google.type.Date The date the contract was revoked.
effective_revocation_date google.type.Date The effective date the contract was revoked.
different_invoice_receiver enpowerx.types.TenantScopedResource A differing invoice receiver if any.
commodity Commodity enum defined only
enum not in: [0]
The provided energy type to this contract.
start_date google.type.Date Start date of the contract.
end_date google.type.Date Contractual end date to the contract.
regular_reading_network_operator_date google.type.Date The regular reading date by network operator.
regular_reading_supplier_date google.type.Date The regular reading date by supplier business partner.
state Contract.State The current contract state.
*source string The source of the contract.
*bank_data_number int64 The bank id attached to this contract.

Create

Create a contract by its id and tenant id.

Input: Contract

DeviceInfo aka. Geräteinfosatz.

Field Type Rules Description
*tenant string string pattern: ^[0-9a-z-]+$ The tenant the contract belongs to.
*id string string min. length: 1 The contract's ID in the tenant's scope.
installation enpowerx.types.TenantScopedResource Installation number of a device.
external_contract_number string The external contract id to the tenant.
type Type Type of the contract.
customer_businesspartner_number string Id of the customer business partner.
supplier_businesspartner_number string Id of the supplier business partner.
filing_cancellation_date google.type.Date Date of filing the contract cancellation.
cancelling_entity CancelledBy The entity who cancelled the contract.
cancellation_reason string Reason for cancellation.
revoked_date google.type.Date The date the contract was revoked.
effective_revocation_date google.type.Date The effective date the contract was revoked.
different_invoice_receiver enpowerx.types.TenantScopedResource A differing invoice receiver if any.
commodity Commodity enum defined only
enum not in: [0]
The provided energy type to this contract.
start_date google.type.Date Start date of the contract.
end_date google.type.Date Contractual end date to the contract.
regular_reading_network_operator_date google.type.Date The regular reading date by network operator.
regular_reading_supplier_date google.type.Date The regular reading date by supplier business partner.
state Contract.State The current contract state.
*source string The source of the contract.
*bank_data_number int64 The bank id attached to this contract.

Output: Contract

DeviceInfo aka. Geräteinfosatz.

Field Type Rules Description
*tenant string string pattern: ^[0-9a-z-]+$ The tenant the contract belongs to.
*id string string min. length: 1 The contract's ID in the tenant's scope.
installation enpowerx.types.TenantScopedResource Installation number of a device.
external_contract_number string The external contract id to the tenant.
type Type Type of the contract.
customer_businesspartner_number string Id of the customer business partner.
supplier_businesspartner_number string Id of the supplier business partner.
filing_cancellation_date google.type.Date Date of filing the contract cancellation.
cancelling_entity CancelledBy The entity who cancelled the contract.
cancellation_reason string Reason for cancellation.
revoked_date google.type.Date The date the contract was revoked.
effective_revocation_date google.type.Date The effective date the contract was revoked.
different_invoice_receiver enpowerx.types.TenantScopedResource A differing invoice receiver if any.
commodity Commodity enum defined only
enum not in: [0]
The provided energy type to this contract.
start_date google.type.Date Start date of the contract.
end_date google.type.Date Contractual end date to the contract.
regular_reading_network_operator_date google.type.Date The regular reading date by network operator.
regular_reading_supplier_date google.type.Date The regular reading date by supplier business partner.
state Contract.State The current contract state.
*source string The source of the contract.
*bank_data_number int64 The bank id attached to this contract.

Update

Update a contract.

Input: UpdateContractRequest

Field Type Rules Description
*contract Contract The contract to create.
*update_mask google.protobuf.FieldMask The update mask applies to the resource. For the FieldMask definition,
see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

Output: Contract

DeviceInfo aka. Geräteinfosatz.

Field Type Rules Description
*tenant string string pattern: ^[0-9a-z-]+$ The tenant the contract belongs to.
*id string string min. length: 1 The contract's ID in the tenant's scope.
installation enpowerx.types.TenantScopedResource Installation number of a device.
external_contract_number string The external contract id to the tenant.
type Type Type of the contract.
customer_businesspartner_number string Id of the customer business partner.
supplier_businesspartner_number string Id of the supplier business partner.
filing_cancellation_date google.type.Date Date of filing the contract cancellation.
cancelling_entity CancelledBy The entity who cancelled the contract.
cancellation_reason string Reason for cancellation.
revoked_date google.type.Date The date the contract was revoked.
effective_revocation_date google.type.Date The effective date the contract was revoked.
different_invoice_receiver enpowerx.types.TenantScopedResource A differing invoice receiver if any.
commodity Commodity enum defined only
enum not in: [0]
The provided energy type to this contract.
start_date google.type.Date Start date of the contract.
end_date google.type.Date Contractual end date to the contract.
regular_reading_network_operator_date google.type.Date The regular reading date by network operator.
regular_reading_supplier_date google.type.Date The regular reading date by supplier business partner.
state Contract.State The current contract state.
*source string The source of the contract.
*bank_data_number int64 The bank id attached to this contract.

CancelledBy

Name Number Description
CANCELLED_BY_UNSPECIFIED 0 Contract was cancelled by an unknown entity.
AGENT 1 Contract was cancelled by Agent.
PROVIDER 2 Contract was cancelled by Provider.
SYSTEM 3 Contract was cancelled by System.

Commodity

Name Number Description
COMMODITY_UNSPECIFIED 0 Contract is related to an unspecified energy type.
WATER 1 Contract is related to water as energy type.
WATERSEWAGE 2 Contract is related to water sewage as energy type.
HEAT 3 Contract is related to heat as energy type.

Contract.State

Name Number Description
STATE_UNSPECIFIED 0 Contract state is unspecified.
ACTIVE 1 Contract is active.
CANCELLED 2 Contract has been cancelled.
TERMINATED 3 Contract has been terminated.
EXPIRED 4 Contract has expired.

Type

Name Number Description
TYPE_UNSPECIFIED 0 Contract type is unspecified.
TBD 1 Contract is TBD.

Shared Types

Amount

Field Type Rules Description
unit string The unit of the amount. E.g.'kWh' or 'PCS' for pieces.
units int64 The whole units of the amount.
For example if unit is "PCS", then 1 unit is one piece.
nanos int32 Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units is positive, nanos must be positive or zero.
If units is zero, nanos can be positive, zero, or negative.
If units is negative, nanos must be negative or zero.
For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

BankAccount

Information about a bank account.

Field Type Rules Description
*iban string string pattern: ^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}$ The International Bank Account Number.
bic string The Bank Identifier Code.
account_holder string The name of the account holder.
bank string The name of the bank.

CustomerType

Represents the kind of the customer.

Name Number Description
CUSTOMER_TYPE_UNSPECIFIED 0 The customer type is unspecified.
PRIVATE 1 The customer type is private.
BUSINESS 2 The customer type is business.
BOTH 3 The customer type is private and business.

DateRange

Represents a range of dates.

Field Type Rules Description
*start google.type.Date message required The start date.
end google.type.Date The end date.

DateTimeRange

Represents a range of date times.

Field Type Rules Description
*start google.protobuf.Timestamp timestamp required The start date.
end google.protobuf.Timestamp The end date.

Decimal

Field Type Rules Description
units int64 The whole units of the amount.
nanos int32 Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units is positive, nanos must be positive or zero.
If units is zero, nanos can be positive, zero, or negative.
If units is negative, nanos must be negative or zero.
For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

Billing

Billing details.

Field Type Rules Description
*contact Contact message required The contact to send invoices to.
*payment_method PaymentMethod enum defined only
enum not in: [0]
The payment method method.
bank_account BankAccount The bank account used if payment_method is DIRECT_DEBIT.

CommunicationChannel

Communication channel.

Name Number Description
COMMUNICATION_CHANNEL_UNSPECIFIED 0 Channel not specified.
LETTER 1 Send messages via letter.
EMAIL 2 Send messages via email.
SMS 3 Send messages via SMS.
MESSENGER 4 Send messages via messenger apps like WhatsApp.
PHONE 5 Communicate via telephone.

Contact

Contact details (postal, phone, etc.).

Field Type Rules Description
*person Person message required Information on how to address the contact.
postal_address PostalAddress The contact's postal address.
phone_number string string pattern: ^$\|^[\\+0][\\d\\s\\(\\)\\/-]+$ The phone number of the contact.
Values are normalized into the form +123456789.
email string string email
string ignore empty
The email address of the contact.
careof Person A person that may receive communication in the name of the actual recipient (e.g. a "C/O" line added to the postal address).

Reading

Information about a reading.

Field Type Rules Description
*date google.type.Date message skip
message required
The date when the reading was taken.
channel Reading.Channel How the reading was reported.
This is value is ignored when submitting via AddMine.
*values Reading.ValuesEntry map keys string min. length: 1
map values double >: 0
repeated
A map of values to submit with OBIS codes as the key.
ignore_plausibility_check_reason google.protobuf.StringValue If set the meter reading(s) will be saved, even if they're not plausible.
Specifies the reason why the plausibility check is to be ignored.

Reading.ValuesEntry

Field Type Rules Description
key string
value double

Reading.Channel

Name Number Description
CHANNEL_UNSPECIFIED 0 No channel specified.
PORTAL 1 Reported via end-user portal.
EMAIL 2 Reported via email.
LETTER 3 Reported via letter.
PHONE 4 Reported via phone call.
MSCONS 5 Reported via Metered Services Consumption report message.

Relocation

Information about the relocation of an contract.

Field Type Rules Description
*contract string string min. length: 1 The contract's ID this request is targeting.
*moveout_date google.type.Date message skip
message required
The move-out date.
*movein_date google.type.Date message skip
message required
The move-in date.
*delivery EnergyDelivery message required Which kind and amount of energy is to be delivered to where.
*use_new_address Relocation.UseNewAddress enum defined only
enum not in: [0]
Use the new address as postal and billing address.
*meter string string min. length: 1 The ID of the meter at the new consumption point.
last_reading Reading The last reading at the old consumption point.
old_meter string The ID of the meter at the old consumption point.
Optional, must be set if a last reading is provided.

Relocation.UseNewAddress

Name Number Description
USE_NEW_ADDRESS_UNSPECIFIED 0 Use unspecified.
NO 1 Use not desired.
IMMEDIATELY 2 Use immediately desired.
ON_MOVE_IN 3 Use on moving in desired.

SalesInfo

Information on how a sale was made.

Field Type Rules Description
sales_partner_code string Direct sales partner code.
sales_partner_code_second string Second direct sales partner code.
campaign string Optional override for the default campaign.

ScheduledRequest

Reference to an entity with an optional scheduled starting date.

Field Type Rules Description
*id string string min. length: 1 The ID referencing the entity.
scheduled_date google.type.Date The scheduled starting date (earliest possible if unset).

TransitionType

Specifies modalities of a contract transition.

Name Number Description
TRANSITION_TYPE_UNSPECIFIED 0 The transition type is unspecified
MANUAL_TERMINATION 1 The customer terminates the prior contract.
VENDOR_TERMINATION 2 The vendor terminates the prior contract.
RELOCATION 3 The customer is going to or has recently moved to the new address.

Duration

Represents a coarse time duration (e.g., 2 months).

Field Type Rules Description
*units int32 int32 >=: 0 The number of time units.
*type google.type.CalendarPeriod enum in: [1 2 3 4 5 6 7] The type the units refer to (days, months, etc.).

EnergyDelivery

Describes which kind and amount of energy is to be delivered to where.

Field Type Rules Description
*energy_type EnergyType enum defined only
enum not in: [0]
The kind of the energy.
*customer_type CustomerType enum defined only
enum not in: [0]
The kind of the customer.
*address PostalAddress message required The address to deliver energy to.
annual_usage int32 int32 >=: 0 The estimated power usage in kWh per year.
usage_type EnergyDelivery.UsageType The usage type for the delivered energy.
annual_usage_nt int32 int32 >=: 0 The estimated off-peak power usage in kWh per year (DE: Niedertarifverbrauch).

EnergyDelivery.UsageType

Name Number Description
USAGE_TYPE_UNSPECIFIED 0 The consumption type is unspecified.
HOUSEHOLD_ELECTRICITY 1 The energy is used for household.
CHARGING_CURRENT 2 The energy is used for charging.
STORAGE_HEATER 3 The energy is used for a storage heater.
HEAT_PUMP 4 The energy is used for a heat pump.
HOUSEHOLD_ELECTRICITY_AND_STORAGE_HEATER 5 The energy is used for household with storage heater.
HOUSEHOLD_ELECTRICITY_AND_HEAT_PUMP 6 The energy is used for household with heat pump.

EnergyType

Represents the kind of the energy.

Name Number Description
ENERGY_TYPE_UNSPECIFIED 0 The energy type is unspecified.
ELECTRICITY 1 The energy type is electricity.
GAS 2 The energy type is gas.

FileContent

Field Type Rules Description
*mime_type string string min. length: 1 The media type / content type of the document.
*content bytes bytes min. length: 1 The raw data of the document.

StringListFilter

Strings filter x IN and x NOT IN semantics.

Field Type Rules Description
*values string repeated min items: 1
repeated
The value to filter for.
negate bool If true the expression is negated.

StringScalarFilter

StringFilter provides match semantics for strings fields.

Field Type Rules Description
*value string string min. length: 1 The value to filter for.
match_mode StringScalarFilter.MatchMode The match mode to use.
negate bool If true the expression is negated.

StringScalarFilter.MatchMode

Name Number Description
MATCH_MODE_UNSPECIFIED 0 The match mode is unspecified.
EXACT 1 Filter only matches if the field contains exactly the expected value.
PREFIX 2 Filter matches all fields that are prefixed with the given value.
SUFFIX 3 Filter matches all fields that are suffixed with the given value.
SUBSTRING 4 Filter matches all fields that contain the given value.

LetterAddress

Combines a name and a postal address.

Field Type Rules Description
*person Person message required The person being addressed.
careof string A person that may receive letters in the name of the actual recipient (e.g. a "C/O" line added to the postal address).
*postal_address PostalAddress message required The postal address.

PaymentMethod

Possible methods for paying invoices.

Name Number Description
PAYMENT_METHOD_UNSPECIFIED 0 The payment method method is unspecified.
DIRECT_DEBIT 1 Money is automatically withdrawn from the specified bank account.
MANUAL_TRANSFER 2 The customer pays bills manually using money transfers.

Person

Information on how to address a person. A person can be either a natural person or a company with an optional contact Natural Person: Must provide firstname, lastname Company: Must provide company

Field Type Rules Description
salutation Person.SalutationForm The salutation of the person.
title string The title of the person.
firstname string The first name of the person.
lastname string The last name of the person.
birthday google.type.Date The birthday of the person.
company string The company name.

Person.SalutationForm

Name Number Description
SALUTATION_FORM_UNSPECIFIED 0 The salutation form is unspecified.
MRS 1 The salutation form is Mrs..
MR 2 The salutation form is Mr..
DIVERSE 3 The salutation form is Diverse.
FAMILY 4 The salutation form is Family.

PostalAddress

Represents a postal address, e.g. for postal delivery or payments addresses.

Field Type Rules Description
*region string string min. length: 1 The region the address is located in as a CLDR region code.
Example: DE for Germany
*postal_code string string min. length: 1 A postal code of the city (a city may have more than one).
Example: 76131 for Karlsruhe inner city
*city string string min. length: 1 The canonical name of the city (there may be more than one per postal code).
Example: Karlsruhe
street string The canonical name of the street.
Example: Kaiserstr.
house_number string The house number.
Examples: 32, 32a, 32/1
postbox_number string Postbox number in case address is a postbox.
district string Administrative division (i.e. Stadtteil).
additional_address_lines string repeated Additional address lines
Example: Appartment 104, Care of etc.

Price

Represents a price before and after taxes.

Field Type Rules Description
*net google.type.Money The price without VAT.
*gross google.type.Money The price including VAT.
unit string The unit the price is related to (e.g "kWh", "PCS", "month", etc.)

RecurringCost

Represents a price/cost that repeats at a fixed interval.

Field Type Rules Description
*price Price message required The price per interval.
*interval google.type.CalendarPeriod enum defined only
enum not in: [0]
The interval at which the cost occurs (per day, month, etc.).

TenantScopedListRequest

Field Type Rules Description
*tenant string string pattern: ^[0-9a-z-]+$ The tenant the product list belongs to.
page_size int32 The maximum number of items to return. 0 for default.
page_token string The next_page_token value returned from a previous List request, if any.

TenantScopedResource

A tenant scoped resource.

Field Type Rules Description
*tenant string string pattern: ^[0-9a-z-]+$ The tenant the resource belongs to.
*id string string min. length: 1 The ID of the resource.

InternalError

results in code INTERNAL / 500

InvalidReferenceError

This error is used to reject a request because an identifier referencing another entity could not be looked up. This is usually employed in methods that create or update data, reflecting either a frontend error, or a data consistency problem. Note that this is distinct from the NotFound*Errors that should be used when the identifier was needed to look up a resource (e.g. the tenant).

Field Type Rules Description
field string field containing the invalid reference

NotFoundTenantError

The provided tenant id is unknown. Results in code NOT_FOUND / 404

PermissionDeniedError

results in code PERMISSION_DENIED / 403

UnauthenticatedError

results in code UNAUTHENTICATED / 401

UnavailableError

results in code UNAVAILABLE / 503

UnimplementedError

The method or a specific use case within it is not implemented Results in code UNIMPLEMENTED / 501

File-level Extensions

Extension Type Base Number Description
throws string .google.protobuf.MethodOptions 76131 throws is used to document error messages that the method might return in status.details.
The following errors are to be expected for almost any EnPowerX method and
do not have to be documented:
- google.rpc.BadRequest
- enpowerx.errors.InternalError
- enpowerx.errors.UnavailableError
- enpowerx.errors.PermissionDeniedError
- enpowerx.errors.UnauthenticatedError
- enpowerx.errors.NotFoundTenantError

CalendarPeriod

A CalendarPeriod represents the abstract concept of a time period that has a canonical start. Grammatically, "the start of the current CalendarPeriod." All calendar times begin at midnight UTC.

Name Number Description
CALENDAR_PERIOD_UNSPECIFIED 0 Undefined period, raises an error.
DAY 1 A day.
WEEK 2 A week. Weeks begin on Monday, following
ISO 8601.
FORTNIGHT 3 A fortnight. The first calendar fortnight of the year begins at the start
of week 1 according to
ISO 8601.
MONTH 4 A month.
QUARTER 5 A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each
year.
HALF 6 A half-year. Half-years start on dates 1-Jan and 1-Jul.
YEAR 7 A year.

Date

Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent:

  • A full date, with non-zero year, month and day values
  • A month and day value, with a zero year, e.g. an anniversary
  • A year on its own, with zero month and day values
  • A year and month value, with a zero day, e.g. a credit card expiration date

Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and google.protobuf.Timestamp.

Field Type Rules Description
year int32 Year of date. Must be from 1 to 9999, or 0 if specifying a date without
a year.
month int32 Month of year. Must be from 1 to 12, or 0 if specifying a year without a
month and day.
day int32 Day of month. Must be from 1 to 31 and valid for the year and month, or 0
if specifying a year by itself or a year and month where the day is not
significant.

Money

Represents an amount of money with its currency type.

Field Type Rules Description
currency_code string The 3-letter currency code defined in ISO 4217.
units int64 The whole units of the amount.
For example if currencyCode is "USD", then 1 unit is one US dollar.
nanos int32 Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units is positive, nanos must be positive or zero.
If units is zero, nanos can be positive, zero, or negative.
If units is negative, nanos must be negative or zero.
For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)

Legend

*) required