diff --git a/Xero.NetStandard.OAuth2/Client/ApiClient.cs b/Xero.NetStandard.OAuth2/Client/ApiClient.cs
index 39de7452..8abb3409 100644
--- a/Xero.NetStandard.OAuth2/Client/ApiClient.cs
+++ b/Xero.NetStandard.OAuth2/Client/ApiClient.cs
@@ -265,6 +265,43 @@ public ApiClient(string basePath)
_baseUrl = basePath;
}
+ ///
+ /// Initializes a new instance of the , defaulting to the global configurations' base url.
+ ///
+ /// An instance of HttpClient.
+ /// An optional instance of HttpClientHandler that is used by HttpClient.
+ ///
+ ///
+ /// Some configuration settings will not be applied without passing an HttpClientHandler.
+ /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings.
+ ///
+ public ApiClient(HttpClient client, HttpClientHandler handler = null) :
+ this(client, Xero.NetStandard.OAuth2.Client.GlobalConfiguration.Instance.BasePath, handler)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ /// An instance of HttpClient.
+ /// The target service's base path in URL format.
+ /// An optional instance of HttpClientHandler that is used by HttpClient.
+ ///
+ ///
+ ///
+ /// Some configuration settings will not be applied without passing an HttpClientHandler.
+ /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings.
+ ///
+ public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null)
+ {
+ if (client == null) throw new ArgumentNullException("client cannot be null");
+ if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty");
+
+ _httpClientHandler = handler;
+ _httpClient = client;
+ _baseUrl = basePath;
+ }
+
///
/// Disposes resources if they were created by us
///