7
api v1 ecoaccount post_de
mpeltriaux edited this page 2026-05-10 09:47:15 +00:00

Spezifikation

Ökokonto

Codes

Folgende Attribute referenzieren die Id eines oKey Eintrags für Ökokonten:

  1. biotope
  2. action
  3. conservation_office

POST

Mit POST kann ein neues Ökokonto angelegt werden. Die Daten werden im Request body als application/json gesendet. War der Request erfolgreich, erhält der Sender die id des neu angelegten Eintrags. Beim Erstellen eines neuen Eintrags kann ein optionaler external_identifier mitgegeben werden, der sich auf die ID im Ursprungssystem bezieht. Neben dem neu generierten Identifier in der Response kann dieser Eintrag künftig auch über diesen externen Identifier via API gefunden und bearbeitet werden.

/api/v1/ecoaccount

Beispiel Body

{
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        7.764930725097654,
                        50.530801443594385
                    ],
                    [
                        7.763471603393552,
                        50.52709125717179
                    ],
                    [
                        7.761154174804686,
                        50.524581259743805
                    ],
                    [
                        7.762441635131831,
                        50.52141629007823
                    ],
                    [
                        7.766475677490232,
                        50.51950629189859
                    ],
                    [
                        7.770338058471677,
                        50.51868769758818
                    ],
                    [
                        7.778749465942381,
                        50.51928800147066
                    ],
                    [
                        7.780122756958003,
                        50.52763689111973
                    ],
                    [
                        7.775144577026365,
                        50.533965783820754
                    ],
                    [
                        7.768535614013667,
                        50.533965783820754
                    ],
                    [
                        7.764930725097654,
                        50.530801443594385
                    ]
                ]
            ]
        ],
        "properties": {
            "title": "Tolles Ökokonto",
            "external_identifier": "EXT-ID-12345",
            "deductable_surface": 10000.0,
            "responsible": {
                "conservation_office": null,
                "conservation_file_number": "123-TEST",
                "handler": {
                    "type": "710178",
                    "detail": "Firma Mustermann234"
                }
            },
            "legal": {
                "agreement_date": "2022-01-11"
            },
            "before_states": [
                {
                    "biotope": "136155",
                    "biotope_details": [ 
                        "138046", 
                        "161751"
                    ],
                    "surface": 10000.0
                }
            ],
            "after_states": [
                {
                    "biotope": "136156",
                    "biotope_details": [],
                    "surface": 10000.0
                }
            ],
            "actions": [
                {
                    "action_types": [
                        "709297",
                        "709289",
                        "709299"
                    ],
                    "action_details": [],
                    "amount": 1.0,
                    "unit": "cm",
                    "comment": ""
                }
            ],
            "deadlines": []
        }
    }
    

Beispiel Response

{
    "id": "75c656e3-fdb9-46d5-bbd2-8dd26b6d295f"
}