Receive and accept offers for offsets with the API

Learn how to create API keys and use the API to receive and confirm offers for offsetting fixed amounts of CO2 emissions or amounts of money

Preparation

Create an API key

Open the developer menu in the dashboard and navigate to API Keys. Now click on Add new API keys.

Important: Save the secret key and never pass it on to third parties!

Make an API Request

Now use the endpoint /orders/pending/carbon to request a fixed amount of CO2 emissions or use the endpoint /orders/process/price to request a fixed amount in the desired currency. Then use /orders/{order_id}/process to confirm an offer.

Good to know: You can also use our PHP Library or Node.js Library to interact with the API.

Options

Currency

Use the header parameter X-CURRENCY to select the currency in which the result of the API and the checkout link should be returned. There are over 100 currencies to choose from.

Language

Use the X-LOCALE header parameter to select the language in which the result of the API and the checkout link should be returned.

Certificate recipient

Use the recipient_name parameter to pass a name for the certificate. This can be either a person or a company. With the parameter recipient_email you can pass an e-mail address to which we will send the certificate for compensation. With the parameter send_at you can delay the sending of the certificate by up to 3 days.

Order Count

Adjust the order_count parameter to get up to 3 checkout links with one API call.

Examples

Request offers for 500kg CO2e

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
            ]
        }
    }
]

Request offers over 10 euros

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
            ]
        }
    }
]

Accept an offer

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"
    }
}

No credit card required - Create an account now

Create an account and start calculating and offsetting the CO2 emissions directly via our API. Do you still have questions or need a customized offer? Use the chat or make an appointment directly with our sales team.