/// <summary> /// Get the tax information (description and category) for a tax type ID This method returns the description for the specified tax type ID. If tax type * is supplied it will return all tax types. /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="taxType">Tax type ID for the tax type.</param> /// <returns>ApiResponse of List<TaxTypeData></returns> public avalara.comms.rest.v2.Client.ApiResponse <List <TaxTypeData> > ApiV2AfcTaxtypeTaxTypeGetWithHttpInfo(string taxType) { // verify the required parameter 'taxType' is set if (taxType == null) { throw new avalara.comms.rest.v2.Client.ApiException(400, "Missing required parameter 'taxType' when calling LookupsApi->ApiV2AfcTaxtypeTaxTypeGet"); } avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "text/plain", "application/json", "text/json" }; var localVarContentType = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (taxType != null) { localVarRequestOptions.PathParameters.Add("taxType", avalara.comms.rest.v2.Client.ClientUtils.ParameterToString(taxType)); // path parameter } // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = this.Client.Get <List <TaxTypeData> >("/api/v2/afc/taxtype/{taxType}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2AfcTaxtypeTaxTypeGet", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Commits or un-commits a document code. /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="commitRequest">CommitRequest object containing document code and optional field data to override in reports. (optional)</param> /// <returns>ApiResponse of CommitResponse</returns> public avalara.comms.rest.v2.Client.ApiResponse <CommitResponse> ApiV2AfcCommitPostWithHttpInfo(CommitRequest commitRequest = default(CommitRequest)) { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json-patch+json", "application/json", "text/json", "application/_*+json" }; // to determine the Accept header String[] _accepts = new String[] { "text/plain", "application/json", "text/json" }; var localVarContentType = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = commitRequest; // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = this.Client.Post <CommitResponse>("/api/v2/afc/Commit", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2AfcCommitPost", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Performs tax calculations on all invoices and line items within the request body. /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="calcTaxesRequest">CalcTaxesRequest object containing invoices to process and data required for performing tax calculations. (optional)</param> /// <returns>Task of ApiResponse (CalcTaxesResponse)</returns> public async System.Threading.Tasks.Task <avalara.comms.rest.v2.Client.ApiResponse <CalcTaxesResponse> > ApiV2AfcCalcTaxesPostAsyncWithHttpInfo(CalcTaxesRequest calcTaxesRequest = default(CalcTaxesRequest)) { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json-patch+json", "application/json", "text/json", "application/_*+json" }; // to determine the Accept header String[] _accepts = new String[] { "text/plain", "application/json", "text/json" }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } localVarRequestOptions.Data = calcTaxesRequest; // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <CalcTaxesResponse>("/api/v2/afc/CalcTaxes", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2AfcCalcTaxesPost", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Get primary location data associated with a PCode Request will return primary jurisdiction associated with the PCode /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="pCode"></param> /// <returns>ApiResponse of PCodeLookupResult</returns> public avalara.comms.rest.v2.Client.ApiResponse <PCodeLookupResult> ApiV2AfcPrimaryPCodeGetWithHttpInfo(int pCode) { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "text/plain", "application/json", "text/json" }; var localVarContentType = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.PathParameters.Add("pCode", avalara.comms.rest.v2.Client.ClientUtils.ParameterToString(pCode)); // path parameter // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = this.Client.Get <PCodeLookupResult>("/api/v2/afc/primary/{pCode}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2AfcPrimaryPCodeGet", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Get location data associated with a PCode Request will return all jurisdictions associated with the PCode /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="pcode"></param> /// <returns>Task of ApiResponse (PCodeLookupResult)</returns> public async System.Threading.Tasks.Task <avalara.comms.rest.v2.Client.ApiResponse <PCodeLookupResult> > ApiV2AfcLocationPcodeGetAsyncWithHttpInfo(int pcode) { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "text/plain", "application/json", "text/json" }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } localVarRequestOptions.PathParameters.Add("pcode", avalara.comms.rest.v2.Client.ClientUtils.ParameterToString(pcode)); // path parameter // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync <PCodeLookupResult>("/api/v2/afc/location/{pcode}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2AfcLocationPcodeGet", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Health check that confirms the service is operational and ready to use /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <returns>ApiResponse of Object(void)</returns> public avalara.comms.rest.v2.Client.ApiResponse <Object> ApiV2HealthCheckGetWithHttpInfo() { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { }; var localVarContentType = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = avalara.comms.rest.v2.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = this.Client.Get <Object>("/api/v2/HealthCheck", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2HealthCheckGet", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Health check that confirms the service is operational and ready to use /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <avalara.comms.rest.v2.Client.ApiResponse <Object> > ApiV2HealthCheckGetAsyncWithHttpInfo() { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync <Object>("/api/v2/HealthCheck", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2HealthCheckGet", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Retrieves one or more profiles with associated settings and configurable items /// </summary> /// <exception cref="avalara.comms.rest.v2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="requestedClientId">Client id associated with profile(s) to be fetched Null value will use client id submitting the request or default client id as applicable. (optional)</param> /// <param name="requestedProfileId">Configuration profile id to be fetched Use 0 to indicate all profiles Null value will use profile id from request or 0 if not set. (optional)</param> /// <param name="itemType">Item Type Examples: Configuration, Bundle, Exclusion, Override, All (optional)</param> /// <returns>Task of ApiResponse (TaxCalculationSettingsResponse)</returns> public async System.Threading.Tasks.Task <avalara.comms.rest.v2.Client.ApiResponse <TaxCalculationSettingsResponse> > ApiV2ProfilesGetProfilesGetAsyncWithHttpInfo(int?requestedClientId = default(int?), int?requestedProfileId = default(int?), TaxCalculationSettingTypes itemType = default(TaxCalculationSettingTypes)) { avalara.comms.rest.v2.Client.RequestOptions localVarRequestOptions = new avalara.comms.rest.v2.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "text/plain", "application/json", "text/json" }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } if (requestedClientId != null) { foreach (var _kvp in avalara.comms.rest.v2.Client.ClientUtils.ParameterToMultiMap("", "RequestedClientId", requestedClientId)) { foreach (var _kvpValue in _kvp.Value) { localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } } if (requestedProfileId != null) { foreach (var _kvp in avalara.comms.rest.v2.Client.ClientUtils.ParameterToMultiMap("", "RequestedProfileId", requestedProfileId)) { foreach (var _kvpValue in _kvp.Value) { localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } } if (itemType != null) { foreach (var _kvp in avalara.comms.rest.v2.Client.ClientUtils.ParameterToMultiMap("", "ItemType", itemType)) { foreach (var _kvpValue in _kvp.Value) { localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } } // authentication (Basic) required // http basic authentication required if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + avalara.comms.rest.v2.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync <TaxCalculationSettingsResponse>("/api/v2/profiles/GetProfiles", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ApiV2ProfilesGetProfilesGet", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }