eBay大中华区API开发者平台 开发者专区

搜 索
首页>API开发者平台>技术文档>Java SDK例程:调用EndFixedPriceItem,将指定的一口价商品在规定时间前下架

技术文档

问题
Java SDK例程:调用EndFixedPriceItem,将指定的一口价商品在规定时间前下架
解答
0
人觉得答案有帮助)

 

下示为具体代码。相应的SOAP 请求附于文末。

package com.ebay.sample; 

import com.ebay.sdk.ApiContext; 
import com.ebay.sdk.ApiCredential; 
import com.ebay.sdk.ApiException; 
import com.ebay.sdk.SdkException; 
import com.ebay.sdk.call.EndFixedPriceItemCall; 
import com.ebay.soap.eBLBaseComponents.EndReasonCodeType; 
import com.ebay.soap.eBLBaseComponents.SiteCodeType; 

/** 
* Sample code to end an item using EndFixedPriceItem call using eBay Java SDK v673 

* The following steps need to be done to delete a field from an existing listing. 

* 1. Create an ApiContext Object 
* 2. Set the auth token and target api url (Webservice endpoint) 
* 3. Create a EndFixedPriceItemCall object. 
* 4. Set the SKU, ending reason to the object. 
* 5. Execute EndFixedPriceItemCall#endFixedPriceItem() to end the listing. 

*/ 
public class EndFPItemSample { 
      
     public static void endFixedPriceItem(){ 
          ApiContext apiContext = new ApiContext(); 
          // set API Token to access eBay API Server 
          ApiCredential cred = apiContext.getApiCredential(); 
          cred.seteBayToken("YourToken");          
           
          apiContext.setApiServerUrl("https://api.sandbox.ebay.com/wsapi");// Pointing to sandbox for testing. 
          apiContext.getApiLogging().setLogSOAPMessages(true);// This will log SOAP requests and responses 
           
          apiContext.setSite(SiteCodeType.UK); // Set site to UK 
           
          EndFixedPriceItemCall endItem = new EndFixedPriceItemCall(apiContext); 
           
          endItem.setSKU("CODE_SAMPLE_RELIST_VARIATION_SKU2"); 
          endItem.setEndingReason(EndReasonCodeType.NOT_AVAILABLE); 
           
          try { 
               endItem.endFixedPriceItem(); 
          } catch (ApiException e) { 
               e.printStackTrace(); 
          } catch (SdkException e) { 
               e.printStackTrace(); 
          } catch (Exception e) { 
               e.printStackTrace(); 
          } 
     } 
      
     public static void main(String[] args) { 
          endFixedPriceItem(); 
     } 


 

 

File Attachments

 • XML document EndFixedPriceItem SOAP Request.xml

 


答案对您有帮助吗?

是,对我很有帮助
否,没解决我的问题