question

qwerty_sella avatar image
0 Likes"
qwerty_sella asked ·

When order is retrieved, tracking details are never there

 

I am pulling all items that I have won, but somehow the ShippingDetais are always empty; how do I populate the shipping (the tracking number) when it is present and provided by the seller?

 

My code: 

 

ApiContext oContext = new ApiContext();

oContext.ApiCredential.ApiAccount.Developer = "";

oContext.ApiCredential.ApiAccount.Application = "";

oContext.ApiCredential.ApiAccount.Certificate = "";

oContext.ApiCredential.eBayToken = "";

oContext.SoapApiServerUrl = "https://api.ebay.com/wsapi";

oContext.Site = eBay.Service.Core.Soap.SiteCodeType.US;

 

ApiLogManager oLogManager = new ApiLogManager();

oLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger("GetMyeBayBuyingSDK.log", true, true, true));

oLogManager.EnableLogging = true;

oContext.ApiLogManager = oLogManager;

GetMyeBayBuyingCall oGetMyeBayBuyingCall = new GetMyeBayBuyingCall(oContext);

oGetMyeBayBuyingCall.Version = "447";

oGetMyeBayBuyingCall.Site = oContext.Site;

 

oGetMyeBayBuyingCall.EnableCompression = true;

ItemListCustomizationType oWonList = new ItemListCustomizationType();

 

oWonList.DurationInDays = 60;

oWonList.DurationInDaysSpecified = true;

 

oWonList.Sort = ItemSortTypeCodeType.StartPrice;

oWonList.SortSpecified = true;

PaginationType oPagination = new PaginationType();

oPagination.EntriesPerPage = 200;

oPagination.EntriesPerPageSpecified = true;

oPagination.PageNumber = 1;

oPagination.PageNumberSpecified = true;

oWonList.Pagination = oPagination;

oGetMyeBayBuyingCall.WonList = oWonList;

 

try

{

oGetMyeBayBuyingCall.GetMyeBayBuying();

OrderTransactionTypeCollection oOrderTransactionCollection = oGetMyeBayBuyingCall.WonListReturn.OrderTransactionArray;

foreach (OrderTransactionType oOrderTransaction in oOrderTransactionCollection)

{

 

if (null != oOrderTransaction.Transaction)

{

 

if (oOrderTransaction.Transaction.ShippingDetails != null && oOrderTransaction.Transaction.ShippingDetails.ShipmentTrackingDetails != null)

{

 // MY CODE HERE

}}

}

}

tracking-numberpurchasescshipmenttrackingdetails
10 |600 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
jourbandts avatar image
0 Likes"
jourbandts answered ·

Hi,

 

GetMyeBayBuying does not return shipment tracking information, http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetMyeBayBuyin... In order to get the information you are looking for, from your GetMyeBayBuying response, you can get the OrderLineItemID, .  You can then pass the OrderLineItemID in to the OrderID field in the GetOrders API call which will return the ShipmentTrackingDetails.

 

GetOrders - http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetOrders.html

GetOrders OrderID - http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetOrders.html...

GetOrders Tracking - http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetOrders.html...

GetMyeBayBuying OrderLineItemID - http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetMyeBayBuyin...

 

Answer Title: C# Sales order processing using GetOrders
Answer Link: https://ebaydts.com/eBayKBDetails?KBid=1679

 

You really don't need much for the GetOrders call, you can do something like this,

 

ApiContext oContext = new ApiContext();

oContext.ApiCredential.ApiAccount.Developer = "";

oContext.ApiCredential.ApiAccount.Application = "";

oContext.ApiCredential.ApiAccount.Certificate = "";

oContext.ApiCredential.eBayToken = "";

oContext.SoapApiServerUrl = "https://api.ebay.com/wsapi";

oContext.Site = eBay.Service.Core.Soap.SiteCodeType.US;

 

ApiLogManager oLogManager = new ApiLogManager();

oLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger("GetOrdersSDK.log", true, true, true));

oLogManager.EnableLogging = true;

oContext.ApiLogManager = oLogManager;

GetOrdersCall oGetOrdersCall = new GetOrdersCall(oContext);

 

//' set the Version used in the call
            oGetOrdersCall.Version = oContext.Version;

            //' set the Site of the call
            oGetOrdersCall.Site = oContext.Site;

            //' enable the compression feature
            oGetOrdersCall.EnableCompression = true;

oGetOrdersCall.DetailLevelList = new DetailLevelCodeTypeCollection();
            oGetOrdersCall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);

            oGetOrdersCall.OrderStatus = OrderStatusCodeType.Completed;

//' get Completed orders
            oGetOrdersCall.OrderStatus = OrderStatusCodeType.Completed;

            //' I am the seller
            oGetOrdersCall.OrderRole = TradingRoleCodeType.Seller;

oGetOrdersCall.OrderIDList = new StringCollection();
            oGetOrdersCall.OrderIDList.Add("add your OrderLineItemID here");

            oGetOrdersCall.Execute();

· Share
10 |600 characters needed characters left characters exceeded

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

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.