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 ReviseFixedPriceItem sample for revising multi-variation item for AU

  • Answer ID 1897
  • Published 07/13/2011 05:16 AM
  • Updated 10/20/2013 06:41 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=1897
Product

Use the ReviseFixedPriceItem call to change the properties of a currently active fixed-price listing.

Here is a VB.NET ReviseFixedPriceItem sample for revising a multi-variation item (adding and deleting a variation). This sample has been written using the .NET SDK.


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

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

Namespace Trading_Samples
     Public Class Revise
          Private Sub ReviseFixedPriceItem()

               '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 = "727"
               context.Site = SiteCodeType.Australia

               Dim reviseFP As New ReviseFixedPriceItemCall(context)

               Dim item As New ItemType()
               item.SKU = "6618"

               Dim VarCol As New VariationTypeCollection()

               'Add a new Variation - Black M
               Dim var1 As New VariationType()
               var1.SKU = "1234"
               var1.Quantity = 10
               var1.StartPrice = New AmountType()
               var1.StartPrice.currencyID = CurrencyCodeType.AUD
               var1.StartPrice.Value = 35
               var1.VariationSpecifics = New NameValueListTypeCollection()

               Dim Var1Spec1 As New NameValueListType()
               Dim Var1Spec1Valuecoll As New StringCollection()

               Var1Spec1.Name = "Colour"
               Var1Spec1Valuecoll.Add("Black")
               Var1Spec1.Value = Var1Spec1Valuecoll

               var1.VariationSpecifics.Add(Var1Spec1)

               Dim Var1Spec2 As New NameValueListType()
               Dim Var1Spec2Valuecoll As New StringCollection()

               Var1Spec2.Name = "Size"
               Var1Spec2Valuecoll.Add("M")
               Var1Spec2.Value = Var1Spec2Valuecoll

               var1.VariationSpecifics.Add(Var1Spec2)

               VarCol.Add(var1)

               'Delete existing Variation Blue L
               Dim var4 As New VariationType()
               var4.Delete = True
               'Variation is identified by its SKU
               var4.SKU = "7562"
               VarCol.Add(var4)

               item.Variations = New VariationsType()
               item.Variations.Variation = VarCol

               reviseFP.Item = item

               reviseFP.Execute()
               Console.WriteLine(reviseFP.ApiResponse.Ack + " Revised SKU " + reviseFP.SKU)

          End Sub

     End Class

End Namespace

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter