Home
Find the answer to your question
Use the ReviseFixedPriceItem call to change the properties of an active fixed-price listing.
Here is a Java ReviseFixedPriceItem sample that demonstrates how to delete the item's sub-title. This sample has been written using the Java SDK v705.
/* import com.ebay.sdk.ApiContext; import com.ebay.sdk.ApiCredential; import com.ebay.sdk.ApiException; import com.ebay.sdk.SdkException; import com.ebay.sdk.call.ReviseFixedPriceItemCall; import com.ebay.soap.eBLBaseComponents.ItemType; import com.ebay.soap.eBLBaseComponents.SiteCodeType; /** * 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.US); // Set site to US 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 try { rfp.reviseFixedPriceItem(); } catch (ApiException e) { e.printStackTrace(); } catch (SdkException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { deleteSubTitle(); } } |