2013-06-03 99 views
0

我正嘗試在eBay SandBox中創建一些樣品訂單。首先,除了使用API​​以外,還有更簡單的方法嗎?我執行此代碼時遇到此錯誤:eBay API例外 - 您不能購買自己的物品

「你不能購買你自己的物品。」

 GetUserCall getUserCall = new GetUserCall(Context); 
     UserType user = getUserCall.GetUser("TESTUSER_jmawebtech"); 

     GetItemCall getItemCall = new GetItemCall(Context); 
     ItemType it = getItemCall.GetItem(textBox1.Text); 

     PlaceOfferCall apiCall = new PlaceOfferCall(Context); 
     OfferType offer = new OfferType(); 
     offer.Action = BidActionCodeType.Bid; 
     offer.ItemID = textBox1.Text; 
     //offer.User = user; 
     offer.UserConsent = true; 
     offer.Quantity = 1; 
     offer.UserConsentSpecified = true; 
     offer.Message = "Bid successful!"; 
     apiCall.ApiRequest.EndUserIP = "127.0.0.1"; 
     offer.MaxBid = new AmountType { Value = Convert.ToDouble(textBox2.Text) }; 
     //error happens here 
     SellingStatusType st = apiCall.PlaceOffer(offer, textBox1.Text); 

如何創建一個不同的用戶的項目?這裏是我的代碼:

      TxtItemId.Text = ""; 
      TxtListingFee.Text = ""; 

      ItemType item = FillItem(); 
      AddItemCall apicall = new AddItemCall(Context); 

      if (ListPictures.Items.Count > 0) 
      { 
       apicall.PictureFileList = new StringCollection(); 
       item.PictureDetails = new PictureDetailsType(); 
       item.PictureDetails.PhotoDisplay = (PhotoDisplayCodeType) Enum.Parse(typeof(PhotoDisplayCodeType), CboPicDisplay.SelectedItem.ToString()); 
      } 

      foreach (string pic in ListPictures.Items) 
      { 
       apicall.PictureFileList.Add(pic); 
      } 

      FeeTypeCollection fees = apicall.AddItem(item); 
+0

如果您可以分享您用於創建樣本訂單的代碼,我將永遠感激不盡。我需要創建大約100個訂單,並查看我們的內部倉庫軟件是否可以正確處理它們。手動在沙箱上創建列表非常痛苦! – arao6

回答

0

創建一個虛擬用戶。使用輔助電子郵件帳戶。

+0

在https://developer.ebay.com/DevZone/sandboxuser/或https://signin.ebay.com/?的沙箱中:是否與上下文對象綁定? –

相關問題