Home
Find the answer to your question
.NET SDK sample to specify the Item Condition using LookupAttribute.
Summary
If you want to list items in Media categories (Books, DVD and Movies, Music, and
Video Game categories), you can specify the Item condition using
LookupAttribute, instead specifying it via an attribute.
Detailed Description
This C# example demonstrates how to list a book using its ISBN and
LookupAttribute to specify the Item Condition:
/*
using System; namespace SDK3Examples
public class AddItem
}
{
public void AddItemWithLookupAttribute(string
uuid)
{ AddItemCall apicall = new AddItemCall(GetContext()); ItemType item = new ItemType(); item.Currency = CurrencyCodeType.USD; item.Country = CountryCodeType.US; item.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection(); item.PaymentMethods.Add(BuyerPaymentMethodCodeType.PayPal); item.PayPalEmailAddress = 'test@foo.com'; item.Quantity = 1; item.PostalCode = '95125'; item.ListingDuration = 'Days_7'; //Set the ISBN item.ExternalProductID = new ExternalProductIDType(); item.ExternalProductID.Type = ExternalProductCodeType.ISBN; item.ExternalProductID.Value = '0439784549'; //Set the item condition item.LookupAttributeArray = new LookupAttributeTypeCollection(); LookupAttributeType attItemCondition = new LookupAttributeType(); attItemCondition.Name = 'Condition'; attItemCondition.Value = 'New'; item.LookupAttributeArray.Add(attItemCondition); item.StartPrice = new AmountType(); item.StartPrice.currencyID = CurrencyCodeType.USD; item.StartPrice.Value = 20; item.UUID = uuid; item.PictureDetails = new PictureDetailsType(); //This will automatically use the stock photo and set the gallery image to the stock photo item.PictureDetails.GalleryType = GalleryTypeCodeType.Gallery; apicall.Execute(); } public ApiContext
GetContext()
// Credentials for the call
}
context.ApiCredential.ApiAccount.Developer = 'devID'; context.ApiCredential.ApiAccount.Application = 'appID'; context.ApiCredential.ApiAccount.Certificate = 'certID'; context.ApiCredential.eBayToken = 'token'; // Set the URL // Set logging // Set the version return context; } |
Version Info
The code example above was based on the versions specified below:
API Schema Version | 495 |
.NET SDK Version | .NET SDK v495.0 full release |