使用ReviseItem api调用更新ShippingDetails时遇到问题。正如文档中所提到的,我首先调用GetItem并使用相同的细节,但我一直得到ApiException"邮费服务标准国际统一邮资(51507)不可用。"
除了我尝试更新的ExcludeShipToLocation属性外,如何保留所有现有的送货详细信息?
ReviseItemCall apiCall = new ReviseItemCall(Context);
GetItemCall getItemApiCall = new GetItemCall(Context);
foreach (ItemType item in items)
{
getItemApiCall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
ItemType fetchedItem = getItemApiCall.GetItem(item.ItemID);
ShippingDetailsType shippingDetails = fetchedItem.ShippingDetails;
shippingDetails.ExcludeShipToLocation = excludeShipToLocations;
item.ShippingDetails = shippingDetails;
try
{
apiCall.ReviseItem(item, deletedFields, false);
System.Diagnostics.Debug.WriteLine("Success");
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}