Skip to main content
Published: August 13 2010, 4:01:00 AMUpdated: November 28 2020, 8:39:16 PM

Use the ReviseFixedPriceItem call to change the properties of a currently active fixed-price listing.

Here is a Java ReviseFixedPriceItem sample for revising item specifics. This sample has been written using the Java SDK v673 and demonstrates how to revise the title of a listing.

Below is the sample code. The request XML is attached to this article.

/*  © 2010-2012 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.ReviseFixedPriceItemCall;
import com.ebay.soap.eBLBaseComponents.ItemType;
import com.ebay.soap.eBLBaseComponents.NameValueListArrayType;
import com.ebay.soap.eBLBaseComponents.NameValueListType;
import com.ebay.soap.eBLBaseComponents.SiteCodeType;

/**
* Sample code for Revising Fixed Price item with eBay Java SDK v673.
*
* The following needs to be done for executing RevisFixedPriceItem call to revise item specifics
*
* 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.
* 5. Create a NameValueListType for each Item Specific that is to be defined.
* 6. Create a NameValueListArrayType object and add all the NameValueListType objects to it.
* 7. Set the NameValueListArrayType to the item using ItemType#setItemSpecifics(NameValueListArrayType)
* 8. Execute the revision using ReviseFixedPriceItemCall#reviseFixedPriceItem()
*
*
*/
public class ReviseFPItemSpecificsSample {

     public static void reviseFixedPriceItemSpecifics() {
          
          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

          ReviseFixedPriceItemCall reviseFP = new ReviseFixedPriceItemCall(
                    apiContext);
          ItemType item = new ItemType();
          item.setSKU("CODE_SAMPLE_REVISE_FPITEM_SKU1"); // We are using SKU to identify items
          
          // Create 3 item specifics for SKU CODE_SAMPLE_REVISE_FP_SKU-1          
          NameValueListArrayType specificsList = new NameValueListArrayType();

          NameValueListType nvList1 = new NameValueListType();
          nvList1.setName("Brand");
          nvList1.setValue(new String[] { "Ralph Lauren" });

          NameValueListType nvList2 = new NameValueListType();
          nvList2.setName("Size");
          nvList2.setValue(new String[] {"S"});
          
          NameValueListType nvList3 = new NameValueListType();
          nvList3.setName("Colour");
          nvList3.setValue(new String[] { "White" });
          
          specificsList.setNameValueList(new NameValueListType[] { nvList1,
                    nvList2, nvList3 });

          item.setItemSpecifics(specificsList);
          
          reviseFP.setItemToBeRevised(item);

          try {
               reviseFP.reviseFixedPriceItem();
          } catch (ApiException e) {
               e.printStackTrace();
          } catch (SdkException e) {
               e.printStackTrace();
          } catch (Exception e) {
               e.printStackTrace();
          }

     }

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

}


 

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