Mit der API Angebote für Kompensationen erhalten und annehmen

Erfahre, wie du API-Keys erstellst und die API verwendest, um Angebote für die Kompensation von festgelegten CO2-Emissionsmengen oder Geldbeträgen zu erhalten und zu bestätigen.

Vorbereitung

API Key erstellen

Öffne im Dashboard das Entwickler-Menü und navigiere zum Punkt API Keys. Klicke nun auf Neue API Keys hinzufügen. Um Emissionen zu berechnen benötigen deine API Keys Schreiben-Berechtigungen.

Wichtig: Speichere dir den Privaten Key gut ab und gebe ihn niemals an dritte weiter!

API anfragen

Nutze nun den Endpunkt /orders/pending/carbon, um eine fixe Summe CO2 Emissionen anzufragen oder nutze den Endpunkt /orders/process/price, um einen fixen Betrag in der gewünschten Währung anzufragen. Nutze dann /orders/{order_id}/process um ein Angebot zu bestätigen.

Gut zu wissen: Du kannst auch unsere PHP Library oder unsere Node.js Library nutzen, um mit der API zu interagieren.

Optionen

Währung

Wähle mit Hilfe des Header-Parameters X-CURRENCY, in welcher Währung das Ergebnis der API und der Checkout Link zurückgegeben werden sollen. Es stehen über 100 Währungen zur Auswahl.

Sprache

Wähle mit Hilfe des Header-Parameters X-LOCALE, in welcher Sprache das Ergebnis der API und der Checkout Link zurückgegeben werden sollen.

Zertifikats-Empfänger

Übergebe mit dem Parameter recipient_name einen Namen für das Zertifikat. Das kann sowohl eine Person als auch ein Unternehmen sein. Mit dem Parameter recipient_email kannst du eine E-Mail Adresse übergeben, an welche wir das Zertifikat für die Kompensation senden. Mit dem Parameter send_at kannst du das versenden des Zertifikats um bis zu 3 Tage verzögern.

Order Count

Passe den Parameter order_count an, um bis zu 3 Angebote zur Kompensation mit einem API call zu erhalten.

Beispiele

Angebote für 500kg CO2e anfordern

POST/v2/orders/pending/carbon

1
2
3
4
{
    "kgCO2e": 500,
    "order_count": 2
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[
    {
        "order_id": "CA-0000-00000000",
        "status": "pending",
        "price": 8.57,
        "currency": "EUR",
        "kgCO2e": 500,
        "metadata": {},
        "project": {
            "id": "00000000-0000-0000-0000-000000000000",
            "title": "Example Project",
            "summary": "Example Summary",
            "status": "Active",
            "category_id": 3,
            "certification_authority_id": 2,
            "country": "Example Country",
            "description": null,
            "goals": null,
            "images": [
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_1.jpeg",
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_2.jpeg"
            ],
            "benefits": [
                7,
                8,
                13
            ]
        }
    },
    {
        "order_id": "CA-0000-00000001",
        "status": "pending",
        "price": 8.57,
        "currency": "EUR",
        "kgCO2e": 500,
        "metadata": {},
        "project": {
            "id": "00000000-0000-0000-0000-000000000000",
            "title": "Example Project",
            "summary": "Example Summary",
            "status": "Active",
            "category_id": 3,
            "certification_authority_id": 2,
            "country": "Example Country",
            "description": null,
            "goals": null,
            "images": [
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_1.jpeg",
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_2.jpeg"
            ],
            "benefits": [
                7,
                8,
                13
            ]
        }
    }
]

Angebote über 10 Euro anfordern

POST/v2/orders/pending/price

1
2
3
4
{
    "price_amount": 10,
    "order_count": 2
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[
    {
        "order_id": "CA-0000-00000000",
        "status": "pending",
        "price": 10,
        "currency": "EUR",
        "kgCO2e": 488,
        "metadata": {},
        "project": {
            "id": "00000000-0000-0000-0000-000000000000",
            "title": "Example Project",
            "summary": "Example Summary",
            "status": "Active",
            "category_id": 3,
            "certification_authority_id": 2,
            "country": "Example Country",
            "description": null,
            "goals": null,
            "images": [
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_1.jpeg",
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_2.jpeg"
            ],
            "benefits": [
                7,
                8,
                13
            ]
        }
    },
    {
        "order_id": "CA-0000-00000001",
        "status": "pending",
        "price": 10,
        "currency": "EUR",
        "kgCO2e": 488,
        "metadata": {},
        "project": {
            "id": "00000000-0000-0000-0000-000000000000",
            "title": "Example Project",
            "summary": "Example Summary",
            "status": "Active",
            "category_id": 3,
            "certification_authority_id": 2,
            "country": "Example Country",
            "description": null,
            "goals": null,
            "images": [
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_1.jpeg",
                "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_2.jpeg"
            ],
            "benefits": [
                7,
                8,
                13
            ]
        }
    }
]

Angebot annehmen

POST/v2/orders/CA-0000-00000000/process

1
2
3
4
{
    "recipient_name": "Test Customer",
    "recipient_email": "test-order@klimapi.com"
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
    "order_id": "CA-0000-00000000",
    "status": "processed",
    "certificate_issued_at": "2024-06-06T20:22:32.407Z",
    "certificate_url": "https://certificates.klimahelden.eu/CA-0000-00000000",
    "certificate_pdf": "https://certificates.klimahelden.eu/certificate/download?locale=en&order_id=CA-0000-00000000",
    "price": 10,
    "currency": "USD",
    "kgCO2e": 500,
    "metadata": {},
    "project": {
        "id": "00000000-0000-0000-0000-000000000000",
        "title": "Example Project",
        "summary": "Example Summary",
        "status": "Active",
        "category_id": 3,
        "certification_authority_id": 2,
        "country": "Example Country",
        "description": null,
        "goals": null,
        "images": [
            "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_1.jpeg",
            "https://cdn.klimapi.com/projects/00000000-0000-0000-0000-000000000000_2.jpeg"
        ],
        "benefits": [
            7,
            8,
            13
        ]
    },
    "recipient": {
        "name": "Test Customer",
        "email": "test-order@klimapi.com"
    }
}

Keine Kreditkarte erforderlich - Erstelle dir jetzt einen Account

Erstelle ein Konto und beginne direkt mit der Berechnung und Kompensation der CO2-Emissionen über unsere API. Du hast noch Fragen oder benötigst ein individuelles Angebot? Nutze den Chat oder vereinbare direkt einen Termin mit unserem Sales-Team.

Fragen? Schreib uns