Find the answer to your question
Advanced Search
Enabling BestOffer in JAVA SDK
Detailed Description
A seller can enable BestOffer feature for a fixed price item in AddItem call. The buildItem() function below illuminates how to set the relevant properties in JAVA SDK.
public static ItemType buildItem() {
String t = "Test BestOffer listing. DO NOT BID!";;
ItemType item = new ItemType();
item.setSite(SiteCodeType.US);
item.setCurrency(CurrencyCodeType.USD);
item.setTitle(t);
item.setDescription("Test BestOffer listing.");
item.setStartPrice(new AmountType(599));
item.setQuantity(new Integer(1));
item.setListingDuration(ListingDurationCodeType.Days_7.getValue());
item.setLocation("San Jose, CA");
item.setCountry(CountryCodeType.US);
// Use GetCategoryFeatures to determine which categories support BestOffer feature
CategoryType cat = new CategoryType();
cat.setCategoryID("14111");
item.setPrimaryCategory(cat);
// BestOffer can only be applied to a fixed price format item
item.setListingType(ListingTypeCodeType.FixedPriceItem);
// Auto decline the offer that is lower than the MinimumBestOfferPrice
// NOTE. The item's StartPrice must be higher than the MinimumBestOfferPrice
ListingDetailsType listingDetails = new ListingDetailsType();
listingDetails.setMinimumBestOfferMessage("I can't accept the offer ...");
listingDetails.setMinimumBestOfferPrice( new AmountType (500.00));
item.setListingDetails(listingDetails);
//Enable best offer with setBestOfferEnabled function
BestOfferDetailsType bodt = new BestOfferDetailsType();
bodt.setBestOfferEnabled(new Boolean(true));
item.setBestOfferDetails(bodt);
// Shipping range
item.setShippingOption(ShippingOptionCodeType.WorldWide);
item.setShippingDetails(getShippingDetails());
return item;
}
Additional Resource