Skip to main content
Published: May 02 2011, 5:47:00 AMUpdated: November 28 2020, 9:24:35 PM

Here is a sample written using the .NET SDK (v715) for listing a fixed price item to the AU site using the AddFixedPriceItem call. The sample has been written in VB.NET.

The mandatory fields for listing an item are -

1. Title

2. Description

3. Country

4. PostalCode

5. Currency

6. StartPrice

7. CategoryID

8. ListingDuration

9. PaymentMethods

10. PayPalEmailAddress

11. ShippingDetails

12. DispatchTimeMax

13. ReturnPolicy

The item is set to be able to be tracked by its SKU number. Therefore a unique SKU number needs to be specified in the request. As a best practice it is recommended to list an item by specifying its Condition. 

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

/* 2012-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 AddFixedPriceItem 'AddFPItem - Basic listing Private Sub AddFPItemCall() 'create the context Dim context As New ApiContext() 'set the User token context.ApiCredential.eBayToken = "Your token" 'set the server url. Pointing to Sandbox 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 = "687" context.Site = SiteCodeType.Australia 'create the call object Dim AddFPItemCall As New AddFixedPriceItemCall(context) 'Send UUID with the request AddFPItemCall.AutoSetItemUUID = True Dim item As New ItemType() 'set the item condition depending on the value from GetCategoryFeatures item.ConditionID = 1000 'new with tags 'Basic properties of a listing item.Country = CountryCodeType.AU item.Currency = CurrencyCodeType.AUD ' Track inventory by SKU item.InventoryTrackingMethod = InventoryTrackingMethodCodeType.SKU ' Specify unique SKU item.SKU = "BASIC1234" item.Description = "test - do not bid or buy" item.Title = "test - do not bid or buy" item.SubTitle = "Test Item" item.ListingDuration = "Days_7" 'Set Payment Method to PayPal item.PaymentMethods = New BuyerPaymentMethodCodeTypeCollection() item.PaymentMethods.Add(BuyerPaymentMethodCodeType.PayPal) item.PayPalEmailAddress = "test@pp.com" item.Location = "Australia" 'Specify Shipping Services item.DispatchTimeMax = 3 item.ShippingDetails = New ShippingDetailsType() item.ShippingDetails.ShippingServiceOptions = New ShippingServiceOptionsTypeCollection() Dim shipservice1 As New ShippingServiceOptionsType() shipservice1.ShippingService = "AU_Courier" shipservice1.ShippingServicePriority = 1 shipservice1.ShippingServiceCost = New AmountType() shipservice1.ShippingServiceCost.currencyID = CurrencyCodeType.AUD shipservice1.ShippingServiceCost.Value = 1.0 shipservice1.ShippingServiceAdditionalCost = New AmountType() shipservice1.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.AUD shipservice1.ShippingServiceAdditionalCost.Value = 1.0 item.ShippingDetails.ShippingServiceOptions.Add(shipservice1) Dim shipservice2 As New ShippingServiceOptionsType() shipservice2.ShippingService = "AU_Express" shipservice2.ShippingServicePriority = 2 shipservice2.ShippingServiceCost = New AmountType() shipservice2.ShippingServiceCost.currencyID = CurrencyCodeType.AUD shipservice2.ShippingServiceCost.Value = 4.0 shipservice2.ShippingServiceAdditionalCost = New AmountType() shipservice2.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.AUD shipservice2.ShippingServiceAdditionalCost.Value = 1.0 item.ShippingDetails.ShippingServiceOptions.Add(shipservice2) 'Specify Return Policy item.ReturnPolicy = New ReturnPolicyType() item.ReturnPolicy.ReturnsAcceptedOption = "ReturnsAccepted" 'Specify Quantity, Start Price and the eBay category item.Quantity = 10 item.StartPrice = New AmountType() item.StartPrice.currencyID = CurrencyCodeType.AUD item.StartPrice.Value = 10 item.PrimaryCategory = New CategoryType() item.PrimaryCategory.CategoryID = "57991" 'Add pictures item.PictureDetails = New PictureDetailsType() item.PictureDetails.PictureURL = New StringCollection() item.PictureDetails.PictureURL.Add("http://i2.sandbox.ebayimg.com/03/i/00/3f/c5/92_1.JPG?set_id=8800004005") AddFPItemCall.Item = item 'set the item and make the call AddFPItemCall.Execute() Console.WriteLine((AddFPItemCall.ApiResponse.Ack + " " & ": Listed simple item ") + AddFPItemCall.ApiResponse.ItemID) End Sub End Class End Namespace

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