PHP Library

Use our PHP package to quickly and easily integrate KlimAPI into your existing PHP project.

You can find a more detailed documentation on GitHub.

Installation

Use Composer to install the package:

composer require klimapi/php

Setup new API Instance

1
$klimapi = new KlimAPI\Api\KlimApi('your-secret-api-key');

Examples

Create pending Order by Carbon

1
2
3
4
5
$pendingByCarbonRequest = new \KlimAPI\Model\PendingByCarbonRequest([
    'kgCO2e' => 200
]);

$order = $klimapi->pendingByCarbon($pendingByCarbonRequest);

Process Order

1
2
3
4
5
6
$orderId = 'CA-0000-00000000';
$processOrder = new \KlimAPI\Model\ProcessOrder([
    'recipientName' => 'Test Customer'
]);

$processed_order = $klimapi->process($orderId, $processOrder);

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.