PHP code example of sveaekonomi / php-instore

1. Go to this page and download the library: Download sveaekonomi/php-instore library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sveaekonomi / php-instore example snippets


    


nfigure HTTP basic authorization: basic
$config = Svea\Instore\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');

$apiInstance = new Svea\Instore\Api\OrderApi(
    // 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
);
$merchantOrderNumber = "merchantOrderNumber_example"; // string | The unique merchant order number used when creating the order

try {
    $result = $apiInstance->cancelOrder($merchantOrderNumber);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderApi->cancelOrder: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: basic
$config = Svea\Instore\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');

$apiInstance = new Svea\Instore\Api\OrderApi(
    // 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
);
$body = new \Svea\Instore\Model\CreateOrderRequest(); // \Svea\Instore\Model\CreateOrderRequest | 

try {
    $result = $apiInstance->createOrder($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderApi->createOrder: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: basic
$config = Svea\Instore\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');

$apiInstance = new Svea\Instore\Api\OrderApi(
    // 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
);
$merchantOrderNumber = "merchantOrderNumber_example"; // string | The unique merchant order number used when creating the order

try {
    $result = $apiInstance->getOrderStatus($merchantOrderNumber);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderApi->getOrderStatus: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: basic
$config = Svea\Instore\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');

$apiInstance = new Svea\Instore\Api\OrderApi(
    // 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
);
$merchantOrderNumber = "merchantOrderNumber_example"; // string | The unique merchant order number used when creating the order
$body = new \Svea\Instore\Model\RevokeOrderRequest(); // \Svea\Instore\Model\RevokeOrderRequest | Order rows to credit. Doesn't have to match the order rows on the invoice.

try {
    $result = $apiInstance->returnOrder($merchantOrderNumber, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderApi->returnOrder: ', $e->getMessage(), PHP_EOL;
}

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/sveaekonomi/php-instore.git"
    }
  ],
  "