question

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ Suspended asked

SetShippingDiscountProfiles API issue when setting calculated shipping rule

 

I am trying to implement the eBay Trading API SetShippingDiscountProfiles (SetShippingDiscountProfilesCall), when there are no "Calculated shipping rule" defined on eBay (Home > My eBay > My Account > Preferences > Combined Payments and Shipping Discounts) and I try to add a calculated shipping rule through the SetShippingDiscountProfilesCall, I get the the below exception 

 

 

com.ebay.sdk.ApiException: Not able to perform action, since the profile data you specified is not matching with the existing profiles or action is not supported.

 

Error Code: 2190995

 

Here is the code 

 

try

{

SetShippingDiscountProfilesRequestType discountProfile = new SetShippingDiscountProfilesRequestType();

CurrencyCodeType cct = CurrencyCodeType.fromValue(combineProfile.getCurrencyCode());

discountProfile.setCurrencyID(cct);

 

discountProfile.setCombinedDuration(CombinedPaymentPeriodCodeType.DAYS_7);

discountProfile.setModifyActionCode(ModifyActionCodeType.ADD);

 

CalculatedShippingDiscountType calcShippingDiscount = new CalculatedShippingDiscountType();

calcShippingDiscount.setDiscountName(DiscountNameCodeType.WEIGHT_OFF);

 

DiscountProfileType calcDiscountProfile = new DiscountProfileType();

calcDiscountProfile.setDiscountProfileName("Calc1");

 

MeasureType weight = new MeasureType();

weight.setValue(BigDecimal.valueOf(5.0));

 

calcDiscountProfile.setWeightOff(weight);

calcShippingDiscount.setDiscountProfile(new DiscountProfileType[] {calcDiscountProfile});

 

CalculatedHandlingDiscountType calcHandlingDiscount = new CalculatedHandlingDiscountType();

calcHandlingDiscount.setDiscountName(HandlingNameCodeType.COMBINED_HANDLING_FEE);

calcHandlingDiscount.setOrderHandlingAmount(this.MakeAmountType(10.0, cct));

discountProfile.setCalculatedShippingDiscount(calcShippingDiscount);

discountProfile.setCalculatedHandlingDiscount(calcHandlingDiscount);

 

 

 

if(this.eBay != null)

{

 

SiteCodeType siteCode = SiteCodeType.fromValue(combineProfile.getSite().getAbbreviation());

SetShippingDiscountProfilesResponseType response = this.eBay.uploadCombineShippingProfile(discountProfile, siteCode);

 

if(response.getAck() != AckCodeType.SUCCESS)

{

String errorMsg = response.getErrors()[0].getLongMessage();

}

}

 

}

catch(Exception e)

{

e.printStackTrace();

}

 

 

ebay-trading-api
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.