Exemple #1
0
        public static void GetSellerTransactions()
        {
            string endpoint = "https://api.ebay.com/wsapi";
            string callName = "GetSellerTransactions";
            string siteId   = "2";
            string version  = "949";
            // Build the request URL
            string requestURL = endpoint
                                + "?callname=" + callName
                                + "&siteid=" + siteId
                                + "&appid=" + Settings.AppId
                                + "&version=" + version
                                + "&routing=default";
            // Create the service
            eBayAPIInterfaceService service = new eBayAPIInterfaceService();

            // Assign the request URL to the service locator.
            service.Url = requestURL;
            // Set credentials
            service.RequesterCredentials = new CustomSecurityHeaderType();
            service.RequesterCredentials.eBayAuthToken =
                "AgAAAA**AQAAAA**aAAAAA**c8WOVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AAlIeiCpiLoAydj6x9nY+seQ**JiADAA**AAMAAA**sPiqCG+IiAwqtalGeoTnnESc7Br2D+btBopa9arMMDNaOfglryGRHk3tn/aXAj3p2/KmDiKSmYrg51QGFNokYSGUskmH/jjsOtKgoLyTTJZ+3CtWqeAOz/cbrYadAD8l+s6xUfnTk9mWm4BjyAfYqJ1zkNHUC5YaFTk+oaDZPZ9bE7uGjfw1cvQeX6M7TalgTSygqdVV6hOVJZ3I9UPuO66HchFTPvd4n02aZ2UfsXrcYdOpstNdjLuETQIB5tmUWo6uiCwh/r+eiWt8jIycZegb/9uRHzwEy7rW9Tk7fIpIohoBtryYRLUnMJvy9Dg4l++AhFY0yakWJsWu7VHy7eCuz+OI0Pk+E+uOQhgQRzIji96K6/AnBNV9lLiOa6CiI5MdkcrF2Z4Kr4WoxAgy+4WjoUq+PRG8eDHseFWANwOVhmY9qZJq0ulR9SNcXd8FoRiinxzx3f+lO+MgfrRcea2QKKQVoYDI69jKOQ568FVQ6Zp0ClJy9ru/L9IqB87COBLFP6Ie+Zx+2nhgj+GuARYOu2z0Z7kqx+R6H19hIYoxNncQtGi2ruzqWXG+hbFWXTlqrne8IiJr1udgK1ZxJk9FTCCKQCx0s57SXuBkyaM15y2pqC+ze43ZiLGC3wk94pWEACDNRWu4rH27RZTN+ALBoGWkVdSzGxuVfMD164ak4cAJrIiT2OX77FqnLN+MGcVbfJCAu+BREtguSzW6JmM9qHXHBI+4H/jfGruvYoIt2zg7DzMFv50i+hpnLe5F";
            // use your token
            service.RequesterCredentials.Credentials          = new UserIdPasswordType();
            service.RequesterCredentials.Credentials.AppId    = Settings.AppId;
            service.RequesterCredentials.Credentials.DevId    = Settings.DevId;
            service.RequesterCredentials.Credentials.AuthCert = Settings.CertId;
            // Make the call
            GetSellerTransactionsRequestType request = new GetSellerTransactionsRequestType();

            request.Version = "949";
            var response = service.GetSellerTransactions(request);

            Console.WriteLine(response.Timestamp);
        }
Exemple #2
0
        /// <summary>
        /// Returns sales for the specified date range
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="pageNumber"></param>
        /// <returns></returns>
        public GetSellerTransactionsResponseType GetSales(DateTime from, DateTime to, int pageNumber = 1)
        {
            var service = EbayServiceContext(ServiceCallType.GetSellerTransactions);

            var request = new GetSellerTransactionsRequestType
            {
                ModTimeFromSpecified = true,
                ModTimeFrom          = from,
                ModTimeToSpecified   = true,
                ModTimeTo            = to,
                Pagination           = new PaginationType
                {
                    EntriesPerPage          = Properties.EntriesPerRequest,
                    EntriesPerPageSpecified = true,
                    PageNumber          = pageNumber,
                    PageNumberSpecified = true
                },
                Platform          = TransactionPlatformCodeType.eBay,
                PlatformSpecified = true
            };

            SetupRequestType <GetSellerTransactionsRequestType>(request);
            var credentials = Properties.EbayCredentials;
            var apicall     = service.GetSellerTransactions(ref credentials, request);

            if (apicall.Errors != null)
            {
                foreach (var e in apicall.Errors.ToArray())
                {
                    _logger.WriteToLog(e, EventLogEntryType.Error);
                }
            }
            if ((apicall.Ack == AckCodeType.Success || apicall.Ack == AckCodeType.Warning))
            {
                return(apicall);
            }
            return(null);
        }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param>
 public GetSellerTransactionsCall(ApiContext ApiContext)
 {
     ApiRequest      = new GetSellerTransactionsRequestType();
     this.ApiContext = ApiContext;
 }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 public GetSellerTransactionsCall()
 {
     ApiRequest = new GetSellerTransactionsRequestType();
 }
		/// <summary>
		/// 
		/// </summary>
		/// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param>
		public GetSellerTransactionsCall(ApiContext ApiContext)
		{
			ApiRequest = new GetSellerTransactionsRequestType();
			this.ApiContext = ApiContext;
		}
		/// <summary>
		/// 
		/// </summary>
		public GetSellerTransactionsCall()
		{
			ApiRequest = new GetSellerTransactionsRequestType();
		}
Exemple #7
0
        /// <summary>
        /// Returns sales for the specified date range
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="pageNumber"></param>
        /// <returns></returns>
        public GetSellerTransactionsResponseType GetSales(DateTime from, DateTime to, int pageNumber = 1)
        {
            var service = EbayServiceContext(ServiceCallType.GetSellerTransactions);

            var request = new GetSellerTransactionsRequestType
            {
                ModTimeFromSpecified = true,
                ModTimeFrom = from,
                ModTimeToSpecified = true,
                ModTimeTo = to,
                Pagination = new PaginationType
                {
                    EntriesPerPage = Properties.EntriesPerRequest,
                    EntriesPerPageSpecified = true,
                    PageNumber = pageNumber,
                    PageNumberSpecified = true
                },
                Platform = TransactionPlatformCodeType.eBay,
                PlatformSpecified = true
            };
            SetupRequestType<GetSellerTransactionsRequestType>(request);
            var credentials = Properties.EbayCredentials;
            var apicall = service.GetSellerTransactions(ref credentials, request);
            if (apicall.Errors != null)
            {
                foreach (var e in apicall.Errors.ToArray())
                {
                    _logger.WriteToLog(e, EventLogEntryType.Error);
                }
            }
            if ((apicall.Ack == AckCodeType.Success || apicall.Ack == AckCodeType.Warning))
            {
                return apicall;
            }
            return null;
        }
Exemple #8
0
 public static void GetSellerTransactions()
 {
     string endpoint = "https://api.ebay.com/wsapi";
     string callName = "GetSellerTransactions";
     string siteId = "2";
     string version = "949";
     // Build the request URL
     string requestURL = endpoint
                         + "?callname=" + callName
                         + "&siteid=" + siteId
                         + "&appid=" + Settings.AppId
                         + "&version=" + version
                         + "&routing=default";
     // Create the service
     eBayAPIInterfaceService service = new eBayAPIInterfaceService();
     // Assign the request URL to the service locator.
     service.Url = requestURL;
     // Set credentials
     service.RequesterCredentials = new CustomSecurityHeaderType();
     service.RequesterCredentials.eBayAuthToken =
         "AgAAAA**AQAAAA**aAAAAA**c8WOVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AAlIeiCpiLoAydj6x9nY+seQ**JiADAA**AAMAAA**sPiqCG+IiAwqtalGeoTnnESc7Br2D+btBopa9arMMDNaOfglryGRHk3tn/aXAj3p2/KmDiKSmYrg51QGFNokYSGUskmH/jjsOtKgoLyTTJZ+3CtWqeAOz/cbrYadAD8l+s6xUfnTk9mWm4BjyAfYqJ1zkNHUC5YaFTk+oaDZPZ9bE7uGjfw1cvQeX6M7TalgTSygqdVV6hOVJZ3I9UPuO66HchFTPvd4n02aZ2UfsXrcYdOpstNdjLuETQIB5tmUWo6uiCwh/r+eiWt8jIycZegb/9uRHzwEy7rW9Tk7fIpIohoBtryYRLUnMJvy9Dg4l++AhFY0yakWJsWu7VHy7eCuz+OI0Pk+E+uOQhgQRzIji96K6/AnBNV9lLiOa6CiI5MdkcrF2Z4Kr4WoxAgy+4WjoUq+PRG8eDHseFWANwOVhmY9qZJq0ulR9SNcXd8FoRiinxzx3f+lO+MgfrRcea2QKKQVoYDI69jKOQ568FVQ6Zp0ClJy9ru/L9IqB87COBLFP6Ie+Zx+2nhgj+GuARYOu2z0Z7kqx+R6H19hIYoxNncQtGi2ruzqWXG+hbFWXTlqrne8IiJr1udgK1ZxJk9FTCCKQCx0s57SXuBkyaM15y2pqC+ze43ZiLGC3wk94pWEACDNRWu4rH27RZTN+ALBoGWkVdSzGxuVfMD164ak4cAJrIiT2OX77FqnLN+MGcVbfJCAu+BREtguSzW6JmM9qHXHBI+4H/jfGruvYoIt2zg7DzMFv50i+hpnLe5F";
     // use your token
     service.RequesterCredentials.Credentials = new UserIdPasswordType();
     service.RequesterCredentials.Credentials.AppId = Settings.AppId;
     service.RequesterCredentials.Credentials.DevId = Settings.DevId;
     service.RequesterCredentials.Credentials.AuthCert = Settings.CertId;
     // Make the call
     GetSellerTransactionsRequestType request = new GetSellerTransactionsRequestType();
     request.Version = "949";
     var response = service.GetSellerTransactions(request);
     Console.WriteLine(response.Timestamp);
 }