Skip to main content
Published: January 12 2015, 1:30:00 PMUpdated: July 18 2022, 7:44:25 AM

How can I program defensively and avoid duplicate listings? 

Summary

All applications using AddItem, RelistItem family calls should use the Item.UUID parameter.

Why?
Duplicate item listings, caused by various operational problems, can lead to a customer support issues. The problem usually happens when no response is returned from the API, or when the calling application has some failure waiting for the response. The root cause can be because the API Call timed out on the API servers or because of operational problems at eBay or because of operational problems with the API application making the AddItem calls. In any case, eBay provides a defensive mechanism with the UUID parameter in the AddItem, RelistItem family of calls to reduce the occurrences of duplicate listings. It takes very little development effort to save potential production headaches.

Note: For AddItem, RelistItem calls, do not use InvocationID, DO use UUID. 

What?
The UUID parameter is a unique identifier for the eBay Item Listing you are sending to eBay.  The UUID parameter is essentially a 32 character GUID (Globally Unique Identifier) with the dashes removed. GUIDs consist of hexadecimal characters only. Most algorithms for creating a GUID use some variation of an Ethernet card MAC address, IP address, system time in milliseconds, random numbers, and MD5 hashes.


Detailed Description

How?
See the following suggestions for creating UUID values on various platforms.

  • .NET SDK:
    You can explicitly set the AddItemCall.AutoSetItemUUID property to true.
    Doing this will automatically fill out the Item.UUID property for you on the Item used in the AddItemCall.
    Or you can explicitly set the Item.UUID field to a value yourself.
    If you choose to set it youself, please use the .NET system library to generate the UUID value as noted in the Win32 Platforms section below.
  • Java SDK:
    You can use the method setAutoSetItemUUID as below:
    AddItemCall.setAutoSetItemUUID(true);
  • .NET:
    Use the System library to generate the guid:

    Guid oGuid = Guid.NewGuid();
    String sGuid = oGuid.ToString();
    // remove dashes from GUID to convert to UUID
    String sUUID = sGuid.Replace("-",null);
  • PHP
    Use the following line of code in a PHP application (we recommend PHP 4 or later):
    $sUUID = md5(uniqid(rand(), true));
    For more details on using uniqid in PHP, please see the following URL:
    http://us3.php.net/uniqid
    Here's a PHP library based on the Linux libuuid library:
    http://pecl.php.net/package/uuid
  • Perl
    Here's a good resource for Perl extensions:
    http://cpan.uwinnipeg.ca/htdocs/Data-UUID/Data/UUID.html
  • Java
    There are numerous pure (cross-platform) Java implementations for generating a GUID. Here is one such implementation:
    http://www.javaexchange.com/aboutRandomGUID.html


You can also use SKU to avoid duplicate listings. For more information, please refer to https://ebaydts.com/eBayKBDetails?KBid=1596

Attachments
How well did this answer your question?
Answers others found helpful

Got thoughts? Click the feedback button – your insights help us improve!