maloident-api
v1.0.0
Published
Mock server for the MaLoIdent API used in German energy market communication
Maintainers
Readme
MaLoIdent API Mock Server
This project provides a mock implementation of the MaLoIdent API used in the German energy market for identifying market locations (Marktlokation or MaLo). This mock server specifically implements the negative response path for the market location data endpoint.
Overview
The MaLoIdent API is part of the German energy sector's market communication system, developed by EDI@Energy. It's used in the 24-hour supplier change process (LFW24) to query market location IDs and basic master data from network operators.
Features
- Mock implementation of the
/maloId/dataForMarketLocationNegative/v1endpoint - Basic authentication using Bearer tokens
- Request validation
- Error handling
Requirements
- Node.js
- npm
Dependencies
- Express.js - Web server framework
- body-parser - Request body parsing middleware
- cors - Cross-Origin Resource Sharing middleware
Installation
- Clone this repository
- Install dependencies:
npm install express body-parser corsUsage
Starting the Server
node server.jsThe server will start on http://localhost:3000
Test Client
A test client is provided to demonstrate how to interact with the API:
node test-client.jsExample Request
// POST to /maloId/dataForMarketLocationNegative/v1
{
"identificationParameters": {
"meterIdentificationNumber": "123456789",
"marketLocationAddress": {
"street": "Example Street",
"houseNumber": "123",
"postcode": "10115",
"city": "Berlin",
"country": "DE"
}
}
}Example Response
{
"decisionTree": "E_0594",
"responseCode": "A10",
"reason": "No market location found with the given parameters",
"networkOperator": 9900987654321
}API Documentation
POST /maloId/dataForMarketLocationNegative/v1
This endpoint is used to respond to market location identification requests when no matching market location is found or there's an error in processing the request.
Request Headers
Authorization: Bearer token for authentication
Request Body
identificationParameters: Object containing parameters to identify the market locationmeterIdentificationNumber: The meter identification numbermarketLocationAddress: Address information for the market location
Response
decisionTree: Code representing the decision path in the business process (e.g., "E_0594")responseCode: Code representing the response type (e.g., "A10")reason: Text description of the reason for the negative responsenetworkOperator: ID of the network operator
Limitations
This is a mock implementation with simplified validation and responses. In a production environment, the API would have:
- Proper token validation
- Integration with a database for market location lookup
- More comprehensive business logic
- Extensive error handling
- Additional security measures
References
This implementation is based on the MaLoIdent API specification published by EDI@Energy and the German Federal Network Agency (Bundesnetzagentur) for the German energy market.
Maintainer / Impressum
License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
