CHANGE OPENINGPRICE
var payLoad = new RestrictedService.SetPricesOnNonShopItemRequest
{
NonShopItem = new RestrictedService.SetPricesNonShopItem
{
Id = itemId,
OpeningPrice = openingPrice
}
};
CHANGE OPENINGPRICE AND ADD/UPDATE RESERVEDPRICE
var payLoad = new RestrictedService.SetPricesOnNonShopItemRequest
{
NonShopItem = new RestrictedService.SetPricesNonShopItem
{
Id = itemId,
OpeningPrice = [Your opening price] ,
ReservedPrice = new RestrictedService.ReservedPrice { Price = [Your reserved price] }
}
};
CHANGE OPENINGPRICE, ADD/UPDATE RESERVEDPRICE AND ADD BINPRICE
var payLoad = new RestrictedService.SetPricesOnNonShopItemRequest
{
NonShopItem = new RestrictedService.SetPricesNonShopItem
{
Id = itemId,
OpeningPrice = [Your opening price] ,
ReservedPrice = new RestrictedService.ReservedPrice { Price = [Your reserved price] },
BinPrice = new RestrictedService.BinPrice { Price = [Your bin price] }
}
};
class Program
{
static void Main(string[] args)
{
using (var client = new RestrictedService.RestrictedServiceSoapClient("RestrictedServiceSoap"))
{
int appId = 0;
string appKey = "";
var authenticationHeader = new RestrictedService.AuthenticationHeader
{
AppId = appId,
AppKey = appKey,
};
string token = "";
int userId = 0;
var authorizationHeader = new RestrictedService.AuthorizationHeader
{
Token = token,
UserId = userId
};
int itemId = 99999999;
//The start price
int openingPrice = 10;
//The buy it now price
//To ignore setting a bin price, please leave RestrictedService.BinPrice object as null
int binPrice = 100;
//Please note that having a reserved price costs 40kr
//To ignore setting a reserved price, please leave RestrictedService.ReservedPrice object as null
int reservedPrice = 50;
var payLoad = new RestrictedService.SetPricesOnNonShopItemRequest
{
NonShopItem = new RestrictedService.SetPricesNonShopItem
{
Id = itemId,
OpeningPrice = openingPrice,
BinPrice = new RestrictedService.BinPrice { Price = binPrice },
ReservedPrice = new RestrictedService.ReservedPrice { Price = reservedPrice },
}
};
var response = client.SetPricesOnNonShopItems(authenticationHeader, authorizationHeader, null, payLoad);
if (!response.IsSuccessful)
{
foreach (var validationError in response.ValidationErrors)
{
Console.WriteLine(validationError.ErrorMessage);
}
}
else
{
Console.WriteLine("Successful");
}
}
}
}
|