Skip to main content
Published: August 25 2010, 1:47:00 AMUpdated: November 28 2020, 8:43:21 PM

The RelistFixedPriceItem call can be used to to relist fixed-price item that has ended. It is recommended to use this call instead of creating a new listing using the AddFixedPriceItem call to take advantage of the recent sales score associated with the listing.

Here is a Java RelistFixedPriceItem sample for re-listing an item with some minor modifications (title updated. subtitle deleted) This sample has been written using the Java SDK v673.

Below is the code. Corresponding SOAP request is attached with this article.

/*  © 2010-2013 eBay Inc., All Rights Reserved */
/* Licensed under CDDL 1.0 -  http://opensource.org/licenses/cddl1.php */

package com.ebay.sample;

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.RelistFixedPriceItemCall;
import com.ebay.soap.eBLBaseComponents.InventoryTrackingMethodCodeType;
import com.ebay.soap.eBLBaseComponents.ItemType;
import com.ebay.soap.eBLBaseComponents.SiteCodeType;

/**
* Sample code to relist an item (with minor modifications) using the RelistFixedPriceItem call
*
* 1. Create an ApiContext Object
* 2. Set the auth token and target api url (Webservice endpoint)
* 3. Create a RelistFixedPriceItemCall object.
* 4. Create an item object and set the SKU for the item whose field(s) is/are to added/modified.
* 5. Set the InventoryTrackingMethod in the item object and set it to the ReviseFixedPriceItemCall object.
* 6. Execute the API call ReviseFixedPriceItemCall#reviseFixedPriceItem() to revise the listing
*
*/
public class RelistFPItemWithMods {
     
     public static void relistFixedPriceItem(){
          ApiContext apiContext = new ApiContext();
          // set API Token to access eBay API Server
          ApiCredential cred = apiContext.getApiCredential();
          cred.seteBayToken("YourToken");
          
          apiContext.setApiServerUrl("https://api.sandbox.ebay.com/wsapi");// Pointing to sandbox for testing.
          apiContext.getApiLogging().setLogSOAPMessages(true);// This will log SOAP requests and responses
          apiContext.setSite(SiteCodeType.UK); // Set site to UK
          
          RelistFixedPriceItemCall relistCall = new RelistFixedPriceItemCall(
                    apiContext);

          ItemType item = new ItemType();

          item.setSKU("CODE_SAMPLE_REVISE_FPITEM_SKU1");
          item.setInventoryTrackingMethod(InventoryTrackingMethodCodeType.SKU);
          item.setTitle("**TEST ITEM-Relisting item with new title-DO NOT BID**");
          try {
               relistCall.setDeletedField(new String[] { "Item.SubTitle" });
               relistCall.setItemToBeRelisted(item);
               relistCall.relistFixedPriceItem();
               System.out.println("The sku : " + item.getSKU()
                         + " is relisted with new ItemID : "
                         + relistCall.getReturnedItemID());
          } catch (ApiException e) {
               e.printStackTrace();
          } catch (SdkException e) {
               e.printStackTrace();
          } catch (Exception e) {
               e.printStackTrace();
          }

     }

     public static void main(String[] args) {
          relistFixedPriceItem();
     }

}

 

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