Skip to main content
Published: October 31 2006, 1:08:00 PMUpdated: November 28 2020, 2:57:28 PM

.NET SDK Sample code for listing an Item on Half.com

.NET SDK Sample code for listing an Item on Half.com

Summary

If you are a high volume seller, you may want to consider using FileExchange to list for items as listing via FileExchange is highly optimized. 



Detailed Description

Here is the sample code to list an item on Half.com:

using System;
using eBay.Service.Call;
using eBay.Service.Core.Sdk;
using eBay.Service.Util;
using eBay.Service.Core.Soap;

namespace SDK3Examples
{

public class Addtem
{
   public void AddHalfItem(string uuid)
   {
    AddItemCall addItem = new AddItemCall(GetContext());

    // Set the item properties
    ItemType item = new ItemType();
    item.Currency = CurrencyCodeType.USD;
    item.Country = CountryCodeType.US;
    item.Description = "description";
    item.ListingType = ListingTypeCodeType.Half;
    item.ListingDuration = "Days_30";
    item.Location = "San Jose";
    item.PrimaryCategory = new CategoryType();
    item.PrimaryCategory.CategoryID = "268";
    item.Quantity = 1;
    item.StartPrice = new AmountType();
    item.StartPrice.currencyID = CurrencyCodeType.USD;
    item.StartPrice.Value = 5;
    item.UUID = uuid;
    // Set the ExternalProductID
    item.ExternalProductID = new ExternalProductIDType();
    item.ExternalProductID.Type = ExternalProductCodeType.ISBN;
    item.ExternalProductID.Value = "0446516244";
    // Set the item condition
    item.AttributeArray = new AttributeTypeCollection();
    AttributeType at = new AttributeType();
    at.attributeLabel = "Condition";
    at.Value = new ValTypeCollection();
    ValType val = new ValType();
    val.ValueLiteral = "GOOD";
    at.Value.Add(val);
    item.AttributeArray.Add(at);
    addItem.AddItem(item);
}

    public ApiContext GetContext()
    {
       ApiContext context = new ApiContext();

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

  // Set logging
  context.ApiLogManager = newApiLogManager();
  context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger("Messages.log", true, true, true));
  context.ApiLogManager.EnableLogging = true;

  // Set the version
  context.Version = "479";

  return context;

    }

}

}
 

Version Info

The code example above was based on the versions specified below:

API Schema Version 479
.NET SDK Version .NET SDK v479.0 full release

 



Additional Resources

 

 

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