Skip to main content
Published: March 17 2011, 4:40:00 PMUpdated: November 28 2020, 1:55:04 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.

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

import com.ebay.sdk.*;
import com.ebay.soap.eBLBaseComponents.*;

* 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
*            OrderLineItemID
*            Shipment Details
* 5. Complete the sale by calling CompleteSaleCall#completeSale()      
public class CompleteSale {

    public static void completeSale() {

        ApiContext apiContext = new ApiContext();
        ApiLogging apiLogging = new ApiLogging();

       // set the server url and credentials for Sandbox
        ApiCredential cred = apiContext.getApiCredential();
        cred.seteBayToken("YOUR TOKEN");

        // If you are makding the call for UK sellers
        // Set site to UK  as apiContext.setSite(SiteCodeType.UK)
        apiContext.setSite(SiteCodeType.US); // Set site to US
        CompleteSaleCall completeSaleApi = new CompleteSaleCall(apiContext);
        String OrderLineItemID = "150571802827-0";
        String shippingCarrier ="YOUR CARRIER";
        String trackingNumber = "YOUR TRACKING NUMBER";

        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