Created
March 1, 2016 09:42
-
-
Save davidtsadler/33cddb98166967e81c26 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->DestinationParentCategoryID = -999; | |
$request->StoreCategories = new Types\StoreCustomCategoryArrayType(); | |
$category = new Types\StoreCustomCategoryType(); | |
$category->CategoryID = 14122; | |
$category->Name = 'Electronics'; | |
$category->Order = 4; | |
$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