In order to communicate with Cost Allocation Systems, we provide multiple methods for automatic data exchange via API.

One way to make sure the relevant data for a professional and process conform AMR installation and maintenance is to forward the data periodically or in real time to our api.

Step 1: Creating the real estate


curl --request POST \\
  --url <https://api.comgy.io/v0/real-estates> \\
  --header 'accept: application/vnd.api+json' \\
  --header 'authorization: JWT_TOKEN' \\
  --header 'origin: <https://api.comgy.io>' \\
  --data '{
	"data": {
		"type": "real-estates",
		"attributes": {
			"name": "My First Real Estate",
			"identification-key": "YOUR_INTERNAL_IDENTIFIER"
		}
	}
}'

Step 2: Creating Stairways (Optional)


curl --request POST \\
  --url <https://api.comgy.io/v0/stairways> \\
  --header 'accept: application/vnd.api+json' \\
  --header 'authorization: JWT_TOKEN' \\
  --header 'origin: <https://api.comgy.io>' \\
  --data '{
	"data": {
		"type": "stairways",
		"attributes": {
			"name": "Stairway"
		},
		"relationships": {
			"real-estate": {
				"data": {
					"id": "$REAL_ESTATE_ID",
					"type": "real-estates"
				}
			}
		}
	}
}'

Step 3: Create Estate Units


curl --request POST \\
  --url <https://api.comgy.io/v0/estate-units?include=installation-location> \\
  --header 'accept: application/vnd.api+json' \\
  --header 'authorization: JWT_TOKEN' \\
  --header 'origin: <https://api.comgy.io>' \\
  --data '{
	"data": {
		"type": "estate-units",
		"attributes": {
			"name": "WE 1",
			"position": "1. OG rechts",
			"area": "50",
			"heated-area": "50",
			"external-number": "$YOUR_INTERNAL_IDENTIFIER"
		},
		"relationships": {
			"real-estate": {
				"data": {
					"id": "$REAL_ESTATE_ID",
					"type": "real-estates"
				}
			},
			"stairway": {
				"data": {
					"id": "$STAIRWAY_ID",
					"type": "stairways"
				}
			}
		}
	}
}'

<aside> 👉 You need to add include=installation-location to retrieve the estate units installation location which is needed for creating a meter point

</aside>

Step 4: Create Meter Points