/**
* Sample code for using ReviseFixedPriceItem to delete a field using eBay Java SDK v673.
* This sample deletes the subtitle of a listing.
*
* The following steps need to be done to delete a field from an existing listing.
*
* 1. Create an ApiContext Object
* 2. Set the auth token and target api url (Webservice endpoint)
* 3. Create a ReviseFixedPriceItemCall object.
* 4. Create an item object and set the SKU for the item whose field(s) is/are to be deleted.
* 5. Set the item to the ReviseFixedPriceItemCall object.
* 6. Set the fields to be deleted using ReviseFixedPriceItemCall#setDeletedField method.
* 7. Execute the API call ReviseFixedPriceItemCall#reviseFixedPriceItem() to revise the listing.
*
*/
public class ReviseFixedPriceItemDelete {
public static void deleteSubTitle() {
ApiContext apiContext = new ApiContext(); // Create a new APIContext
// Object
// set Api Token to access eBay Api Server
ApiCredential cred = apiContext.getApiCredential();
cred.seteBayToken("YourToken");
apiContext.setApiServerUrl("https://api.sandbox.ebay.com/wsapi");// Pointing SandBox for testing
// Enable logging of SOAP requests and responses. Recommended only for testing/debugging.
apiContext.getApiLogging().setLogSOAPMessages(true);
apiContext.setSite(SiteCodeType.UK); // Set site to UK
ReviseFixedPriceItemCall rfp = new ReviseFixedPriceItemCall(apiContext);
ItemType item = new ItemType();
item.setSKU("CODE_SAMPLE_REVISE_FPITEM_DELETE_SKU1");//Set the sku of the item that needs to be revised
rfp.setItemToBeRevised(item);
rfp.setDeletedField(new String[] { "Item.SubTitle" });// Set the field(s) to be deleted