Eine ausführliche Dokumentation findest du auf GitHub.
Installation
Nutze Composer um das Package in deinem Projekt zu installieren:
composer require klimapi/php
Neue API-Instanz einrichten
1
$klimapi = new KlimAPI\Api\KlimApi('your-secret-api-key');
Beispiele
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);