Created
March 1, 2016 09:42
-
-
Save davidtsadler/ecabc146bc7ddbe5fe0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__.'/vendor/autoload.php'; | |
use \DTS\eBaySDK\Constants; | |
use \DTS\eBaySDK\Trading\Services; | |
use \DTS\eBaySDK\Trading\Types; | |
use \DTS\eBaySDK\Trading\Enums; | |
$service = new Services\TradingService(array( | |
'apiVersion' => '941', | |
'siteId' => Constants\SiteIds::US | |
)); | |
$request = new Types\SetStoreCategoriesRequestType(); | |
$request->RequesterCredentials = new Types\CustomSecurityHeaderType(); | |
$request->RequesterCredentials->eBayAuthToken = ''; | |
$request->Action = 'Move'; | |
$request->ItemDestinationCategoryID = 14127; | |
$request->DestinationParentCategoryID = 14122; | |
$request->StoreCategories = new Types\StoreCustomCategoryArrayType(); | |
$category = new Types\StoreCustomCategoryType(); | |
$category->CategoryID = 19227; | |
$category->Name = 'MP3 Players and Accessories'; | |
$category->Order = 1; | |
$request->StoreCategories->CustomCategory[] = $category; | |
$category = new Types\StoreCustomCategoryType(); | |
$category->CategoryID = 19228; | |
$category->Name = 'GPS Devices'; | |
$category->Order = 2; | |
$request->StoreCategories->CustomCategory[] = $category; | |
$response = $service->SetStoreCategories($request); | |
if (isset($response->Errors)) { | |
foreach ($response->Errors as $error) { | |
printf("%s: %s\n%s\n\n", | |
$error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning', | |
$error->ShortMessage, | |
$error->LongMessage | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment