From 4f7a7770ecae9813e2938a90cae4e47b6924b7a8 Mon Sep 17 00:00:00 2001 From: kitabi Date: Mon, 26 Feb 2024 17:30:12 -0600 Subject: [PATCH 1/4] ShipEngine_CreateWarehouseAndCreateManifest --- .../CreateWarehouse200Response.json | 27 +++++ ShipEngine.Tests/ShipEngine.Tests.csproj | 2 +- .../CreateWarehouseTest.cs | 87 ++++++++++++++ .../Models/Dto/CreateWarehouse/Params.cs | 15 +++ .../Models/Dto/CreateWarehouse/Result.cs | 12 ++ ShipEngine/Models/Dto/ListWarehous/Result.cs | 17 +++ ShipEngine/Models/Dto/Warehouse/Warehouse.cs | 16 +++ ShipEngine/ShipEngine.cs | 111 +++++++++++++++++- 8 files changed, 283 insertions(+), 4 deletions(-) create mode 100644 ShipEngine.Tests/HttpResponseMocks/CreateWarehouse200Response.json create mode 100644 ShipEngine.Tests/ShipEngineMethodTests/CreateWarehouseTest.cs create mode 100644 ShipEngine/Models/Dto/CreateWarehouse/Params.cs create mode 100644 ShipEngine/Models/Dto/CreateWarehouse/Result.cs create mode 100644 ShipEngine/Models/Dto/ListWarehous/Result.cs create mode 100644 ShipEngine/Models/Dto/Warehouse/Warehouse.cs diff --git a/ShipEngine.Tests/HttpResponseMocks/CreateWarehouse200Response.json b/ShipEngine.Tests/HttpResponseMocks/CreateWarehouse200Response.json new file mode 100644 index 00000000..d2bd4c80 --- /dev/null +++ b/ShipEngine.Tests/HttpResponseMocks/CreateWarehouse200Response.json @@ -0,0 +1,27 @@ +{ + "name": "Example Corp. East Warehouse", + "origin_address": { + "company_name": "Example Corp.", + "name": "John Doe", + "phone": "111-111-1111", + "address_line1": "4009 Marathon Blvd", + "address_line2": "Suite 300", + "city_locality": "Austin", + "state_province": "TX", + "postal_code": "78756", + "country_code": "US", + "address_residential_indicator": "no" + }, + "return_address": { + "company_name": "Example Corp.", + "name": "John Doe", + "phone": "111-111-1111", + "address_line1": "4009 Marathon Blvd", + "address_line2": "Suite 300", + "city_locality": "Austin", + "state_province": "TX", + "postal_code": "78756", + "country_code": "US", + "address_residential_indicator": "no" + } +} \ No newline at end of file diff --git a/ShipEngine.Tests/ShipEngine.Tests.csproj b/ShipEngine.Tests/ShipEngine.Tests.csproj index 64e2bcfd..cdca9e4f 100644 --- a/ShipEngine.Tests/ShipEngine.Tests.csproj +++ b/ShipEngine.Tests/ShipEngine.Tests.csproj @@ -25,6 +25,6 @@ - + diff --git a/ShipEngine.Tests/ShipEngineMethodTests/CreateWarehouseTest.cs b/ShipEngine.Tests/ShipEngineMethodTests/CreateWarehouseTest.cs new file mode 100644 index 00000000..e12e9e24 --- /dev/null +++ b/ShipEngine.Tests/ShipEngineMethodTests/CreateWarehouseTest.cs @@ -0,0 +1,87 @@ +using Moq; +using Newtonsoft.Json; +using ShipEngineSDK; +using ShipEngineSDK.Common.Enums; +using ShipEngineSDK.CreateWarehouse; +using System; +using System.IO; +using System.Net.Http; +using System.Threading.Tasks; +using Xunit; + +namespace ShipEngineTest +{ + public class CreateWarehouseTest + { + + public TestUtils TestUtils; + + public Params Params; + + public CreateWarehouseTest() + { + + Params = new Params() + { + IsDefault = true, + Name = "Warehouse 1", + OriginAddress = new ShipEngineSDK.Common.Address() + { + Name = "John Doe", + AddressLine1 = "4009 Marathon Blvd", + CityLocality = "Austin", + StateProvince = "TX", + PostalCode = "78756", + CountryCode = Country.US, + Phone = "512-555-5555" + }, + ReturnAddress = new ShipEngineSDK.Common.Address() + { + Name = "John Doe", + AddressLine1 = "4009 Marathon Blvd", + CityLocality = "Austin", + StateProvince = "TX", + PostalCode = "78756", + CountryCode = Country.US, + Phone = "512-555-5555" + }, + }; + + TestUtils = new TestUtils(); + } + + [Fact] + public async void ValidCreateWarehouse() + { + var config = new Config("TEST_bTYAskEX6tD7vv6u/cZ/M4LaUSWBJ219+8S1jgFcnkk"); + var mockShipEngineFixture = new MockShipEngineFixture(config); + + string json = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "../../../HttpResponseMocks/CreateWarehouse200Response.json")); + + mockShipEngineFixture.StubRequest(HttpMethod.Post, "/v1/warehouses", System.Net.HttpStatusCode.OK, json); + + var result = await mockShipEngineFixture.ShipEngine.CreateWarehouse(Params, config); + + Assert.Equal("se-277331", result.WarehouseId); + Assert.Equal("Example Corp. East Warehouse", result.Name); + Assert.Equal("2021-08-27T16:29:56.8779097Z", result.CreatedAt); + } + + [Fact] + public async void InvalidRetriesInMethodCall() + { + var apiKeyString = "TEST_bTYAskEX6tD7vv6u/cZ/M4LaUSWBJ219+8S1jgFcnkk"; + + var config = new Config(apiKey: apiKeyString); + var mockHandler = new Mock(config); + var shipEngine = mockHandler.Object; + + var ex = await Assert.ThrowsAsync(async () => await shipEngine.CreateLabelFromRate(Params, methodConfig: new Config(apiKey: "12345", retries: -1))); + Assert.Equal(ErrorSource.Shipengine, ex.ErrorSource); + Assert.Equal(ErrorType.Validation, ex.ErrorType); + Assert.Equal(ErrorCode.InvalidFieldValue, ex.ErrorCode); + Assert.Equal("Retries must be greater than zero.", ex.Message); + Assert.Null(ex.RequestId); + } + } +} \ No newline at end of file diff --git a/ShipEngine/Models/Dto/CreateWarehouse/Params.cs b/ShipEngine/Models/Dto/CreateWarehouse/Params.cs new file mode 100644 index 00000000..5d03bf9f --- /dev/null +++ b/ShipEngine/Models/Dto/CreateWarehouse/Params.cs @@ -0,0 +1,15 @@ +namespace ShipEngineSDK.CreateWarehouse +{ + using ShipEngineSDK.Common; + using System; + using System.Collections.Generic; + using System.Text; + + public class Params + { + public bool IsDefault { get; set; } + public string Name { get; set; } + public Address OriginAddress { get; set; } + public Address ReturnAddress { get; set; } + } +} diff --git a/ShipEngine/Models/Dto/CreateWarehouse/Result.cs b/ShipEngine/Models/Dto/CreateWarehouse/Result.cs new file mode 100644 index 00000000..803999d9 --- /dev/null +++ b/ShipEngine/Models/Dto/CreateWarehouse/Result.cs @@ -0,0 +1,12 @@ +namespace ShipEngineSDK.ListWarehouse +{ + using ShipEngineSDK.Warehouse; + using System; + using System.Collections.Generic; + using System.Text; + + public class Result + { + public Warehouse.Result[] Warehouses { get; set; } + } +} diff --git a/ShipEngine/Models/Dto/ListWarehous/Result.cs b/ShipEngine/Models/Dto/ListWarehous/Result.cs new file mode 100644 index 00000000..5cb8b54c --- /dev/null +++ b/ShipEngine/Models/Dto/ListWarehous/Result.cs @@ -0,0 +1,17 @@ +namespace ShipEngineSDK.CreateWarehouse +{ + using ShipEngineSDK.Common; + using System; + using System.Collections.Generic; + using System.Text; + + public class Result + { + public string WarehouseId { get; set; } + public bool IsDefault { get; set; } + public string Name { get; set; } + public string CreatedAt { get; set; } + public Address OriginAddress { get; set; } + public Address ReturnAddress { get; set; } + } +} diff --git a/ShipEngine/Models/Dto/Warehouse/Warehouse.cs b/ShipEngine/Models/Dto/Warehouse/Warehouse.cs new file mode 100644 index 00000000..fc3eabd1 --- /dev/null +++ b/ShipEngine/Models/Dto/Warehouse/Warehouse.cs @@ -0,0 +1,16 @@ +namespace ShipEngineSDK.Warehouse +{ + using ShipEngineSDK.Common; + using System; + using System.Collections.Generic; + using System.Text; + + public class Result + { + public string WarehouseId { get; set; } + public string Name { get; set; } + public string CreatedAt { get; set; } + public Address OriginAddress { get; set; } + public Address ReturnAddress { get; set; } + } +} diff --git a/ShipEngine/ShipEngine.cs b/ShipEngine/ShipEngine.cs index cbdcf2f8..4453b9a8 100644 --- a/ShipEngine/ShipEngine.cs +++ b/ShipEngine/ShipEngine.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using ShipEngineSDK.Common; +using ShipEngineSDK.ListWarehouse; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; @@ -199,14 +200,14 @@ public ShipEngine(Config config) : base() /// /// Track a shipment using the label id /// - /// The label id associated with the shipment + /// The label id associated with the shipment /// Configuration object that overrides the global config for this method call /// An object that contains the label id tracking information - public async Task TrackUsingLabelId(string labelId, Config methodConfig) + public async Task TrackUsingLabelId(string warehouseId, Config methodConfig) { var client = ConfigureHttpClient(methodConfig, new HttpClient()); - var path = $"/v1/labels/{labelId}/track"; + var path = $"/v1/labels/{warehouseId}/track"; var trackingInfo = await SendHttpRequestAsync(HttpMethod.Get, path, null, client, methodConfig); @@ -363,5 +364,109 @@ public ShipEngine(Config config) : base() return labelResult; } + + /// + /// Create a warehouse with provided details + /// + /// + /// + public async Task CreateWarehouse(ShipEngineSDK.CreateWarehouse.Params warehouseParams) + { + var path = $"/v1/warehouses"; + + string warehouseParamsString = JsonConvert.SerializeObject(warehouseParams, JsonSerializerSettings); + + var warehosueResult = await SendHttpRequestAsync(HttpMethod.Post, path, warehouseParamsString, _client, _config); + + _client.Dispose(); + + return warehosueResult; + } + /// + /// Creates a warehouse with the provided details + /// + /// + /// + /// + public async Task CreateWarehouse(ShipEngineSDK.CreateWarehouse.Params warehouseParams, Config methodConfig) + { + + var client = ConfigureHttpClient(methodConfig, new HttpClient()); + + var path = $"/v1/warehouses"; + + string warehouseParamsString = JsonConvert.SerializeObject(warehouseParams, JsonSerializerSettings); + + var warehosueResult = await SendHttpRequestAsync(HttpMethod.Post, path, warehouseParamsString, client, methodConfig); + + client.Dispose(); + + return warehosueResult; + } + + /// + /// List all warehouses + /// + /// + public async Task ListWarehouses() + { + var path = "v1/warehouses"; + + var warehouses = await SendHttpRequestAsync(HttpMethod.Get, path, null, _client, _config); + + _client.Dispose(); + return warehouses; + } + /// + /// Get a list of all warehouses + /// + /// + /// + public async Task ListWarehouses(Config methodConfig) + { + var client = ConfigureHttpClient(methodConfig, new HttpClient()); + var path = "v1/warehouses"; + + var warehouses = await SendHttpRequestAsync(HttpMethod.Get, path, null, client, methodConfig); + + client.Dispose(); + return warehouses; + } + + /// + /// Get warehouse by Id + /// + /// + /// + public async Task GetWarehouseByWarehouseId(string warehouseId) + { + var path = $"/v1/warehouse/{warehouseId}"; + + var warehouseInfo = await SendHttpRequestAsync(HttpMethod.Get, path, null, _client, _config); + + _client.Dispose(); + + return warehouseInfo; + } + + /// + /// Get warehouse by Id + /// + /// + /// + /// + public async Task GetWarehouseByWarehouseId(string warehouseId, Config methodConfig) + { + var client = ConfigureHttpClient(methodConfig, new HttpClient()); + + var path = $"/v1/warehouse/{warehouseId}"; + + var warehouseInfo = await SendHttpRequestAsync(HttpMethod.Get, path, null, client, methodConfig); + + client.Dispose(); + + return warehouseInfo; + } + } } \ No newline at end of file From 1dab7b3ca780e409253790c5dee0e27b5511fc86 Mon Sep 17 00:00:00 2001 From: kitabi Date: Tue, 27 Feb 2024 19:59:57 -0600 Subject: [PATCH 2/4] Create Manifest --- ShipEngine/Models/Dto/ListManifest/Result.cs | 18 +++++++ ShipEngine/ShipEngine.cs | 51 ++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 ShipEngine/Models/Dto/ListManifest/Result.cs diff --git a/ShipEngine/Models/Dto/ListManifest/Result.cs b/ShipEngine/Models/Dto/ListManifest/Result.cs new file mode 100644 index 00000000..2a61cf2b --- /dev/null +++ b/ShipEngine/Models/Dto/ListManifest/Result.cs @@ -0,0 +1,18 @@ +#nullable disable + +using ShipEngineSDK.Manifests; +using System.Collections.Generic; + +namespace ShipEngineSDK.ListManifest +{ + /// + /// List Carrier Results + /// + public class Result + { + /// + /// List of carriers associated with the account + /// + public List Manifests { get; set; } + } +} \ No newline at end of file diff --git a/ShipEngine/ShipEngine.cs b/ShipEngine/ShipEngine.cs index 4453b9a8..db7de42f 100644 --- a/ShipEngine/ShipEngine.cs +++ b/ShipEngine/ShipEngine.cs @@ -113,7 +113,58 @@ public ShipEngine(Config config) : base() return carriers; } + /// + /// List Manifests + /// + /// + public async Task ListManifests() + { + var path = $"/v1/manifests"; + var manifests = await SendHttpRequestAsync(HttpMethod.Get, path, null, _client, _config); + return manifests; + } + + /// + /// List Manifests + /// + /// + /// + /// + public async Task ListManifests(string manifestId, Config methodConfig) + { + var client = ConfigureHttpClient(methodConfig, new HttpClient()); + + var path = $"/v1/manifests"; + var manifests = await SendHttpRequestAsync(HttpMethod.Get, path, null, client, methodConfig); + return manifests; + } + + /// + /// Get Created Manifest + /// + /// + /// + public async Task GetManifest(string manifestId) + { + var path = $"/v1/manifests/{manifestId}"; + var manifest = await SendHttpRequestAsync(HttpMethod.Get, path, null, _client, _config); + return manifest; + } + /// + /// Get Created Manifest + /// + /// + /// + /// + public async Task GetManifest(string manifestId, Config methodConfig) + { + var client = ConfigureHttpClient(methodConfig, new HttpClient()); + + var path = $"/v1/manifests/{manifestId}"; + var manifest = await SendHttpRequestAsync(HttpMethod.Get, path, null, client, methodConfig); + return manifest; + } /// /// Create a manifest From 3df1236d943c069127e9f2a6300f8bda29298371 Mon Sep 17 00:00:00 2001 From: kitabi Date: Tue, 27 Feb 2024 20:04:00 -0600 Subject: [PATCH 3/4] Fixed incorrect parameter name change in TrackLabel function --- ShipEngine/ShipEngine.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ShipEngine/ShipEngine.cs b/ShipEngine/ShipEngine.cs index db7de42f..6cc5a127 100644 --- a/ShipEngine/ShipEngine.cs +++ b/ShipEngine/ShipEngine.cs @@ -251,14 +251,14 @@ public ShipEngine(Config config) : base() /// /// Track a shipment using the label id /// - /// The label id associated with the shipment + /// The label id associated with the shipment /// Configuration object that overrides the global config for this method call /// An object that contains the label id tracking information - public async Task TrackUsingLabelId(string warehouseId, Config methodConfig) + public async Task TrackUsingLabelId(string labelId, Config methodConfig) { var client = ConfigureHttpClient(methodConfig, new HttpClient()); - var path = $"/v1/labels/{warehouseId}/track"; + var path = $"/v1/labels/{labelId}/track"; var trackingInfo = await SendHttpRequestAsync(HttpMethod.Get, path, null, client, methodConfig); From f294a8c326a513330c68e84d5ae40716143cc11f Mon Sep 17 00:00:00 2001 From: kitabi Date: Wed, 6 Mar 2024 01:15:16 -0600 Subject: [PATCH 4/4] ShipEngine_SalesOrder --- .../Models/Dto/CreateWarehouse/Params.cs | 1 + ShipEngine/Models/Dto/ImportOrders/Params.cs | 24 ++++ .../Models/Dto/ListSalesOrder/Result.cs | 113 ++++++++++++++++++ .../{ListWarehous => ListWarehouse}/Result.cs | 4 +- ShipEngine/ShipEngine.cs | 36 +++++- 5 files changed, 172 insertions(+), 6 deletions(-) create mode 100644 ShipEngine/Models/Dto/ImportOrders/Params.cs create mode 100644 ShipEngine/Models/Dto/ListSalesOrder/Result.cs rename ShipEngine/Models/Dto/{ListWarehous => ListWarehouse}/Result.cs (85%) diff --git a/ShipEngine/Models/Dto/CreateWarehouse/Params.cs b/ShipEngine/Models/Dto/CreateWarehouse/Params.cs index 5d03bf9f..11a79185 100644 --- a/ShipEngine/Models/Dto/CreateWarehouse/Params.cs +++ b/ShipEngine/Models/Dto/CreateWarehouse/Params.cs @@ -11,5 +11,6 @@ public class Params public string Name { get; set; } public Address OriginAddress { get; set; } public Address ReturnAddress { get; set; } + public string WarehouseId { get; set; } } } diff --git a/ShipEngine/Models/Dto/ImportOrders/Params.cs b/ShipEngine/Models/Dto/ImportOrders/Params.cs new file mode 100644 index 00000000..1457384e --- /dev/null +++ b/ShipEngine/Models/Dto/ImportOrders/Params.cs @@ -0,0 +1,24 @@ +namespace ShipEngineSDK.ImportOrders +{ + using ShipEngineSDK.Common; + using System; + using System.Collections.Generic; + using System.Text; + + public class Params + { + public string OrderSourceId { get; set; } + public string OrderSourceNickname { get; set; } + public string OrderSourceCode { get; set; } + public string OrderSourceFriendlyName { get; set; } + public bool Active { get; set; } + public RefreshInfo RefreshInfo { get; set; } + } + + public class RefreshInfo + { + public string Status { get; set; } + public string LastRefreshAttempt { get; set; } + public string RefreshDate { get; set; } + } +} diff --git a/ShipEngine/Models/Dto/ListSalesOrder/Result.cs b/ShipEngine/Models/Dto/ListSalesOrder/Result.cs new file mode 100644 index 00000000..62ac57cd --- /dev/null +++ b/ShipEngine/Models/Dto/ListSalesOrder/Result.cs @@ -0,0 +1,113 @@ +#nullable disable + +using ShipEngineSDK.Common; +using ShipEngineSDK.Common.Enums; +using System; +using System.Collections.Generic; + +namespace ShipEngineSDK.ListSalesOrder +{ + /// + /// List Carrier Results + /// + public class Result + { + public List SalesOrders { get; set; } + public int Total { get; set; } + } + + public class SalesOrder + { + public string SalesOrderId { get; set; } + public string ExternalOrderId { get; set; } + public string ExternalOrderNumber { get; set; } + public OrderSource OrderSource { get; set; } + public SalesOrderStatus SalesOrderStatus { get; set; } + public DateTime? OrderDate { get; set; } + public DateTime? CreatedAt { get; set; } + public DateTime? ModifiedAt { get; set; } + public PaymentDetails PaymentDetails { get; set; } + public Customer Customer { get; set; } + public BillTo BillTo { get; set; } + public Address ShipTo { get; set; } + public SalesOrderItems SalesOrderItems { get; set; } + } + + public class SalesOrderItems + { + public string SalesOrderItemId { get; set; } + public List LineItemDetails { get; set; } + } + + public class LineItemDetails + { + public string Name { get; set; } + public string Sku { get; set; } + public Weight Weight { get; set; } + public Address ShipTo { get; set; } + public RequestedShippingOptions RequestedShippingOptions { get; set; } + public PriceSummary PriceSummary { get; set; } + public int Quantity { get; set; } + public bool IsGift { get; set; } + } + + public class PriceSummary + { + public MonetaryValue UnitPrice { get; set; } + public MonetaryValue EstimatedTax { get; set; } + public string EstimatedShipping { get; set; } + public MonetaryValue Total { get; set; } + } + + public class RequestedShippingOptions + { + public string ShippingSerive { get; set; } + public DateTime? ShipDate { get; set; } + } + + public class BillTo + { + public string Email { get; set; } + public Address Address { get; set; } + } + + public class Customer + { + public string Name { get; set; } + public string Phone { get; set; } + public string Email { get; set; } + } + + public class PaymentDetails + { + public MonetaryValue Subtotal { get; set; } + public MonetaryValue EstimatesShipping { get; set; } + public MonetaryValue EstimatesTax { get; set; } + public MonetaryValue GrandTotal { get; set; } + } + + public class SalesOrderStatus + { + public string PaymentStatus { get; set; } + public string FulfillmentStatus { get; set; } + public bool IsCancelled { get; set; } + } + + public class OrderSource + { + public string OrderSourceId { get; set; } + public string OrderSourceNickname { get; set; } + public string OrderSourceCode { get; set; } + public string OrderSourceFriendlyName { get; set; } + public RefreshInfo RefreshInfo { get; set; } + public bool Active { get; set; } + } + public class RefreshInfo + { + public string Status { get; set; } + public string LastRefreshAttempt { get; set; } + public string RefreshDate { get; set; } + } + + +} \ No newline at end of file diff --git a/ShipEngine/Models/Dto/ListWarehous/Result.cs b/ShipEngine/Models/Dto/ListWarehouse/Result.cs similarity index 85% rename from ShipEngine/Models/Dto/ListWarehous/Result.cs rename to ShipEngine/Models/Dto/ListWarehouse/Result.cs index 5cb8b54c..95ae9ea6 100644 --- a/ShipEngine/Models/Dto/ListWarehous/Result.cs +++ b/ShipEngine/Models/Dto/ListWarehouse/Result.cs @@ -1,11 +1,11 @@ -namespace ShipEngineSDK.CreateWarehouse +namespace ShipEngineSDK.ListWarehouse { using ShipEngineSDK.Common; using System; using System.Collections.Generic; using System.Text; - public class Result + public class Params { public string WarehouseId { get; set; } public bool IsDefault { get; set; } diff --git a/ShipEngine/ShipEngine.cs b/ShipEngine/ShipEngine.cs index 6cc5a127..3dc024aa 100644 --- a/ShipEngine/ShipEngine.cs +++ b/ShipEngine/ShipEngine.cs @@ -421,13 +421,13 @@ public ShipEngine(Config config) : base() /// /// /// - public async Task CreateWarehouse(ShipEngineSDK.CreateWarehouse.Params warehouseParams) + public async Task CreateWarehouse(ShipEngineSDK.CreateWarehouse.Params warehouseParams) { var path = $"/v1/warehouses"; string warehouseParamsString = JsonConvert.SerializeObject(warehouseParams, JsonSerializerSettings); - var warehosueResult = await SendHttpRequestAsync(HttpMethod.Post, path, warehouseParamsString, _client, _config); + var warehosueResult = await SendHttpRequestAsync(HttpMethod.Post, path, warehouseParamsString, _client, _config); _client.Dispose(); @@ -439,7 +439,7 @@ public ShipEngine(Config config) : base() /// /// /// - public async Task CreateWarehouse(ShipEngineSDK.CreateWarehouse.Params warehouseParams, Config methodConfig) + public async Task CreateWarehouse(ShipEngineSDK.CreateWarehouse.Params warehouseParams, Config methodConfig) { var client = ConfigureHttpClient(methodConfig, new HttpClient()); @@ -448,7 +448,7 @@ public ShipEngine(Config config) : base() string warehouseParamsString = JsonConvert.SerializeObject(warehouseParams, JsonSerializerSettings); - var warehosueResult = await SendHttpRequestAsync(HttpMethod.Post, path, warehouseParamsString, client, methodConfig); + var warehosueResult = await SendHttpRequestAsync(HttpMethod.Post, path, warehouseParamsString, client, methodConfig); client.Dispose(); @@ -519,5 +519,33 @@ public ShipEngine(Config config) : base() return warehouseInfo; } + public async Task ImportOrders(ImportOrders.Params importOrderParams) + { + var path = "/v-beta/order_sources/"; + + string paramString = JsonConvert.SerializeObject(importOrderParams, JsonSerializerSettings); + + await SendHttpRequestAsync(HttpMethod.Put, path, paramString, _client, _config); + _client.Dispose(); + return; + } + public async Task ListSalesOrders(string orderSourceId) + { + try + { + var path = $"/v-beta/sales_orders{orderSourceId}"; + var result = await SendHttpRequestAsync(HttpMethod.Put, path, null, _client, _config); + + _client.Dispose(); + return result; + } + catch (System.Exception ex) + { + + throw; + } + } + + } } \ No newline at end of file