Ejemplo n.º 1
0
        private FindItemsByKeywordsRequest BuildAuctionRequest(string keywords, int pageNumber = 1, int entriesPerPage = 10)
        {
            var req = new EBayApi.FindItemsByKeywordsRequest();

            req.keywords        = keywords;
            req.buyerPostalCode = BuyerPostalCode;
            req.sortOrder       = EBayApi.SortOrderType.PricePlusShippingLowest;
            req.paginationInput = new PaginationInput
            {
                pageNumber     = pageNumber,
                entriesPerPage = entriesPerPage
            };

            // Listing types (fixed and auction)
            req.itemFilter    = new ItemFilter[2];
            req.itemFilter[0] = new ItemFilter
            {
                name  = ItemFilterType.ListingType,
                value = new string[] { "Auction", "AuctionWithBIN" }
            };

            //Auctions ending in 4 hours
            req.itemFilter[1] = new ItemFilter
            {
                name  = ItemFilterType.EndTimeTo,
                value = new string[] { DateTime.UtcNow.AddHours(4.0).ToString("o") }
            };

            return(req);
        }
Ejemplo n.º 2
0
        private FindItemsByKeywordsRequest BuildFixedPriceRequest(string keywords, int pageNumber = 1, int entriesPerPage = 10)
        {
            var req = new EBayApi.FindItemsByKeywordsRequest();

            req.keywords        = keywords;
            req.buyerPostalCode = BuyerPostalCode;
            req.sortOrder       = EBayApi.SortOrderType.PricePlusShippingLowest;
            req.paginationInput = new PaginationInput
            {
                pageNumber     = pageNumber,
                entriesPerPage = entriesPerPage
            };

            // Listing types (fixed and auction)
            req.itemFilter    = new ItemFilter[1];
            req.itemFilter[0] = new ItemFilter
            {
                name  = ItemFilterType.ListingType,
                value = new string[] { "FixedPrice", "AuctionWithBIN" }
            };

            return(req);
        }