PHP code example of macropage / sdk-ebay-rest-postorder

1. Go to this page and download the library: Download macropage/sdk-ebay-rest-postorder 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/ */

    

macropage / sdk-ebay-rest-postorder example snippets





@see https://developer.ebay.com/devzone/post-order/concepts/MakingACall.html
$config = new \macropage\SDKs\ebay\rest\postorder\Configuration();
$config->setAccessToken('TOKEN xxxxxxxxxxxxxx');
$config->setMarketplaceId('EBAY_DE');

$apiInstance = new macropage\SDKs\ebay\rest\postorder\Api\CancellationSearchApi(
    // 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
);
$cancelId = 'cancelId_example'; // string
$creationDateRangeFrom = 'creationDateRangeFrom_example'; // string
$creationDateRangeTo = 'creationDateRangeTo_example'; // string
$itemId = 'itemId_example'; // string
$legacyOrderId = 'legacyOrderId_example'; // string
$limit = 'limit_example'; // string
$offset = 'offset_example'; // string
$role = 'role_example'; // string
$sort = 'sort_example'; // string
$transactionId = 'transactionId_example'; // string

try {
    $result = $apiInstance->searchCancellations($cancelId, $creationDateRangeFrom, $creationDateRangeTo, $itemId, $legacyOrderId, $limit, $offset, $role, $sort, $transactionId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CancellationSearchApi->searchCancellations: ', $e->getMessage(), PHP_EOL;
}