/**
*
*
* 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.
* 5. Create a VariationType for each variation that is to be listed.
* 6. Add item specifics for each variation (Refer ReviseItem specifics samples)
* 7. Set all the variations to VariationsType object and set this to the item using ItemType#setVariations(VariationsType)
* 8. Set the item as the itemToBeRevised in the ReviseItemCall object.
* 9. Invoke ReviseItemCall#reviseItem() to execute the revision.
*
*/
public class ReviseFixedPriceItemVariation {
public static void reviseMultiVariationItem() {
ApiContext apiContext = new ApiContext();
ApiCredential cred = apiContext.getApiCredential();
ApiLogging apiLogging = new ApiLogging();
apiContext.setApiLogging(apiLogging);
// set the server url and credentials for Sandbox
apiContext.setApiServerUrl("https://api.sandbox.ebay.com/wsapi");
cred.seteBayToken("YourToken");
// Set site to US
apiContext.setSite(SiteCodeType.US);
ReviseFixedPriceItemCall reviseFP = new ReviseFixedPriceItemCall(apiContext);
ItemType item = new ItemType();
item.setSKU("CODE_SAMPLE_FPMVAR_SKU1");
// Adding a new variation Blue - M
VariationType variation1 = new VariationType();
variation1.setSKU("CODE_SAMPLE_FPMVAR_SKU1_LBLUE");
// Delete an existing variation Brown - M
VariationType variation3 = new VariationType();
variation3.setSKU("CODE_SAMPLE_FPMVAR_SKU1_MBROWN");
variation3.setDelete(true);
VariationsType variations = new VariationsType();
// add individual variations to a variations object
variations.setVariation(new VariationType[]{variation1,variation2,variation3});