/// <summary> /// Gets a list of up to 250 of the shop's fulfillments. /// </summary> /// <param name="orderId">The order id to which the fulfillments belong.</param> /// <param name="options">Options for filtering the list.</param> /// <returns>The list of fulfillments matching the filter.</returns> public async Task<IEnumerable<ShopifyFulfillment>> ListAsync(long orderId, ShopifyListFilter options = null) { var req = RequestEngine.CreateRequest($"orders/{orderId}/fulfillments.json", Method.GET, "fulfillments"); //Add optional parameters to request if (options != null) req.Parameters.AddRange(options.ToParameters(ParameterType.GetOrPost)); return await RequestEngine.ExecuteRequestAsync<List<ShopifyFulfillment>>(_RestClient, req); }
/// <summary> /// Gets a list of up to 250 of the shop's themes. /// </summary> /// <returns></returns> public async Task <IEnumerable <ShopifyTheme> > ListAsync(ShopifyListFilter filter = null) { IRestRequest req = RequestEngine.CreateRequest("themes.json", Method.GET, "themes"); //Add optional parameters to request if (filter != null) { req.Parameters.AddRange(filter.ToParameters(ParameterType.GetOrPost)); } return(await RequestEngine.ExecuteRequestAsync <List <ShopifyTheme> >(_RestClient, req)); }
/// <summary> /// Searches through a shop's customers for the given search query. /// </summary> /// <param name="query">The search query, in format of 'Bob country:United States', which would search for customers in the United States with a name like 'Bob'.</param> /// <param name="order">An optional string to order the results, in format of 'field_name DESC'. Default is 'last_order_date DESC'.</param> /// <param name="filter">Options for filtering the results.</param> /// <returns>A list of matching customers.</returns> public async Task <IEnumerable <ShopifyCustomer> > SearchAsync(string query, string order = null, ShopifyListFilter filter = null) { IRestRequest req = RequestEngine.CreateRequest("customers/search.json", Method.GET, "customers"); req.AddQueryParameter("query", query); if (string.IsNullOrEmpty(order) == false) { req.AddQueryParameter("order", order); } if (filter != null) { req.Parameters.AddRange(filter.ToParameters(ParameterType.QueryString)); } return(await RequestEngine.ExecuteRequestAsync <List <ShopifyCustomer> >(_RestClient, req)); }
/// <summary> /// Gets a list of up to 250 of the shop's fulfillments. /// </summary> /// <param name="orderId">The order id to which the fulfillments belong.</param> /// <param name="options">Options for filtering the list.</param> /// <returns>The list of fulfillments matching the filter.</returns> public async Task <IEnumerable <ShopifyFulfillment> > ListAsync(long orderId, ShopifyListFilter options = null) { var req = RequestEngine.CreateRequest($"orders/{orderId}/fulfillments.json", Method.GET, "fulfillments"); //Add optional parameters to request if (options != null) { req.Parameters.AddRange(options.ToParameters(ParameterType.GetOrPost)); } return(await RequestEngine.ExecuteRequestAsync <List <ShopifyFulfillment> >(_RestClient, req)); }
/// <summary> /// Gets a list of variants belonging to the given product. /// </summary> /// <param name="productId">The product that the variants belong to.</param> /// <param name="filterOptions">Options for filtering the result.</param> public async Task <IEnumerable <ShopifyProductVariant> > ListAsync(long productId, ShopifyListFilter filterOptions = null) { var req = RequestEngine.CreateRequest($"products/{productId}/variants.json", Method.GET, "variants"); if (filterOptions != null) { req.Parameters.AddRange(filterOptions.ToParameters(ParameterType.GetOrPost)); } return(await RequestEngine.ExecuteRequestAsync <List <ShopifyProductVariant> >(_RestClient, req)); }