/// <summary> /// Gets the orders matching supplied criteria. /// </summary> /// <typeparam name="T">Type of order response.</typeparam> /// <param name="manager">Manager through which to get orders.</param> /// <param name="orderCriteria">The order criteria.</param> /// <param name="accountId">The account id.</param> /// <returns>Orders matching supplied criteria.</returns> /// <seealso href="http://developer.channeladvisor.com/display/cadn/OrderCriteria">OrderCriteria</seealso> /// <example>Getting orders updated between specific dates. /// <code> /// var orderCriteria = new OrderCriteria /// { /// StatusUpdateFilterBeginTimeGMT = startDate, /// StatusUpdateFilterEndTimeGMT = endDate /// }; /// var orders = this.GetOrders< OrderResponseDetailHigh >( orderCriteria ); /// </code> /// </example> public static IEnumerable <T> GetOrders <T>(this IChannelAdvisorManager manager, OrderCriteria orderCriteria, string accountId) where T : OrderResponseItem { var orderService = manager.GetOrdersServiceByAccountId(accountId); return(orderService.GetOrders <T>(orderCriteria)); }
public static IList <T> GetOrdersList <T>(this IChannelAdvisorManager manager, DateTime start, DateTime end, string accountId) where T : OrderResponseItem { var orderService = manager.GetOrdersServiceByAccountId(accountId); return(orderService.GetOrdersList <T>(start, end)); }
/// <summary> /// Gets the items by skus. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="skus">The skus.</param> /// <returns>List of items matching supplied SKUs.</returns> public static IEnumerable <InventoryItemResponse> GetItems(this IChannelAdvisorManager manager, string accountId, string[] skus) { var itemService = manager.GetItemsServiceByAccountId(accountId); return(itemService.GetItems(skus)); }
/// <summary> /// Deletes the item. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="sku">The sku of the item to delete.</param> public static void DeleteItem(this IChannelAdvisorManager manager, string accountId, string sku) { var itemService = manager.GetItemsServiceByAccountId(accountId); itemService.DeleteItem(sku); }
/// <summary> /// Marks the order shipped. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account ID.</param> /// <param name="orderId">The order ID.</param> /// <param name="carrierCode">The carrier code.</param> /// <param name="classCode">The class code.</param> /// <param name="trackingNumber">The tracking number.</param> /// <param name="dateShipped">The date shipped when order was shipped (will be converted to UTC).</param> /// <seealso href="http://developer.channeladvisor.com/display/cadn/OrderShipped"/> public static void MarkOrderShipped(this IChannelAdvisorManager manager, string accountId, int orderId, string carrierCode, string classCode, string trackingNumber, DateTime dateShipped) { var shippingService = manager.GetShippingServiceByAccountId(accountId); shippingService.MarkOrderShipped(orderId, carrierCode, classCode, trackingNumber, dateShipped); }
/// <summary> /// Updates the quantity and prices on all supplied items. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="itemQuantityAndPrice">The item quantity and price.</param> public static void UpdateQuantityAndPrices(this IChannelAdvisorManager manager, string accountId, List <InventoryItemQuantityAndPrice> itemQuantityAndPrice) { var itemService = manager.GetItemsServiceByAccountId(accountId); itemService.UpdateQuantityAndPrices(itemQuantityAndPrice); }
/// <summary> /// Creates or update an item. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="item">An item to add / update.</param> /// <remarks>If SKU exists, item is updated, otherwise it's created. /// <para>For update, populate only properties you want updated. Other properties remain unchanged.</para></remarks> /// <seealso href="http://developer.channeladvisor.com/display/cadn/SynchInventoryItemList"/> public static void SynchItem(this IChannelAdvisorManager manager, string accountId, InventoryItemSubmit item) { var itemService = manager.GetItemsServiceByAccountId(accountId); itemService.SynchItem(item); }
/// <summary> /// Gets the additional item quantities. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="sku">The sku.</param> /// <returns>Item quantities.</returns> /// <remarks>This is required since <see cref="GetItems(IChannelAdvisorManager,string,string[])"/> returns /// only available quantity.</remarks> /// <see href="http://developer.channeladvisor.com/display/cadn/GetInventoryItemQuantityInfo"/> public static QuantityInfoResponse GetItemQuantities(this IChannelAdvisorManager manager, string accountId, string sku) { var itemsService = manager.GetItemsServiceByAccountId(accountId); return(itemsService.GetItemQuantities(sku)); }
/// <summary> /// Gets the item attributes. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="sku">The sku.</param> /// <returns>Item attributes collection.</returns> public static AttributeInfo[] GetAttributes(this IChannelAdvisorManager manager, string accountId, string sku) { var itemsService = manager.GetItemsServiceByAccountId(accountId); return(itemsService.GetAttributes(sku)); }
/// <summary> /// Gets the item. /// </summary> /// <param name="manager">The manager.</param> /// <param name="accountId">The account id.</param> /// <param name="sku">The item sku.</param> /// <returns> /// Returns the item or <c>null</c> if item with specified SKU doesn't exist. /// </returns> /// <example>Get single item by SKU. /// <code> /// var item = ChannelAdvisorFacade.GetItem( "account id", "sku to get" ); /// </code></example> public static InventoryItemResponse GetItem(this IChannelAdvisorManager manager, string accountId, string sku) { var items = GetItems(manager, accountId, new[] { sku }); return(items.FirstOrDefault()); }