question

avnish1432 avatar image
0 Likes"
avnish1432 asked ·

Not able to find any placed Order details using GetOrders

Hi I am trying to to get my placed orders for last 15 days but i am not able to get any sold item. public bool MakeGetOrders() { //create the context try { ApiContext apiContext = GetContext(); AddItemCall apiCall = new AddItemCall(apiContext); apiContext.ApiLogManager = new ApiLogManager(); apiContext.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger(("..\\Log\\GetOrder.log"), true, true, true)); apiContext.ApiLogManager.EnableLogging = true; apiContext.Site = SiteCodeType.US; bool blnHasMore = true; DateTime CreateTimeFromPrev, CreateTimeFrom, CreateTimeTo; GetOrdersCall getOrders = new GetOrdersCall(apiContext); getOrders.DetailLevelList = new DetailLevelCodeTypeCollection(); getOrders.DetailLevelList.Add(DetailLevelCodeType.ReturnAll); getOrders.OrderRole = TradingRoleCodeType.Seller; getOrders.OrderStatus = OrderStatusCodeType.All; //CreateTimeTo set to the current time CreateTimeTo = DateTime.Now.ToUniversalTime(); //Assumption call is made every 15 sec. So CreateTimeFrom of last call was 15 mins //prior to now //TimeSpan ts1 = new TimeSpan(9000000000); //CreateTimeFromPrev = CreateTimeTo.AddDays(-1); ////Set the CreateTimeFrom the last time you made the call minus 2 minutes //TimeSpan ts2 = new TimeSpan(1200000000); //CreateTimeFrom = CreateTimeFromPrev.Subtract(ts2); getOrders.CreateTimeFrom = DateTime.UtcNow.AddDays(-15); getOrders.CreateTimeTo = DateTime.UtcNow; getOrders.Execute(); if (getOrders.ApiResponse.Ack != AckCodeType.Failure) { //Check if any orders are returned if (getOrders.ApiResponse.OrderArray.Count != 0) { } } } return true; } catch (Exception ex) { throw ex; } finally { } } this code always returns count 0 . please check code and suggest changes what i am missing. Thanks
trading apigetorders
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
atomsindustries avatar image
0 Likes"
atomsindustries answered ·
Hi, I ran the code you have here in the .NET SDK for Trading API v897 and I got records back. Have you checked your settings and made sure you are hitting the production server and not the sandbox server? Your code has logging turned on, have you checked the response from the Ebay server to see if it contained any errors about the request? Kind Regards, Ben
· 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.