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-private-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);