Skip to content

Instantly share code, notes, and snippets.

@davidtsadler
Created March 1, 2016 09:41
Show Gist options
  • Save davidtsadler/438f798e823c554546c5 to your computer and use it in GitHub Desktop.
Save davidtsadler/438f798e823c554546c5 to your computer and use it in GitHub Desktop.
<?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