question

skywalker141 avatar image
0 Likes"
skywalker141 asked ·

PHP SOAP API VerifyAddItem doesn't accept Currency, Country and ListingDuration

I created an eBay class and use methods for different calls. I have problem with VerifyAddItem API in sandbox and production environments. I set these 3 required parameters Currency as USD, Country as US, ListingDuration as Days_7, but receive error: No exists or is specified as an empty tag. For each of those 3 inputs. Here is my method public function VerifyAddItem(){ $client = new SOAPClient($this->wsdl_url, array('trace' => 1, 'exceptions' => 0, 'location' => $this->uri . "?callname=VerifyAddItem≈pid=" . $this->appId . "&siteid=0&version=943&Routing=new")); $params = array( 'Version' => 943, //'DetailLevel' => 'ReturnSummary', 'Title' => 'Harry Potter', 'Description' => 'Tralalala Description Tralalala Description Tralalala Description Tralalala Description Tralalala Description', 'PrimaryCategory' => array('Category' => 377), 'StartPrice' => 1.00, 'ConditionID' => 3000, //'ItemLocation' => '', // NOT NEEDED IF PostalCode IS PRESENT! 'CategoryMappingAllowed' => true, 'Currency' => 'USD', 'Country' => 'US', 'DispatchTimeMax' => 3, 'ListingDuration' => 'Days_7', 'ListingType' => 'Chinese', //'HitCounter' => 'BasicStyle', 'IncludeRecommendations' => true, 'PaymentMethods' => 'PayPal', //'PaymentMethods' => 'VisaMC', 'PayPalEmailAddress' => 'magicalbookseller@yahoo.com', 'PictureDetails' => array('PictureURL' => 'http://universe.byu.edu/wp-content/uploads/2015/01/HP4cover.jpg'), 'PostalCode' => 60706, 'Quantity' => 1, 'ReturnPolicy' => array( 'ReturnsAcceptedOption' => 'ReturnsAccepted', 'RefundOption' => 'MoneyBack', 'ReturnsWithinOption' => 'Days_30', 'Description' => 'This is the first book in the Harry Potter series. In excellent condition!', 'ShippingCostPaidByOption' => 'Buyer' ), 'ShippingDetails' => array( 'ShippingType' => 'Flat', 'ShippingServiceOptions' => array( 'ShippingServicePriority' => 1, 'ShippingService' => 'USPSMedia', 'ShippingServiceCost' => 2.50 ), ), 'UUID' => 'tralala12add21dawad544', 'Site' => 'US', 'WarningLevel' => 'High' ); $request = $client->__soapCall('VerifyAddItem', array($params), NULL, $this->header); //make the API call } And here is printed object with errors stdClass Object ( [Timestamp] => 2015-10-16T16:23:29.715Z [Ack] => Failure [Errors] => Array ( [0] => stdClass Object ( [ShortMessage] => No exists or is specified as an empty tag. [LongMessage] => No exists or is specified as an empty tag in the request. [ErrorCode] => 10009 [SeverityCode] => Error [ErrorParameters] => stdClass Object ( [Value] => Item.Currency [ParamID] => 0 ) [ErrorClassification] => RequestError ) [1] => stdClass Object ( [ShortMessage] => No exists or is specified as an empty tag. [LongMessage] => No exists or is specified as an empty tag in the request. [ErrorCode] => 10009 [SeverityCode] => Error [ErrorParameters] => stdClass Object ( [Value] => Item.Country [ParamID] => 0 ) [ErrorClassification] => RequestError ) [2] => stdClass Object ( [ShortMessage] => No exists or is specified as an empty tag. [LongMessage] => No exists or is specified as an empty tag in the request. [ErrorCode] => 10009 [SeverityCode] => Error [ErrorParameters] => stdClass Object ( [Value] => Item.ListingDuration [ParamID] => 0 ) [ErrorClassification] => RequestError ) ) [Version] => 931 [Build] => E931_UNI_API5_17617533_R1 ) NULL Any advice welcome
trading apiadditemverifyadditemerror 10009
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
skywalker141 avatar image
0 Likes"
skywalker141 answered ·
I found the solution to this mystery problem and i will explain for other people who have the same or similar problem. All of the arguments like Currency, Country, ListingDuration and others must be inside another element in this array called 'Item'. Version and WarningLevel stays outside of 'Item' element. Here is working array of parameters: $params = array( 'Item' => array( 'Currency' => 'USD', 'Country' => 'US', 'ListingDuration' => 'Days_7', 'Site' => 'US', //'DetailLevel' => 'ReturnSummary', 'Title' => 'Harry Potter', 'Description' => 'Tralalala Description Tralalala Description Tralalala Description Tralalala Description Tralalala Description', 'PrimaryCategory' => array('CategoryID' => 377), 'StartPrice' => 1.00, 'ConditionID' => 3000, //'ItemLocation' => '', // NOT NEEDED IF PostalCode IS PRESENT! 'CategoryMappingAllowed' => true, 'DispatchTimeMax' => 3, 'ListingType' => 'Chinese', //'HitCounter' => 'BasicStyle', 'IncludeRecommendations' => true, 'PaymentMethods' => 'PayPal', //'PaymentMethods' => 'VisaMC', 'PayPalEmailAddress' => 'magicalbookseller@yahoo.com', 'PictureDetails' => array('PictureURL' => 'http://universe.byu.edu/wp-content/uploads/2015/01/HP4cover.jpg'), 'PostalCode' => 60706, 'Quantity' => 1, 'ReturnPolicy' => array( 'ReturnsAcceptedOption' => 'ReturnsAccepted', 'RefundOption' => 'MoneyBack', 'ReturnsWithinOption' => 'Days_30', 'Description' => 'This is the first book in the Harry Potter series. In excellent condition!', 'ShippingCostPaidByOption' => 'Buyer' ), 'ShippingDetails' => array( 'ShippingType' => 'Flat', 'ShippingServiceOptions' => array( 'ShippingServicePriority' => 1, 'ShippingService' => 'USPSMedia', 'ShippingServiceCost' => 2.50 ), ), 'UUID' => '8bababa12add21dacad5441232324566' ), 'Version' => 943, 'WarningLevel' => 'High' );
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.