-
-
Notifications
You must be signed in to change notification settings - Fork 313
Orders
Joshua Harms edited this page Dec 20, 2023
·
1 revision
var service = new OrderService(myShopifyUrl, shopAccessToken);
var order = new Order()
{
CreatedAt = DateTime.UtcNow,
BillingAddress = new Address()
{
Address1 = "123 4th Street",
City = "Minneapolis",
Province = "Minnesota",
ProvinceCode = "MN",
Zip = "55401",
Phone = "555-555-5555",
FirstName = "John",
LastName = "Doe",
Company = "Tomorrow Corporation",
Country = "United States",
CountryCode = "US",
Default = true,
},
LineItems = new List<LineItem>()
{
new LineItem()
{
Name = "Test Line Item",
Title = "Test Line Item Title"
}
},
FinancialStatus = "paid",
TotalPrice = 5.00,
Email = Guid.NewGuid().ToString() + "@example.com",
Note = "Test note about the customer.",
};
order = await service.CreateAsync(order);
var service = new OrderService(myShopifyUrl, shopAccessToken);
var order = await service.GetAsync(orderId);
var service = new OrderService(myShopifyUrl, shopAccessToken);
var order = await service.UpdateAsync(orderId, new Order()
{
Notes = "test notes."
});
var service = new OrderService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(orderId);
var service = new OrderService(myShopifyUrl, shopAccessToken);
int orderCount = await service.CountAsync();
var service = new OrderService(myShopifyUrl, shopAccessToken);
IEnumerable<Order> orders = await service.ListAsync();
var service = new OrderService(myShopifyUrl, shopAccessToken);
await service.CloseAsync(orderId);
var service = new OrderService(myShopifyUrl, shopAccessToken);
await service.OpenAsync(orderId);
var service = new OrderService(myShopifyUrl, shopAccessToken);
await service.CancelAsync(orderId);