davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 343 forks source link

No quantity returned when calling GetSingleItem service #66

Closed jasondalycan closed 7 years ago

jasondalycan commented 7 years ago

Hi,

When calling the GetSingleItem service there does not appear to be an Item->Quantity value returned (yet the eBay listing displays a quantity). Is this element missing from the response object?

michabbb commented 7 years ago

looking into GetSingleItemResponseType shows, that there is a item, that is related to SimpleItemType and it has "Quantity", i guess it's more a matter if "how you access" the item from the response object.

davidtsadler commented 7 years ago

As noted in the documentation for GetSingleItem.

GetSingleItem has been optimized for response size, speed and usability. So, it returns the most commonly used fields by default. Use the IncludeSelector field to get more data—but please note that getting more data can result in longer response times.

This means that some information is not returned unless you specify a value for IncludeSelector in the request. If you do not specify a value then only some fields are returned. A list of the fields and which value you need to specify can be found in the documentation

If you use that table to lookup the field Quantity it states that it will not be returned unless Details is specified. E.g

$request->IncludeSelector = 'Details';