Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void Page_Load(object sender, EventArgs e)
{
//var client = new WebClient();
//client.Headers.Add("accept", "application/json");
//client.Credentials = new NetworkCredential("richas", "richa@leosys");
//var response = client.DownloadString("http://data.shipstation.com/1.1/Orders?$top=900");

ShipStationEntities entities = new ShipStationEntities(new Uri("https://data.shipstation.com/1.2"));
entities.Credentials = new System.Net.NetworkCredential("richas", "richa@leosys");

//CREATE Order
Order order = new Order();
// order.OrderID = 999999999;
order.StoreID = 25249;
order.OrderNumber = "r4958";
order.ImportKey = "r4958";
order.OrderDate = DateTime.Now;
order.PayDate = null;
order.OrderStatusID = 1;
order.RequestedShippingService = "USPS Priority Mail";
order.OrderTotal = 123.45m;
order.AmountPaid = 123.45m;
order.ShippingAmount = 0.00m;
order.WeightOz = 1;
order.NotesFromBuyer = "Please make sure it gets here by Monday!";
order.InternalNotes = "Expedite this order.";
order.Username = "haribabu@leotechnosoft.net";
order.BuyerEmail = "haribabu@leosys.in";
order.ShipName = "The President";
order.ShipCompany = "US Govt";
order.ShipStreet1 = "1600 Pennsylvania Ave";
order.ShipCity = "Washington";
order.ShipState = "DC";
order.ShipPostalCode = "";
order.ShipCountryCode = "US";
order.ShipPhone = "";

//CREATE Order Item
OrderItem item = new OrderItem();
item.OrderID = order.OrderID;
item.SKU = "FD88821";
item.Description = "My Product Name";
item.ThumbnailUrl = "http://www.mystore.com/products/12345.jpg";
item.WeightOz = 8;
item.Quantity = 2;
item.UnitPrice = 13.99m;
item.Options = "Size: Large\nColor: Green";

//Associate Order Item to Order and Save
item.Order = order;
order.OrderItems.Add(item);
entities.AddToOrders(order);
entities.AddRelatedObject(order, "OrderItems", item);
entities.SaveChanges();

var orderToRead2 = entities.Orders.Where(x => x.OrderID == 12345678).FirstOrDefault();

txtorder.Text = orderToRead2.ToString();


//GetShippedOrders();
}
Posted

1 solution

There are alot of tools to do that.

Have you tried google[*]?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900