var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var result = client.GetAsync("/episerverapi/commerce/entries/{entry code}/prices").Result.Content.ReadAsStringAsync().Result
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/xml"));
var result = client.GetAsync("/episerverapi/commerce/entries/{entry code}/prices").Result.Content.ReadAsStringAsync().Result
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var result = client.GetAsync("/episerverapi/commerce/entries/{entry code}/prices/{priceValueId}").Result.Content.ReadAsStringAsync().Result
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/xml"));
var result = client.GetAsync("/episerverapi/commerce/entries/{entry code}/prices/{priceValueId}").Result.Content.ReadAsStringAsync().Result
var model = new Price()
{
CatalogEntryCode = "Jackets-Peacoats-Hooded-Tan-Small",
CurrencyCode = "USD",
MarketId = "DEFAULT",
MinQuantity = 0,
PriceCode = "mark",
PriceTypeId = "PriceGroup",
UnitPrice = 30,
ValidFrom = DateTime.UtcNow,
ValidUntil = DateTime.UtcNow.AddDays(100)
};
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var serializer = new XmlSerializer(typeof(Price));
var xml = String.Empty;
using (var ms = new MemoryStream())
{
serializer.Serialize(ms, model);
xml = Encoding.Default.GetString(ms.ToArray());
}
var result = client.PostAsync("/episerverapi/commerce/entries/{entry code}/prices",
new StringContent(xml, Encoding.UTF8, "text/xml")).Result.Content.ReadAsStringAsync().Result
var model = new Price()
{
CatalogEntryCode = "Jackets-Peacoats-Hooded-Tan-Small",
CurrencyCode = "USD",
MarketId = "DEFAULT",
MinQuantity = 0,
PriceCode = "",
PriceTypeId = "AllCustomers",
PriceValueId = 250,
UnitPrice = 30,
ValidFrom = DateTime.UtcNow,
ValidUntil = DateTime.UtcNow.AddDays(100)
};
var json = JsonConvert.SerializeObject(model);
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var result = client.PutAsync("/episerverapi/commerce/entries/{entry code}/prices/{priceValueId}",
new StringContent(json, Encoding.UTF8, "application/json")).Result.Content.ReadAsStringAsync().Result
Response JSON
204 No Content
Client Code Media Type XML
var model = new Price()
{
CatalogEntryCode = "Jackets-Peacoats-Hooded-Tan-Small",
CurrencyCode = "USD",
MarketId = "DEFAULT",
MinQuantity = 0,
PriceCode = "",
PriceTypeId = "AllCustomers",
PriceValueId = 250,
UnitPrice = 30,
ValidFrom = DateTime.UtcNow,
ValidUntil = DateTime.UtcNow.AddDays(100)
};
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var serializer = new XmlSerializer(typeof(Price));
var xml = String.Empty;
using (var ms = new MemoryStream())
{
serializer.Serialize(ms, model);
xml = Encoding.Default.GetString(ms.ToArray());
}
var result = client.PutAsync("/episerverapi/commerce/entries/{entry code}/prices/{priceValueId}",
new StringContent(xml, Encoding.UTF8, "text/xml")).Result.Content.ReadAsStringAsync().Result
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var result = client.DeleteAsync("/episerverapi/commerce/entries/{entry code}/prices/{priceValueId}").Result.Content.ReadAsStringAsync().Result
var client = new HttpClient()
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/xml"));
var result = client.DeleteAsync("/episerverapi/commerce/entries/{entry code}/prices/{priceValueId}").Result.Content.ReadAsStringAsync().Result