I'm using the eBay Trading API, Visual Studio, C#, with the eBay NuGet Package installed, which creates eBay objects and methods for me. The definition of the GetOrders(...) method is:~
public OrderTypeCollection GetOrders(StringCollection OrderIDList, DateTime CreateTimeFrom, DateTime CreateTimeTo, TradingRoleCodeType OrderRole, OrderStatusCodeType OrderStatus, ListingTypeCodeType ListingType, PaginationType Pagination, DateTime ModTimeFrom, DateTime ModTimeTo, int NumberOfDays, bool IncludeFinalValueFee, SortOrderCodeType SortingOrder);
Almost all of these parameters are required, null is not accepted. Some will accept blank variables. So I have this code to call the method:
var roletype = TradingRoleCodeType.Seller; var orderstatuscode = OrderStatusCodeType.All; var pagination = new PaginationType(); pagination.EntriesPerPage = itemsPerPage; pagination.PageNumber = pageNumber; int noOfDays = new int(); DateTime blankDate = new DateTime(); // Not blank, but 01/01/0001 12:00:00 AM orders = apicall.GetOrders(null, fromDate, toDate, roletype, orderstatuscode, new ListingTypeCodeType(), pagination, blankDate, blankDate, noOfDays, false, SortOrderCodeType.Ascending);
This code will run, but returns the error "Do not provide CreateTimeFrom/To as well as ModTimeFrom/To, only provide one or the other" If I write my own calls to the API, I can just leave out the unrequired parameters, but by using the methods built by the eBay Nuget package, I'm forced to submit parameters. To me, it appears impossible to use this method, because it requires two sets of dates to submit, but if submitted with two sets of dates, it is rejected by the server.
I'm fairly new to C#, so there's possibly something simple I'm missing. There are 3 overloads for the method, but none of the accept the required set of parameters.