/// <summary> /// Creates a new <see cref="ShopifyOrder"/> on the store. /// </summary> /// <param name="order">A new <see cref="ShopifyOrder"/>. Id should be set to null.</param> /// <param name="options">Options for creating the order.</param> /// <returns>The new <see cref="ShopifyOrder"/>.</returns> public async Task <ShopifyOrder> CreateAsync(ShopifyOrder order, ShopifyOrderCreateOptions options = null) { IRestRequest req = RequestEngine.CreateRequest("orders.json", Method.POST, "order"); //Build the request body Dictionary <string, object> body = new Dictionary <string, object>(options?.ToDictionary() ?? new Dictionary <string, object>()) { { "order", order } }; req.AddJsonBody(body); return(await RequestEngine.ExecuteRequestAsync <ShopifyOrder>(_RestClient, req)); }
/// <summary> /// Creates a new <see cref="ShopifyOrder"/> on the store. /// </summary> /// <param name="order">A new <see cref="ShopifyOrder"/>. Id should be set to null.</param> /// <param name="options">Options for creating the order.</param> /// <returns>The new <see cref="ShopifyOrder"/>.</returns> public async Task<ShopifyOrder> CreateAsync(ShopifyOrder order, ShopifyOrderCreateOptions options = null) { IRestRequest req = RequestEngine.CreateRequest("orders.json", Method.POST, "order"); //Build the request body Dictionary<string, object> body = new Dictionary<string, object>(options?.ToDictionary() ?? new Dictionary<string, object>()) { { "order", order } }; req.AddJsonBody(body); return await RequestEngine.ExecuteRequestAsync<ShopifyOrder>(_RestClient, req); }