Skip to main content
Published: August 31 2010, 11:09:00 PMUpdated: November 28 2020, 8:44:54 PM

It is always a good idea to keep the buyer posted about the order shipping status. Use the CompleteSale call mark an item as shipped. You can also upload a shipment tracking number so that the buyer can track the order.

This is a sample that demonstrates how to mark an item as shipped and upload the tracking number. It has been written using Java SDK v673


Below is the code. Corresponding SOAP request is attached with this article.

Note: If an item has to be shipped in multiple shipments/packages use multiple <ShipmentTrackingDetails> container to specifty the tracking details.

© 2010-2013 eBay Inc., All Rights Reserved
Licensed under CDDL 1.0 -

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.soap.eBLBaseComponents.ShipmentTrackingDetailsType;
import com.ebay.soap.eBLBaseComponents.ShipmentType;
import com.ebay.soap.eBLBaseComponents.SiteCodeType;

* Sample code to relist an item (with minor modifications) using the RelistFixedPriceItem call
* The following steps outline what needs to be done for a successfull GetTransactions and GetOrders call
* 1. Create an ApiContext Object
* 2. Set the auth token and target api url (Webservice endpoint)
* 3. Create an object of CompleteSaleCall.
* 4. Set the following values to the object
*            ItemID
*           TransactionID
*           Shipping Details
* 5. Complete the sale by calling CompleteSaleCall#completeSale()     
public class CompleteSale {
     public static void completeSale(){
          ApiContext apiContext = new ApiContext();
          // set API Token to access eBay API Server
          ApiCredential cred = apiContext.getApiCredential();
          //Set Auth Token
          apiContext.setApiServerUrl("");// Pointing to sandbox for testing.          
          apiContext.getApiLogging().setLogSOAPMessages(true);// This will log SOAP requests and responses

          apiContext.setSite(SiteCodeType.UK); // Set site to UK
          CompleteSaleCall completeSaleApi = new CompleteSaleCall(apiContext);
          ShipmentType shipType = new ShipmentType();
          ShipmentTrackingDetailsType shpmnt = new ShipmentTrackingDetailsType();
          shipType.setShipmentTrackingDetails(new ShipmentTrackingDetailsType[]{shpmnt});
          try {
          } catch (ApiException e) { 
          } catch (SdkException e) { 
          } catch (Exception e) { 
     public static void main(String[] args) {



How well did this answer your question?
Answers others found helpful