c# - ebay GetOrders API using OutputSelector and SortOrder - .Net SDK -
i using ebay .net sdk. working fine except following requirements:
- using of outputselector boost performance
- unable use sortingorder, while showing records.
- total income/amount sold specified time range i.e. total amount across calls of pagination without looping through pages , aggregating manually.
here code using:
var apicall = new getorderscall(context); //apicall.apirequest.outputselector = new stringcollection(new string[] { "order.orderid", "order.total" }); apicall.apirequest.pagination = new paginationtype { entriesperpage = util.recordsperpage(), pagenumber = int.parse(request.form["pagenumber"]) }; var fltr = new timefilter(convert.todatetime(request.form["datefrom"] + "t00:00:00.000z"), convert.todatetime(request.form["dateto"] + "t23:59:59.999z")); var statuscodetype = (orderstatuscodetype)enum.parse(typeof(orderstatuscodetype), request.form["statuscode"]); var orders = apicall.getorders(fltr, tradingrolecodetype.seller, statuscodetype);
please assist me how use these 3 functionality well.
after efforts got way it:
var request = new getordersrequesttype { //outputselector = new stringcollection {"orderid","total"}, createtimefrom = convert.todatetime(request.form["datefrom"] + "t00:00:00.000z"), createtimeto = convert.todatetime(request.form["dateto"] + "t23:59:59.999z"), orderstatus = (orderstatuscodetype)enum.parse(typeof(orderstatuscodetype), request.form["statuscode"]), orderrole = tradingrolecodetype.seller, pagination = new paginationtype { entriesperpage = util.recordsperpage(), pagenumber = int.parse(request.form["pagenumber"]) } }; var apicall = new getorderscall(context) { apirequest = request, outputselector = new string[] { "orderid", "total", "paidtime", "ebaypaymentstatus", "paymentmethod", "title", "pagenumber", "paginationresult.totalnumberofpages" } }; apicall.execute(); var orders = apicall.apiresponse.orderarray;
Comments
Post a Comment