Out-of-Stock is enabled as a user preference using the SetUserPreferences call to set the value for OutOfStockControlPreference to true
.
Sellers may also opt in to Out-of-Stock control through Selling Preferences of My eBay.
Refer to the following sample code:
Sample code to enable Out-of-Stock
<SetUserPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents"> ... <OutOfStockControlPreference>true</OutOfStockControlPreference> ... </SetUserPreferencesRequest>
When the feature is enabled, it is automatically applied to all of the user's existing listings as well as to any new listings that are created.
When the quantity of an item goes to zero for a listing using this feature, the item remains "alive," but while it remains in the out-of-stock state (i.e., Item.Quantity
= 0,) the item will not be included in the search results until it is back in stock (i.e., Item.Quantity
> 0).
Item.Quantity
for an item can be updated using one of the following calls:
Refer to the following sample code.
Sample code to update Item.Quantity using ReviseInventoryStatus
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <InventoryStatus> <ItemID>1**********7</ItemID> <Quantity>14</Quantity> </InventoryStatus> </ReviseInventoryStatusRequest>
To retrieve the current Out-of-Stock preferences, issue a GetUserPreferences call with ShowOutOfStockControlPreference set to true
, as illustrated in the following code sample:
Sample code to retrieve Out-of-Stock preferences
<GetUserPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents"> ... <ShowOutOfStockControlPreference>true</ShowOutOfStockControlPreference> ... </GetUserPreferencesRequest>