<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vismutx / klarna-order-management-api-php example snippets
onfigure HTTP basic authorization: basicAuth
$config = Vismutx\KlarnaOrderManagementApiPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new Vismutx\KlarnaOrderManagementApiPhp\Api\CapturesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$order_id = "order_id_example"; // string | Order id
$capture_id = "capture_id_example"; // string | Capture id
$body = new \Vismutx\KlarnaOrderManagementApiPhp\Model\UpdateShippingInfo(); // \Vismutx\KlarnaOrderManagementApiPhp\Model\UpdateShippingInfo |
$klarna_idempotency_key = "klarna_idempotency_key_example"; // string | This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts.
try {
$apiInstance->appendShippingInfo($order_id, $capture_id, $body, $klarna_idempotency_key);
} catch (Exception $e) {
echo 'Exception when calling CapturesApi->appendShippingInfo: ', $e->getMessage(), PHP_EOL;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.