For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

VB.NET CompleteSale sample to upload shipment tracking number

  • Answer ID 1682
  • Published 08/16/2010 02:16 PM
  • Updated 10/20/2013 06:41 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=1682
Product

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 - http://opensource.org/licenses/cddl1.php

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 = "https://api.sandbox.ebay.com/wsapi"

               '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
               apicall.Execute()
               Console.WriteLine(apicall.ApiResponse.Ack)

          End Sub

     End Class

End Namespace

File Attachments

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter