Skip to main content
Published: August 16 2010, 2:16:00 PMUpdated: November 28 2020, 8:41:32 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 VB.NET 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 -

Imports eBay.Service.Call
Imports eBay.Service.Core.Sdk
Imports eBay.Service.Util
Imports eBay.Service.Core.Soap

Namespace Trading_Samples
     Public Class OrderManagement
          Private Sub CompleteSale()

               'create the context
               Dim context As 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
               Dim apicall As 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() Dim shpmnt As New ShipmentTrackingDetailsType() shpmnt.ShipmentTrackingNumber = "Your Tracking Number here" shpmnt.ShippingCarrierUsed = "YourCarrier" apicall.Shipment.ShipmentTrackingDetails.Add(shpmnt) '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 (GMT) at which the call was made apicall.Shipment.ShippedTime = New DateTime(2013, 7, 23, 10, 0, 0).ToUniversalTime()
               'call the Execute method

          End Sub

     End Class

End Namespace

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