Skip to main content
Published: August 16 2010, 2:15:00 PMUpdated: November 28 2020, 8:41:14 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 C# sample that demonstrates how to mark an item as shipped and upload the tracking number. The sample has been written using .NET SDK v817.

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 -

using eBay.Service.Call;
using eBay.Service.Core.Sdk;
using eBay.Service.Util;
using eBay.Service.Core.Soap;

namespace Trading_Samples
    public class OrderManagement
        private void CompleteSale()     
            //create the context
            ApiContext context = new ApiContext();

            //set the User token
            context.ApiCredential.eBayToken = "Your token";

            //set the server url
            context.SoapApiServerUrl = "";

            //enable logging
            context.ApiLogManager = new ApiLogManager();
            context.ApiLogManager.ApiLoggerList.Add(new FileLogger("log.txt", true, true, true));
            context.ApiLogManager.EnableLogging = true;

            //set the version
            context.Version = "817";
            context.Site = SiteCodeType.UK;    

            //Create the call and set the fields
            CompleteSaleCall apicall = new CompleteSaleCall(context);

            //Either ItemID-TransactionID or OrderLineItemID or OrderID is required. If item is part of an order, specify OrderID.
            apicall.OrderLineItemID = "OrderID here";
            apicall.Shipped = true;
            apicall.Shipment = new ShipmentType();
            apicall.Shipment.ShipmentTrackingDetails = new ShipmentTrackingDetailsTypeCollection();

            ShipmentTrackingDetailsType shpmnt = new ShipmentTrackingDetailsType();
            shpmnt.ShipmentTrackingNumber = "Tracking Number here"; 
            shpmnt.ShippingCarrierUsed = "YourCarrier";

            //Specify time in GMT. This is an optional field
            //If you don't specify a value for the ShippedTime, it will be defaulted to the time at which the call was made
            apicall.Shipment.ShippedTime = new DateTime(2013, 7, 23, 10, 0, 0).ToUniversalTime();

            //call the Execute method



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