Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

klimapi-php

This API offers you the possibility to calculate and offset emissions, create checkout links, get statistics and much more.

For more information, please visit https://klimapi.com/resources/docs.

Installation

composer require klimapi/php

Setup new API Instance

$klimapi = newKlimAPI\Api\KlimApi('your-private-api-key');

Examples

Create pending Order by Carbon

$pendingByCarbonRequest = new \KlimAPI\Model\PendingByCarbonRequest([
'kgCO2e' => 200
]);
$order = $klimapi->pendingByCarbon($pendingByCarbonRequest);

Process Order

$processOrder = new \KlimAPI\Model\ProcessOrder([
'recipientName' => 'Test Customer'
]);
$orderId = 'CA-0000-00000000';
$processed_order = $klimapi->process($processOrder, $orderId);

Methods

MethodHTTP requestDescription
addWebhookPOST /webhooks/addAdd Webhook
calculatePOST /calculateCalculate
calculateCartPOST /stores/{store_ident}/cartCalculate
getCategoriesGET /categoriesGet all Categories
getCertificationAuthoritiesGET /certification_authoritiesGet all Certification Authorities
getMetricsPOST /metricsOrder Metrics
getOrderGET /orders/{order_id}Get Order
getOrdersPOST /ordersGet Orders
getPaymentLinkGET /orders/link/{payment_link_id}Get Checkout Link
getProjectGET /projects/{project_id}Get Project
getProjectsGET /projectsGet all supported Projects
linkByCalculationPOST /orders/link/calculateBy Calculation
linkByCarbonPOST /orders/link/carbonBy Carbon
linkByPricePOST /orders/link/priceBy Price
meGET /meGet Authenticated User
orderByCalculationPOST /orders/process/calculateBy Calculation
orderByCarbonPOST /orders/process/carbonBy Carbon
orderByPricePOST /orders/process/priceBy Price
pendingByCalculationPOST /orders/pending/calculateBy Calculation
pendingByCarbonPOST /orders/pending/carbonBy Carbon
pendingByPricePOST /orders/pending/priceBy Price
processPOST /orders/{order_id}/processProcess Pending Order
processCartPOST /stores/{store_ident}/cart/{order_id}/processProcess Cart
refundDELETE /orders/{order_id}/refundRefund Order
removeWebhookDELETE /webhooks/removeRemove Webhook
syncBulkStorePOST /stores/{store_ident}/sync/bulkSync multiple Products
syncStorePOST /stores/{store_ident}/syncSync a single Product

Models

About

KlimAPI API Wrapper for PHP

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages