Find the answer to your question
Advanced Search
How can I remove the InternationalShippingService Options using the .NET SDK?
To remove all the InternationalShippingServiceOption tags for an Item, you need to send in all the domestic shipping services and specify an empty tag for InternationalShippingServiceOption. Here is a sample C# code using the .NET SDK to make a call to ReviseItem for removing just the International ShippingServiceOption (s).
using System;
using eBay.Service.Call;
using eBay.Service.Core.Sdk;
using eBay.Service.Util;
using eBay.Service.Core.Soap;
namespace SDK3Examples
{
{
{
ReviseItemCall call = new ReviseItemCall(GetContext());
ItemType item = new ItemType();
item.ItemID = itemID;
item.ShippingDetails = new ShippingDetailsType();
//Mention all the domestic Shipping Service Options
item.ShippingDetails.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection();
ShippingServiceOptionsType[] opt = new ShippingServiceOptionsType[2];
opt[0] = new ShippingServiceOptionsType();
opt[0].ShippingServiceCost = new AmountType();
opt[0].ShippingServiceCost.currencyID = CurrencyCodeType.USD;
opt[0].ShippingServiceCost.Value = 4.25;
opt[0].ShippingServiceAdditionalCost = new AmountType();
opt[0].ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.USD;
opt[0].ShippingServiceAdditionalCost.Value = 1.5;
opt[0].ShippingService = "ShippingMethodStandard";
opt[0].ShippingServicePriority = 1;
item.ShippingDetails.ShippingServiceOptions.Add(opt[0]);
opt[1] = new ShippingServiceOptionsType();
opt[1].ShippingServiceCost = new AmountType();
opt[1].ShippingServiceCost.currencyID = CurrencyCodeType.USD;
opt[1].ShippingServiceCost.Value = 7.0;
opt[1].ShippingServiceAdditionalCost = new AmountType();
opt[1].ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.USD;
opt[1].ShippingServiceAdditionalCost.Value = 3;
opt[1].ShippingService = "USPSPriority";
opt[1].ShippingServicePriority = 2;
item.ShippingDetails.ShippingServiceOptions.Add(opt[1]);
//Specify an empty InternationShippingServiceOption object
item.ShippingDetails.InternationalShippingServiceOption = new InternationalShippingServiceOptionsTypeCollection();
InternationalShippingServiceOptionsType Iopt = new InternationalShippingServiceOptionsType();
Iopt = new InternationalShippingServiceOptionsType();
item.ShippingDetails.InternationalShippingServiceOption.Add(Iopt);
FeeTypeCollection fees = call.ReviseItem(item, null);
}
public ApiContext GetContext()
{
ApiContext context = new ApiContext();
context.ApiCredential.eBayToken = "token";
// Set the URL
context.SoapApiServerUrl = "https://api.sandbox.ebay.com/wsapi";
// Set logging
context.ApiLogManager = newApiLogManager();
context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger("Messages.log", true, true, true));
context.ApiLogManager.EnableLogging = true;
// Set the version
context.Version = "1131";
return context;
}
How well did this answer your question?
Answers others found helpful
- How do I remove or modify only my InternationalShippingServiceOption(s), but not my "domestic" shipping services?
- Sample to determine if GetSellerTransactions response has more items in C# using .NET SDK
- Sample code in C# to list an Item with mixed shipping types using .NET SDK
- ShippingServiceOptions and InternationalShippingServiceOption containers must be contiguous within the XML for AddItem, RelistItem, and ReviseItem
- Removing InternationalShippingServiceOptions in SDK JAVA