PHP code example of ordereazi / commerce-sdk

1. Go to this page and download the library: Download ordereazi/commerce-sdk 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/ */

    

ordereazi / commerce-sdk example snippets





 Configure API key authorization: X-Commerce-Key
$config = OrderEaziCommerceApi\Configuration::getDefaultConfiguration()->setApiKey('X-Commerce-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OrderEaziCommerceApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Commerce-Key', 'Bearer');

// Configure Bearer (JWT) authorization: Bearer
$config = OrderEaziCommerceApi\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OrderEaziCommerceApi\Api\AccountApi(
    // 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
);
$change_password_request = new \OrderEaziCommerceApi\Model\ChangePasswordRequest(); // \OrderEaziCommerceApi\Model\ChangePasswordRequest

try {
    $result = $apiInstance->profileChangePasswordApi($change_password_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->profileChangePasswordApi: ', $e->getMessage(), PHP_EOL;
}