Created
March 1, 2016 09:41
-
-
Save davidtsadler/438f798e823c554546c5 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 = 'Delete'; | |
$request->ItemDestinationCategoryID = 14122; | |
$request->StoreCategories = new Types\StoreCustomCategoryArrayType(); | |
$category = new Types\StoreCustomCategoryType(); | |
$category->CategoryID = 19227; | |
$request->StoreCategories->CustomCategory[] = $category; | |
$category = new Types\StoreCustomCategoryType(); | |
$category->CategoryID = 19228; | |
$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