From c7b830941bba1d558bb80b3df1d6327bd05d4e8d Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Thu, 30 Nov 2017 14:44:41 -0800 Subject: [PATCH 01/13] SDK for REST v2 17.12 --- GlobalAssemblyInfo.cs | 4 +- src/AvaTaxApi.cs | 1118 +++++++++++++++-- src/Avalara.AvaTax.nuspec | 2 +- src/enums/AccountStatusId.cs | 1 + src/enums/AccrualType.cs | 1 + src/enums/AddressCategoryId.cs | 1 + src/enums/AddressTypeId.cs | 1 + src/enums/AdjustmentPeriodTypeId.cs | 1 + src/enums/AdjustmentReason.cs | 1 + src/enums/AdjustmentTypeId.cs | 1 + src/enums/ApiCallStatus.cs | 1 + src/enums/AuthenticationTypeId.cs | 1 + src/enums/BatchStatus.cs | 1 + src/enums/BatchType.cs | 1 + src/enums/BoundaryLevel.cs | 1 + src/enums/CertExpressInvitationStatus.cs | 1 + src/enums/CertificatePreviewType.cs | 1 + src/enums/CertificateRequestDeliveryMethod.cs | 1 + src/enums/CommentType.cs | 1 + src/enums/CompanyAccessLevel.cs | 1 + src/enums/CompanyFilingStatus.cs | 1 + src/enums/DocumentStatus.cs | 1 + src/enums/DocumentType.cs | 102 +- src/enums/ErrorCodeId.cs | 100 +- src/enums/ExemptCertReviewStatusId.cs | 1 + src/enums/ExemptCertStatusId.cs | 1 + src/enums/ExemptCertTypeId.cs | 1 + src/enums/FilingFrequencyId.cs | 1 + src/enums/FilingRequestStatus.cs | 1 + src/enums/FilingStatusId.cs | 1 + src/enums/FilingTypeId.cs | 1 + src/enums/FundingOption.cs | 1 + src/enums/JurisTypeId.cs | 1 + src/enums/JurisdictionType.cs | 1 + src/enums/LocalNexusTypeId.cs | 1 + src/enums/MatchingTaxType.cs | 1 + src/enums/NexusTypeId.cs | 1 + src/enums/NoticeCustomerType.cs | 1 + src/enums/NoticePriorityId.cs | 1 + src/enums/OutletTypeId.cs | 1 + src/enums/ParameterBagDataType.cs | 1 + src/enums/PasswordStatusId.cs | 1 + src/enums/PaymentAccountTypeId.cs | 1 + src/enums/PaymentType.cs | 1 + src/enums/PointOfSaleFileType.cs | 1 + src/enums/PointOfSalePartnerId.cs | 1 + src/enums/RateType.cs | 1 + src/enums/RefundType.cs | 1 + src/enums/ReportDateFilter.cs | 1 + src/enums/ReportDocType.cs | 1 + src/enums/ReportFormat.cs | 1 + src/enums/ResolutionQuality.cs | 1 + src/enums/RoundingLevelId.cs | 1 + src/enums/ScraperType.cs | 1 + src/enums/SecurityRoleId.cs | 1 + src/enums/ServiceMode.cs | 1 + src/enums/ServiceTypeId.cs | 1 + src/enums/SeverityLevel.cs | 1 + src/enums/Sourcing.cs | 1 + src/enums/TaxDebugLevel.cs | 1 + src/enums/TaxDependencyLevelId.cs | 1 + src/enums/TaxOverrideType.cs | 1 + src/enums/TaxOverrideTypeId.cs | 1 + src/enums/TaxRuleTypeId.cs | 1 + src/enums/TaxType.cs | 1 + src/enums/TextCase.cs | 1 + src/enums/VoidReasonCode.cs | 1 + src/enums/WelcomeEmail.cs | 1 + src/enums/WorksheetTypeId.cs | 1 + src/models/AccountConfigurationModel.cs | 1 + src/models/AccountModel.cs | 1 + src/models/ActivateAccountModel.cs | 1 + src/models/AddTransactionLineModel.cs | 1 + src/models/AddressInfo.cs | 20 +- src/models/AddressLocationInfo.cs | 20 +- src/models/AddressResolutionModel.cs | 1 + src/models/AddressValidationInfo.cs | 20 +- src/models/AddressesModel.cs | 6 + src/models/AdjustMultiDocumentModel.cs | 52 + src/models/AdjustTransactionModel.cs | 3 +- src/models/ApproveFilingsModel.cs | 1 + src/models/AuditMultiDocumentModel.cs | 75 ++ src/models/AuditTransactionModel.cs | 11 +- src/models/AvaFileFormModel.cs | 1 + src/models/AvaTaxMessage.cs | 1 + src/models/BatchFileModel.cs | 1 + src/models/BatchModel.cs | 1 + src/models/BulkLockTransactionModel.cs | 1 + src/models/BulkLockTransactionResult.cs | 1 + src/models/CertExpressInvitationModel.cs | 1 + .../CertExpressInvitationStatusModel.cs | 1 + src/models/CertificateAttributeModel.cs | 1 + src/models/CertificateModel.cs | 1 + src/models/ChangeTransactionCodeModel.cs | 1 + src/models/CommitMultiDocumentModel.cs | 57 + src/models/CommitTransactionModel.cs | 8 +- src/models/CommunicationsTSPairModel.cs | 1 + .../CommunicationsTransactionTypeModel.cs | 1 + src/models/CompanyAddress.cs | 20 +- src/models/CompanyConfigurationModel.cs | 1 + src/models/CompanyInitializationModel.cs | 20 +- src/models/CompanyModel.cs | 1 + src/models/ContactModel.cs | 20 +- src/models/CoordinateInfo.cs | 1 + src/models/CoverLetterModel.cs | 1 + .../CreateCertExpressInvitationModel.cs | 1 + src/models/CreateMultiDocumentModel.cs | 242 ++++ src/models/CreateOrAdjustTransactionModel.cs | 1 + src/models/CreateTransactionModel.cs | 14 +- src/models/CustomerModel.cs | 20 +- src/models/CycleAddOptionModel.cs | 1 + src/models/CycleEditOptionModel.cs | 1 + src/models/CycleExpireModel.cs | 1 + src/models/CycleExpireOptionModel.cs | 1 + src/models/EcmsDetailModel.cs | 20 +- src/models/EcmsDetailTaxCodeModel.cs | 1 + src/models/EcmsModel.cs | 34 +- src/models/EntityUseCodeModel.cs | 1 + src/models/ErrorDetail.cs | 1 + src/models/ExemptionReasonModel.cs | 1 + src/models/ExemptionStatusModel.cs | 1 + src/models/ExportDocumentLineModel.cs | 1 + src/models/ExposureZoneModel.cs | 1 + src/models/FilingAdjustmentModel.cs | 1 + src/models/FilingAnswerModel.cs | 1 + src/models/FilingAugmentationModel.cs | 1 + src/models/FilingCalendarEditModel.cs | 1 + src/models/FilingCalendarModel.cs | 39 +- src/models/FilingFrequencyModel.cs | 1 + src/models/FilingModel.cs | 1 + src/models/FilingPaymentModel.cs | 1 + src/models/FilingRegionModel.cs | 1 + src/models/FilingRequestDataModel.cs | 1 + src/models/FilingRequestModel.cs | 1 + src/models/FilingReturnModel.cs | 1 + src/models/FilingReturnModelBasic.cs | 1 + src/models/FilingStatusChangeModel.cs | 1 + src/models/FilingsCheckupAuthorityModel.cs | 1 + src/models/FilingsCheckupModel.cs | 1 + .../FilingsCheckupSuggestedFormModel.cs | 1 + src/models/FreeTrialRequestModel.cs | 1 + src/models/FundingConfigurationModel.cs | 65 + src/models/FundingESignMethodReturn.cs | 1 + src/models/FundingInitiateModel.cs | 1 + src/models/FundingStatusModel.cs | 1 + src/models/IsoCountryModel.cs | 17 +- src/models/IsoLocalizedName.cs | 55 + src/models/IsoRegionModel.cs | 12 +- src/models/ItemModel.cs | 1 + src/models/JurisdictionModel.cs | 20 +- src/models/JurisdictionOverrideModel.cs | 13 +- src/models/LicenseKeyModel.cs | 1 + src/models/LineItemModel.cs | 15 +- src/models/LinkCertificatesModel.cs | 1 + src/models/LinkCustomersModel.cs | 1 + src/models/LocationModel.cs | 20 +- src/models/LocationQuestionModel.cs | 1 + src/models/LocationSettingModel.cs | 1 + src/models/LocationValidationModel.cs | 1 + src/models/LockTransactionModel.cs | 1 + src/models/LoginVerificationInputModel.cs | 1 + src/models/LoginVerificationOutputModel.cs | 1 + src/models/MrsCompanyModel.cs | 60 + src/models/MultiDocumentLineItemModel.cs | 157 +++ src/models/MultiDocumentModel.cs | 92 ++ src/models/NewAccountModel.cs | 1 + src/models/NewAccountRequestModel.cs | 2 + src/models/NexusByTaxFormModel.cs | 1 + src/models/NexusModel.cs | 36 +- src/models/NexusTaxTypeGroupModel.cs | 1 + src/models/NoticeCommentModel.cs | 1 + .../NoticeCustomerFundingOptionModel.cs | 1 + src/models/NoticeCustomerTypeModel.cs | 1 + src/models/NoticeFilingTypeModel.cs | 1 + src/models/NoticeFinanceModel.cs | 1 + src/models/NoticeModel.cs | 20 +- src/models/NoticePriorityModel.cs | 1 + src/models/NoticeReasonModel.cs | 1 + src/models/NoticeResponsibilityDetailModel.cs | 1 + src/models/NoticeResponsibilityModel.cs | 1 + src/models/NoticeRootCauseDetailModel.cs | 1 + src/models/NoticeRootCauseModel.cs | 1 + src/models/NoticeStatusModel.cs | 1 + src/models/NoticeTypeModel.cs | 1 + src/models/OriginalApiRequestResponseModel.cs | 1 + src/models/ParameterModel.cs | 1 + src/models/PasswordChangeModel.cs | 1 + src/models/PingResultModel.cs | 1 + src/models/PoNumberModel.cs | 1 + src/models/PointOfSaleDataRequestModel.cs | 1 + src/models/RateModel.cs | 1 + src/models/RateTypeModel.cs | 3 +- src/models/RebuildFilingsModel.cs | 1 + .../ReconstructedApiRequestResponseModel.cs | 1 + src/models/ReconstructedMultiDocumentModel.cs | 41 + src/models/RefundTransactionModel.cs | 1 + src/models/RemoveTransactionLineModel.cs | 1 + src/models/ReportModel.cs | 1 + src/models/ReportParametersModel.cs | 1 + src/models/ResetLicenseKeyModel.cs | 1 + src/models/ResourceFileTypeModel.cs | 1 + src/models/ResourceFileUploadRequestModel.cs | 1 + src/models/SecurityRoleModel.cs | 1 + src/models/SetPasswordModel.cs | 1 + src/models/SettingModel.cs | 1 + src/models/SettleTransactionModel.cs | 17 +- src/models/SkyscraperStatusModel.cs | 1 + src/models/SubscriptionModel.cs | 1 + src/models/SubscriptionTypeModel.cs | 1 + src/models/TaxAuthorityFormModel.cs | 1 + src/models/TaxAuthorityInfo.cs | 1 + src/models/TaxAuthorityModel.cs | 1 + src/models/TaxAuthorityTypeModel.cs | 1 + src/models/TaxCodeModel.cs | 1 + src/models/TaxCodeTypesModel.cs | 1 + src/models/TaxOverrideModel.cs | 1 + src/models/TaxRateModel.cs | 1 + src/models/TaxRuleModel.cs | 28 +- src/models/TaxSubTypeModel.cs | 1 + src/models/TaxTypeGroupModel.cs | 1 + src/models/TransactionAddressModel.cs | 1 + src/models/TransactionLineDetailModel.cs | 1 + .../TransactionLineLocationTypeModel.cs | 1 + src/models/TransactionLineModel.cs | 15 +- src/models/TransactionLocationTypeModel.cs | 1 + src/models/TransactionModel.cs | 21 +- src/models/TransactionSummary.cs | 1 + src/models/UPCModel.cs | 1 + src/models/UserEntitlementModel.cs | 1 + src/models/UserModel.cs | 1 + src/models/ValidatedAddressInfo.cs | 32 +- src/models/VerifyMultiDocumentModel.cs | 79 ++ src/models/VerifyTransactionModel.cs | 26 +- src/models/VoidTransactionModel.cs | 1 + .../requiredFilingCalendarDataFieldModel.cs | 1 + 235 files changed, 2851 insertions(+), 210 deletions(-) create mode 100644 src/models/AdjustMultiDocumentModel.cs create mode 100644 src/models/AuditMultiDocumentModel.cs create mode 100644 src/models/CommitMultiDocumentModel.cs create mode 100644 src/models/CreateMultiDocumentModel.cs create mode 100644 src/models/FundingConfigurationModel.cs create mode 100644 src/models/IsoLocalizedName.cs create mode 100644 src/models/MrsCompanyModel.cs create mode 100644 src/models/MultiDocumentLineItemModel.cs create mode 100644 src/models/MultiDocumentModel.cs create mode 100644 src/models/ReconstructedMultiDocumentModel.cs create mode 100644 src/models/VerifyMultiDocumentModel.cs diff --git a/GlobalAssemblyInfo.cs b/GlobalAssemblyInfo.cs index 2d5759df..9f8d2475 100644 --- a/GlobalAssemblyInfo.cs +++ b/GlobalAssemblyInfo.cs @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("17.9.0.126")] -[assembly: AssemblyFileVersion("17.9.0.126")] +[assembly: AssemblyVersion("17.12.0.856")] +[assembly: AssemblyFileVersion("17.12.0.856")] diff --git a/src/AvaTaxApi.cs b/src/AvaTaxApi.cs index 48dd7a23..34d5d5a2 100644 --- a/src/AvaTaxApi.cs +++ b/src/AvaTaxApi.cs @@ -17,7 +17,7 @@ * @author Zhenya Frolov * @copyright 2004-2017 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 17.9.0-126 + * @version 17.12.0-856 * @link https://github.com/avadev/AvaTax-REST-V2-DotNet-SDK */ @@ -28,7 +28,7 @@ public partial class AvaTaxClient /// /// Returns the version number of the API used to generate this class /// - public static string API_VERSION { get { return "17.9.0-126"; } } + public static string API_VERSION { get { return "17.12.0-856"; } } #region Methods @@ -918,6 +918,24 @@ public List DeleteCompany(Int32 id) } + /// + /// Check the funding configuration of a company + /// + /// + /// This API is available by invitation only. + /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. + /// Returns the funding configuration of the requested company. + /// . + /// + /// The unique identifier of the company + public FundingConfigurationModel FundingConfigurationByCompany(Int32 companyId) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/funding/configuration"); + path.ApplyField("companyId", companyId); + return RestCall("Get", path, null); + } + + /// /// Retrieve a single company /// @@ -1003,13 +1021,13 @@ public String GetFilingStatus(Int32 id) /// - /// Check managed returns funding configuration for a company + /// Check managed returns funding status for a company /// /// /// This API is available by invitation only. /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. /// Returns a list of funding setup requests and their current status. - /// Each object in the result is a request that was made to setup or adjust funding configuration for this company. + /// Each object in the result is a request that was made to setup or adjust funding status for this company. /// /// The unique identifier of the company public List ListFundingRequestsByCompany(Int32 id) @@ -1028,10 +1046,10 @@ public List ListFundingRequestsByCompany(Int32 id) /// /// Get a list of companies with an active MRS service. /// - public FetchResult ListMrsCompanies() + public FetchResult ListMrsCompanies() { var path = new AvaTaxPath("/api/v2/companies/mrs"); - return RestCall>("Get", path, null); + return RestCall>("Get", path, null); } @@ -1915,6 +1933,7 @@ public FetchResult ListLoginVerifiers(String filter, Int3 /// /// /// Returns the full list of all Avalara-supported nexus for all countries and regions. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus. /// /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . @@ -1946,9 +1965,24 @@ public FetchResult ListNexus(String filter, Int32? top, Int32? skip, /// The first address line portion of this address. /// The first address line portion of this address. /// The city portion of this address. - /// The region, state, or province code portion of this address. + /// Name or ISO 3166 code identifying the region portion of the address. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code or zip code portion of this address. - /// The two-character ISO-3166 code of the country portion of this address. + /// Name or ISO 3166 code identifying the country portion of this address. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -1976,6 +2010,7 @@ public FetchResult ListNexusByAddress(String line1, String line2, St /// /// /// Returns all Avalara-supported nexus for the specified country. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country. /// /// The country in which you want to fetch the system nexus @@ -2000,6 +2035,7 @@ public FetchResult ListNexusByCountry(String country, String filter, /// /// /// Returns all Avalara-supported nexus for the specified country and region. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country and region. /// /// The two-character ISO-3166 code for the country. @@ -3306,13 +3342,13 @@ public FilingsCheckupModel FilingsCheckupReports(Int32 companyId, Int32 year, In /// This API is available by invitation only. /// /// The ID of the company that owns the filings. - /// The unique id of the worksheet return. + /// The unique id of the worksheet return. /// The unique id of the document you are downloading - public FileResult GetFilingAttachment(Int32 companyId, Int64 filingId, Int64? fileId) + public FileResult GetFilingAttachment(Int32 companyId, Int64 filingReturnId, Int64? fileId) { - var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingId}/attachment"); + var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingReturnId}/attachment"); path.ApplyField("companyId", companyId); - path.ApplyField("filingId", filingId); + path.ApplyField("filingReturnId", filingReturnId); path.AddQuery("fileId", fileId); return RestCallFile("Get", path, null); } @@ -3489,7 +3525,8 @@ public FetchResult GetFilingsByReturnName(Int32 companyId, Int16 ye /// The status of the return(s) you are trying to retrieve /// The country of the return(s) you are trying to retrieve /// The region of the return(s) you are trying to retrieve - public FetchResult GetFilingsReturns(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region) + /// The filing calendar id of the return you are trying to retrieve + public FetchResult GetFilingsReturns(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region, Int64? filingCalendarId) { var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/returns"); path.ApplyField("companyId", companyId); @@ -3499,6 +3536,7 @@ public FetchResult GetFilingsReturns(Int32 companyId, In path.AddQuery("status", status); path.AddQuery("country", country); path.AddQuery("region", region); + path.AddQuery("filingCalendarId", filingCalendarId); return RestCall>("Get", path, null); } @@ -3711,9 +3749,24 @@ public NewAccountModel RequestFreeTrial(FreeTrialRequestModel model) /// The street address of the location. /// The street address of the location. /// The city name of the location. - /// The state or region of the location + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code of the location. - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. public TaxRateModel TaxRatesByAddress(String line1, String line2, String line3, String city, String region, String postalCode, String country) { var path = new AvaTaxPath("/api/v2/taxrates/byaddress"); @@ -3729,11 +3782,13 @@ public TaxRateModel TaxRatesByAddress(String line1, String line2, String line3, /// - /// FREE API - Sales tax rates for a specified country and postal code + /// FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes. /// /// /// # Free-To-Use /// + /// This API is only available for a US postal codes. + /// /// The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. /// Any customer can request a free AvaTax account and make use of the TaxRates API. /// @@ -3758,7 +3813,15 @@ public TaxRateModel TaxRatesByAddress(String line1, String line2, String line3, /// Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) /// for information on how to upgrade to the full AvaTax CreateTransaction API. /// - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// The postal code of the location. public TaxRateModel TaxRatesByPostalCode(String country, String postalCode) { @@ -4257,6 +4320,341 @@ public LocationValidationModel ValidateLocation(Int32 companyId, Int32 id) } + /// + /// Adjust a MultiDocument transaction + /// + /// + /// Adjusts the current MultiDocument transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you adjust a transaction, that transaction's status is recorded as `Adjusted`. + /// + /// Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments. + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// Specifies objects to include in this fetch call + /// The adjust request you wish to execute + public MultiDocumentModel AdjustMultiDocumentTransaction(String code, DocumentType type, String include, AdjustMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/adjust"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("include", include); + return RestCall("Post", path, model); + } + + + /// + /// Get audit information about a MultiDocument transaction + /// + /// + /// Retrieve audit information about a MultiDocument transaction stored in AvaTax. + /// + /// The audit API retrieves audit information related to a specific MultiDocument transaction. This audit + /// information includes the following: + /// + /// * The `code` of the MultiDocument transaction + /// * The `type` of the MultiDocument transaction + /// * The server timestamp representing the exact server time when the transaction was created + /// * The server duration - how long it took to process this transaction + /// * Whether exact API call details were logged + /// * A reconstructed API call showing what the original create call looked like + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + public AuditMultiDocumentModel AuditMultiDocumentTransaction(String code, DocumentType type) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/audit"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return RestCall("Get", path, null); + } + + + /// + /// Commit a MultiDocument transaction + /// + /// + /// Marks a list of transactions by changing its status to `Committed`. + /// + /// Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Any changes made to a committed transaction will generate a transaction history. + /// + /// The commit request you wish to execute + public MultiDocumentModel CommitMultiDocumentTransaction(CommitMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/commit"); + return RestCall("Post", path, model); + } + + + /// + /// Create a new MultiDocument transaction + /// + /// + /// Records a new MultiDocument transaction in AvaTax. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This API will report an error if you attempt to create a transaction when one already exists with the specified `code`. + /// If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust` + /// value to `true`. + /// + /// To generate a refund for a transaction, use the `RefundTransaction` API. + /// + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. + /// + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + /// + /// Specifies objects to include in the response after transaction is created + /// the multi document transaction model + public MultiDocumentModel CreateMultiDocumentTransaction(String include, CreateMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$include", include); + return RestCall("Post", path, model); + } + + + /// + /// Retrieve a MultiDocument transaction + /// + /// + /// Get the current MultiDocument transaction identified by this URL. + /// + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// + /// + /// Specifies objects to include in the response after transaction is created + public MultiDocumentModel GetMultiDocumentTransactionByCodeAndType(String code, DocumentType type, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return RestCall("Get", path, null); + } + + + /// + /// Retrieve a MultiDocument transaction by ID + /// + /// + /// Get the unique MultiDocument transaction identified by this URL. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted + /// by using the `AdjustTransaction` endpoint. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// The unique ID number of the MultiDocument transaction to retrieve + /// Specifies objects to include in the response after transaction is created + public MultiDocumentModel GetMultiDocumentTransactionById(Int64 id, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{id}"); + path.ApplyField("id", id); + path.AddQuery("$include", include); + return RestCall("Get", path, null); + } + + + /// + /// Retrieve all MultiDocument transactions + /// + /// + /// List all MultiDocument transactions within this account. + /// + /// This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument + /// transactions, please use the pagination features of the API. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Specifies objects to include in the response after transaction is created + /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. + /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public FetchResult ListMultiDocumentTransactions(String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$filter", filter); + path.AddQuery("$include", include); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return RestCall>("Get", path, null); + } + + + /// + /// Create a refund for a MultiDocument transaction + /// + /// + /// Create a refund for a MultiDocument transaction. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund + /// for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and + /// specify individual line items from the original sale for refund. + /// + /// The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that + /// was calculated during the original transaction, regardless of any changes to your company's configuration, rules, + /// nexus, or any other setting. + /// + /// This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following + /// common refund scenarios: + /// + /// * A full refund of a previous sale + /// * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase + /// * Refunding one or more items (lines) from a previous sale + /// * Granting a customer a percentage refund of a previous sale + /// + /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to + /// create a custom refund transaction. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + /// + /// The code of this MultiDocument transaction + /// The type of this MultiDocument transaction + /// Specifies objects to include in the response after transaction is created + /// Information about the refund to create + public MultiDocumentModel RefundMultiDocumentTransaction(String code, DocumentType type, String include, RefundTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/refund"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return RestCall("Post", path, model); + } + + + /// + /// Verify a MultiDocument transaction + /// + /// + /// Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values. + /// + /// If the transaction does not match these expected values, this API will return an error code indicating which value did not match. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax + public MultiDocumentModel VerifyMultiDocumentTransaction(VerifyMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/verify"); + return RestCall("Post", path, model); + } + + + /// + /// Void a MultiDocument transaction + /// + /// + /// Voids the current transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you void a transaction, that transaction's status is recorded as `DocVoided`. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`, + /// and they are no longer available to be voided. + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// The void request you wish to execute + public MultiDocumentModel VoidMultiDocumentTransaction(String code, DocumentType type, VoidTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/void"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return RestCall("Post", path, model); + } + + /// /// Create a new nexus /// @@ -4910,27 +5308,7 @@ public List CreateSubscriptions(Int32 accountId, List - /// Create new users - /// - /// - /// # For Registrar Use Only - /// This API is for use by Avalara Registrar administrative users only. - /// - /// Create one or more new user objects attached to this account. - /// A user represents one person with access privileges to make API calls and work with a specific account. - /// - /// The unique ID number of the account where these users will be created. - /// The user or array of users you wish to create. - public List CreateUsers(Int32 accountId, List model) - { - var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); - path.ApplyField("accountId", accountId); - return RestCall>("Post", path, model); - } - - - /// - /// Delete a single account + /// Delete a single account /// /// /// # For Registrar Use Only @@ -5646,6 +6024,35 @@ public FileResult BuildTaxContentFileForLocation(Int32 companyId, Int32 id, Date } + /// + /// Download a file listing tax rates by postal code + /// + /// + /// Download a CSV file containing all five digit postal codes in the United States and their sales + /// and use tax rates for tangible personal property. + /// + /// This rates file is intended to be used as a default for tax calculation when your software cannot + /// call the `CreateTransaction` API call. When using this file, your software will be unable to + /// handle complex tax rules such as: + /// + /// * Zip+9 - This tax file does not contain + /// * Different product types - This tax file contains tangible personal property tax rates only. + /// * Mixed sourcing - This tax file cannot be used to resolve origin-based taxes. + /// * Threshold-based taxes - This tax file does not contain information about thresholds. + /// + /// If you use this file to provide default tax rates, please ensure that your software calls `CreateTransaction` + /// to reconcile the actual transaction and determine the difference between the estimated general tax + /// rate and the final transaction tax. + /// + /// The date for which point-of-sale data would be calculated (today by default). Example input: 2016-12-31 + public FileResult DownloadTaxRatesByZipCode(DateTime date) + { + var path = new AvaTaxPath("/api/v2/taxratesbyzipcode/download/{date}"); + path.ApplyField("date", date); + return RestCallFile("Get", path, null); + } + + /// /// Create a new tax rule /// @@ -5804,7 +6211,7 @@ public TaxRuleModel UpdateTaxRule(Int32 companyId, Int32 id, TaxRuleModel model) /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -5941,8 +6348,13 @@ public BulkLockTransactionResult BulkLockTransaction(BulkLockTransactionModel mo /// Change a transaction's code /// /// - /// Renames a transaction uniquely identified by this URL by changing its code to a new code. - /// After this API call succeeds, the transaction will have a new URL matching its new code. + /// Renames a transaction uniquely identified by this URL by changing its `code` value. + /// + /// This API is available as long as the transaction is in `saved` or `posted` status. When a transaction + /// is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method. + /// + /// After this API call succeeds, the transaction will have a new URL matching its new `code`. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). /// @@ -6001,7 +6413,7 @@ public TransactionModel CommitTransaction(String companyCode, String transaction /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6029,8 +6441,11 @@ public TransactionModel CreateOrAdjustTransaction(String include, CreateOrAdjust /// /// Records a new transaction in AvaTax. /// - /// The `CreateTransaction` endpoint uses the configuration values specified by your company to identify the correct tax rules - /// and rates to apply to all line items in this transaction, and reports the total tax calculated by AvaTax based on your + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules + /// and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your /// company's configuration and the data provided in this API call. /// /// The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To @@ -6039,11 +6454,15 @@ public TransactionModel CreateOrAdjustTransaction(String include, CreateOrAdjust /// /// To generate a refund for a transaction, use the `RefundTransaction` API. /// - /// If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database. + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. /// - /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6076,7 +6495,7 @@ public TransactionModel CreateTransaction(String include, CreateTransactionModel /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6105,8 +6524,7 @@ public TransactionModel DeleteLines(String include, RemoveTransactionLineModel m /// /// To fetch other kinds of transactions, use `GetTransactionByCodeAndType`. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -6136,8 +6554,7 @@ public TransactionModel GetTransactionByCode(String companyCode, String transact /// /// Get the current transaction identified by this URL. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -6168,11 +6585,14 @@ public TransactionModel GetTransactionByCodeAndType(String companyCode, String t /// /// /// Get the unique transaction identified by this URL. + /// /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted - /// by using the 'Adjust Transaction' endpoint. + /// by using the `AdjustTransaction` endpoint. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6197,12 +6617,18 @@ public TransactionModel GetTransactionById(Int64 id, String include) /// /// /// List all transactions attached to this company. + /// /// This endpoint is limited to returning 1,000 transactions at a time maximum. + /// + /// When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field + /// criteria, the query will default to looking at only those transactions with `date` in the past 30 days. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). /// /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines @@ -6282,7 +6708,7 @@ public TransactionModel LockTransaction(String companyCode, String transactionCo /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to /// create a custom refund transaction. /// - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6497,6 +6923,30 @@ public UPCModel UpdateUPC(Int32 companyId, Int32 id, UPCModel model) } + /// + /// Create new users + /// + /// + /// Create one or more new user objects attached to this account. + /// + /// A user represents one person with access privileges to make API calls and work with a specific account. + /// + /// Users who are account administrators or company users are permitted to create user records to invite + /// additional team members to work with AvaTax. + /// + /// A newly created user will receive an email inviting them to create their password. This means that you + /// must provide a valid email address for all user accounts created. + /// + /// The unique ID number of the account where these users will be created. + /// The user or array of users you wish to create. + public List CreateUsers(Int32 accountId, List model) + { + var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); + path.ApplyField("accountId", accountId); + return RestCall>("Post", path, model); + } + + /// /// Retrieve a single user /// @@ -7564,6 +8014,24 @@ public async Task> DeleteCompanyAsync(Int32 id) } + /// + /// Check the funding configuration of a company; + /// + /// + /// This API is available by invitation only. + /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. + /// Returns the funding configuration of the requested company. + /// .; + /// + /// The unique identifier of the company + public async Task FundingConfigurationByCompanyAsync(Int32 companyId) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/funding/configuration"); + path.ApplyField("companyId", companyId); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + /// /// Retrieve a single company; /// @@ -7649,13 +8117,13 @@ public async Task GetFilingStatusAsync(Int32 id) /// - /// Check managed returns funding configuration for a company; + /// Check managed returns funding status for a company; /// /// /// This API is available by invitation only. /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. /// Returns a list of funding setup requests and their current status. - /// Each object in the result is a request that was made to setup or adjust funding configuration for this company.; + /// Each object in the result is a request that was made to setup or adjust funding status for this company.; /// /// The unique identifier of the company public async Task> ListFundingRequestsByCompanyAsync(Int32 id) @@ -7674,10 +8142,10 @@ public async Task> ListFundingRequestsByCompanyAsync(In /// /// Get a list of companies with an active MRS service.; /// - public async Task> ListMrsCompaniesAsync() + public async Task> ListMrsCompaniesAsync() { var path = new AvaTaxPath("/api/v2/companies/mrs"); - return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); } @@ -8561,6 +9029,7 @@ public async Task> ListLoginVerifiersAsync(St /// /// /// Returns the full list of all Avalara-supported nexus for all countries and regions. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus.; /// /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . @@ -8592,9 +9061,24 @@ public async Task> ListNexusAsync(String filter, Int32? /// The first address line portion of this address. /// The first address line portion of this address. /// The city portion of this address. - /// The region, state, or province code portion of this address. + /// Name or ISO 3166 code identifying the region portion of the address. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code or zip code portion of this address. - /// The two-character ISO-3166 code of the country portion of this address. + /// Name or ISO 3166 code identifying the country portion of this address. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -8622,6 +9106,7 @@ public async Task> ListNexusByAddressAsync(String line1, /// /// /// Returns all Avalara-supported nexus for the specified country. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country.; /// /// The country in which you want to fetch the system nexus @@ -8646,6 +9131,7 @@ public async Task> ListNexusByCountryAsync(String countr /// /// /// Returns all Avalara-supported nexus for the specified country and region. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country and region.; /// /// The two-character ISO-3166 code for the country. @@ -9952,13 +10438,13 @@ public async Task FilingsCheckupReportsAsync(Int32 companyI /// This API is available by invitation only.; /// /// The ID of the company that owns the filings. - /// The unique id of the worksheet return. + /// The unique id of the worksheet return. /// The unique id of the document you are downloading - public async Task GetFilingAttachmentAsync(Int32 companyId, Int64 filingId, Int64? fileId) + public async Task GetFilingAttachmentAsync(Int32 companyId, Int64 filingReturnId, Int64? fileId) { - var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingId}/attachment"); + var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingReturnId}/attachment"); path.ApplyField("companyId", companyId); - path.ApplyField("filingId", filingId); + path.ApplyField("filingReturnId", filingReturnId); path.AddQuery("fileId", fileId); return await RestCallAsync("Get", path, null).ConfigureAwait(false); } @@ -10135,7 +10621,8 @@ public async Task> GetFilingsByReturnNameAsync(Int32 co /// The status of the return(s) you are trying to retrieve /// The country of the return(s) you are trying to retrieve /// The region of the return(s) you are trying to retrieve - public async Task> GetFilingsReturnsAsync(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region) + /// The filing calendar id of the return you are trying to retrieve + public async Task> GetFilingsReturnsAsync(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region, Int64? filingCalendarId) { var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/returns"); path.ApplyField("companyId", companyId); @@ -10145,6 +10632,7 @@ public async Task> GetFilingsReturnsAsync(In path.AddQuery("status", status); path.AddQuery("country", country); path.AddQuery("region", region); + path.AddQuery("filingCalendarId", filingCalendarId); return await RestCallAsync>("Get", path, null).ConfigureAwait(false); } @@ -10357,9 +10845,24 @@ public async Task RequestFreeTrialAsync(FreeTrialRequestModel m /// The street address of the location. /// The street address of the location. /// The city name of the location. - /// The state or region of the location + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code of the location. - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. public async Task TaxRatesByAddressAsync(String line1, String line2, String line3, String city, String region, String postalCode, String country) { var path = new AvaTaxPath("/api/v2/taxrates/byaddress"); @@ -10375,11 +10878,13 @@ public async Task TaxRatesByAddressAsync(String line1, String line /// - /// FREE API - Sales tax rates for a specified country and postal code; + /// FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes.; /// /// /// # Free-To-Use /// + /// This API is only available for a US postal codes. + /// /// The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. /// Any customer can request a free AvaTax account and make use of the TaxRates API. /// @@ -10404,7 +10909,15 @@ public async Task TaxRatesByAddressAsync(String line1, String line /// Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) /// for information on how to upgrade to the full AvaTax CreateTransaction API.; /// - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// The postal code of the location. public async Task TaxRatesByPostalCodeAsync(String country, String postalCode) { @@ -10903,6 +11416,341 @@ public async Task ValidateLocationAsync(Int32 companyId } + /// + /// Adjust a MultiDocument transaction; + /// + /// + /// Adjusts the current MultiDocument transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you adjust a transaction, that transaction's status is recorded as `Adjusted`. + /// + /// Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments.; + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// Specifies objects to include in this fetch call + /// The adjust request you wish to execute + public async Task AdjustMultiDocumentTransactionAsync(String code, DocumentType type, String include, AdjustMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/adjust"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("include", include); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Get audit information about a MultiDocument transaction; + /// + /// + /// Retrieve audit information about a MultiDocument transaction stored in AvaTax. + /// + /// The audit API retrieves audit information related to a specific MultiDocument transaction. This audit + /// information includes the following: + /// + /// * The `code` of the MultiDocument transaction + /// * The `type` of the MultiDocument transaction + /// * The server timestamp representing the exact server time when the transaction was created + /// * The server duration - how long it took to process this transaction + /// * Whether exact API call details were logged + /// * A reconstructed API call showing what the original create call looked like + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds).; + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + public async Task AuditMultiDocumentTransactionAsync(String code, DocumentType type) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/audit"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Commit a MultiDocument transaction; + /// + /// + /// Marks a list of transactions by changing its status to `Committed`. + /// + /// Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Any changes made to a committed transaction will generate a transaction history.; + /// + /// The commit request you wish to execute + public async Task CommitMultiDocumentTransactionAsync(CommitMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/commit"); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Create a new MultiDocument transaction; + /// + /// + /// Records a new MultiDocument transaction in AvaTax. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This API will report an error if you attempt to create a transaction when one already exists with the specified `code`. + /// If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust` + /// value to `true`. + /// + /// To generate a refund for a transaction, use the `RefundTransaction` API. + /// + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. + /// + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.; + /// + /// Specifies objects to include in the response after transaction is created + /// the multi document transaction model + public async Task CreateMultiDocumentTransactionAsync(String include, CreateMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$include", include); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Retrieve a MultiDocument transaction; + /// + /// + /// Get the current MultiDocument transaction identified by this URL. + /// + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size); + /// + /// + /// + /// Specifies objects to include in the response after transaction is created + public async Task GetMultiDocumentTransactionByCodeAndTypeAsync(String code, DocumentType type, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Retrieve a MultiDocument transaction by ID; + /// + /// + /// Get the unique MultiDocument transaction identified by this URL. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted + /// by using the `AdjustTransaction` endpoint. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size); + /// + /// The unique ID number of the MultiDocument transaction to retrieve + /// Specifies objects to include in the response after transaction is created + public async Task GetMultiDocumentTransactionByIdAsync(Int64 id, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{id}"); + path.ApplyField("id", id); + path.AddQuery("$include", include); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Retrieve all MultiDocument transactions; + /// + /// + /// List all MultiDocument transactions within this account. + /// + /// This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument + /// transactions, please use the pagination features of the API. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size); + /// + /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Specifies objects to include in the response after transaction is created + /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. + /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public async Task> ListMultiDocumentTransactionsAsync(String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$filter", filter); + path.AddQuery("$include", include); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Create a refund for a MultiDocument transaction; + /// + /// + /// Create a refund for a MultiDocument transaction. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund + /// for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and + /// specify individual line items from the original sale for refund. + /// + /// The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that + /// was calculated during the original transaction, regardless of any changes to your company's configuration, rules, + /// nexus, or any other setting. + /// + /// This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following + /// common refund scenarios: + /// + /// * A full refund of a previous sale + /// * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase + /// * Refunding one or more items (lines) from a previous sale + /// * Granting a customer a percentage refund of a previous sale + /// + /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to + /// create a custom refund transaction. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.; + /// + /// The code of this MultiDocument transaction + /// The type of this MultiDocument transaction + /// Specifies objects to include in the response after transaction is created + /// Information about the refund to create + public async Task RefundMultiDocumentTransactionAsync(String code, DocumentType type, String include, RefundTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/refund"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Verify a MultiDocument transaction; + /// + /// + /// Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values. + /// + /// If the transaction does not match these expected values, this API will return an error code indicating which value did not match. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds).; + /// + /// Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax + public async Task VerifyMultiDocumentTransactionAsync(VerifyMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/verify"); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Void a MultiDocument transaction; + /// + /// + /// Voids the current transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you void a transaction, that transaction's status is recorded as `DocVoided`. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`, + /// and they are no longer available to be voided.; + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// The void request you wish to execute + public async Task VoidMultiDocumentTransactionAsync(String code, DocumentType type, VoidTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/void"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + /// /// Create a new nexus; /// @@ -11555,26 +12403,6 @@ public async Task> CreateSubscriptionsAsync(Int32 accoun } - /// - /// Create new users; - /// - /// - /// # For Registrar Use Only - /// This API is for use by Avalara Registrar administrative users only. - /// - /// Create one or more new user objects attached to this account. - /// A user represents one person with access privileges to make API calls and work with a specific account.; - /// - /// The unique ID number of the account where these users will be created. - /// The user or array of users you wish to create. - public async Task> CreateUsersAsync(Int32 accountId, List model) - { - var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); - path.ApplyField("accountId", accountId); - return await RestCallAsync>("Post", path, model).ConfigureAwait(false); - } - - /// /// Delete a single account; /// @@ -12292,6 +13120,35 @@ public async Task BuildTaxContentFileForLocationAsync(Int32 companyI } + /// + /// Download a file listing tax rates by postal code; + /// + /// + /// Download a CSV file containing all five digit postal codes in the United States and their sales + /// and use tax rates for tangible personal property. + /// + /// This rates file is intended to be used as a default for tax calculation when your software cannot + /// call the `CreateTransaction` API call. When using this file, your software will be unable to + /// handle complex tax rules such as: + /// + /// * Zip+9 - This tax file does not contain + /// * Different product types - This tax file contains tangible personal property tax rates only. + /// * Mixed sourcing - This tax file cannot be used to resolve origin-based taxes. + /// * Threshold-based taxes - This tax file does not contain information about thresholds. + /// + /// If you use this file to provide default tax rates, please ensure that your software calls `CreateTransaction` + /// to reconcile the actual transaction and determine the difference between the estimated general tax + /// rate and the final transaction tax.; + /// + /// The date for which point-of-sale data would be calculated (today by default). Example input: 2016-12-31 + public async Task DownloadTaxRatesByZipCodeAsync(DateTime date) + { + var path = new AvaTaxPath("/api/v2/taxratesbyzipcode/download/{date}"); + path.ApplyField("date", date); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + /// /// Create a new tax rule; /// @@ -12450,7 +13307,7 @@ public async Task UpdateTaxRuleAsync(Int32 companyId, Int32 id, Ta /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12587,8 +13444,13 @@ public async Task BulkLockTransactionAsync(BulkLockTr /// Change a transaction's code; /// /// - /// Renames a transaction uniquely identified by this URL by changing its code to a new code. - /// After this API call succeeds, the transaction will have a new URL matching its new code. + /// Renames a transaction uniquely identified by this URL by changing its `code` value. + /// + /// This API is available as long as the transaction is in `saved` or `posted` status. When a transaction + /// is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method. + /// + /// After this API call succeeds, the transaction will have a new URL matching its new `code`. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds).; /// @@ -12647,7 +13509,7 @@ public async Task CommitTransactionAsync(String companyCode, S /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12675,8 +13537,11 @@ public async Task CreateOrAdjustTransactionAsync(String includ /// /// Records a new transaction in AvaTax. /// - /// The `CreateTransaction` endpoint uses the configuration values specified by your company to identify the correct tax rules - /// and rates to apply to all line items in this transaction, and reports the total tax calculated by AvaTax based on your + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules + /// and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your /// company's configuration and the data provided in this API call. /// /// The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To @@ -12685,11 +13550,15 @@ public async Task CreateOrAdjustTransactionAsync(String includ /// /// To generate a refund for a transaction, use the `RefundTransaction` API. /// - /// If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database. + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. /// - /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12722,7 +13591,7 @@ public async Task CreateTransactionAsync(String include, Creat /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12751,8 +13620,7 @@ public async Task DeleteLinesAsync(String include, RemoveTrans /// /// To fetch other kinds of transactions, use `GetTransactionByCodeAndType`. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -12782,8 +13650,7 @@ public async Task GetTransactionByCodeAsync(String companyCode /// /// Get the current transaction identified by this URL. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -12814,11 +13681,14 @@ public async Task GetTransactionByCodeAndTypeAsync(String comp /// /// /// Get the unique transaction identified by this URL. + /// /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted - /// by using the 'Adjust Transaction' endpoint. + /// by using the `AdjustTransaction` endpoint. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12843,12 +13713,18 @@ public async Task GetTransactionByIdAsync(Int64 id, String inc /// /// /// List all transactions attached to this company. + /// /// This endpoint is limited to returning 1,000 transactions at a time maximum. + /// + /// When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field + /// criteria, the query will default to looking at only those transactions with `date` in the past 30 days. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). /// /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines @@ -12928,7 +13804,7 @@ public async Task LockTransactionAsync(String companyCode, Str /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to /// create a custom refund transaction. /// - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -13143,6 +14019,30 @@ public async Task UpdateUPCAsync(Int32 companyId, Int32 id, UPCModel m } + /// + /// Create new users; + /// + /// + /// Create one or more new user objects attached to this account. + /// + /// A user represents one person with access privileges to make API calls and work with a specific account. + /// + /// Users who are account administrators or company users are permitted to create user records to invite + /// additional team members to work with AvaTax. + /// + /// A newly created user will receive an email inviting them to create their password. This means that you + /// must provide a valid email address for all user accounts created.; + /// + /// The unique ID number of the account where these users will be created. + /// The user or array of users you wish to create. + public async Task> CreateUsersAsync(Int32 accountId, List model) + { + var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); + path.ApplyField("accountId", accountId); + return await RestCallAsync>("Post", path, model).ConfigureAwait(false); + } + + /// /// Retrieve a single user; /// diff --git a/src/Avalara.AvaTax.nuspec b/src/Avalara.AvaTax.nuspec index 4f5c60e0..5111ac49 100644 --- a/src/Avalara.AvaTax.nuspec +++ b/src/Avalara.AvaTax.nuspec @@ -2,7 +2,7 @@ Avalara.AvaTax - 17.9.0.126 + 17.12.0.856 Avalara AvaTax SDK Add world-class tax estimation and calculation to your project with Avalara's AvaTax suite of APIs and services. Ted Spence, Zhenya Frolov diff --git a/src/enums/AccountStatusId.cs b/src/enums/AccountStatusId.cs index 313c4cab..9f6f4e11 100644 --- a/src/enums/AccountStatusId.cs +++ b/src/enums/AccountStatusId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AccrualType.cs b/src/enums/AccrualType.cs index b220c8bb..684c984b 100644 --- a/src/enums/AccrualType.cs +++ b/src/enums/AccrualType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AddressCategoryId.cs b/src/enums/AddressCategoryId.cs index 3e66aca0..1acdb198 100644 --- a/src/enums/AddressCategoryId.cs +++ b/src/enums/AddressCategoryId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AddressTypeId.cs b/src/enums/AddressTypeId.cs index 18c25353..0a3bec3a 100644 --- a/src/enums/AddressTypeId.cs +++ b/src/enums/AddressTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AdjustmentPeriodTypeId.cs b/src/enums/AdjustmentPeriodTypeId.cs index 9e1edd68..9fd791a2 100644 --- a/src/enums/AdjustmentPeriodTypeId.cs +++ b/src/enums/AdjustmentPeriodTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AdjustmentReason.cs b/src/enums/AdjustmentReason.cs index 8552a33f..cb69dfde 100644 --- a/src/enums/AdjustmentReason.cs +++ b/src/enums/AdjustmentReason.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AdjustmentTypeId.cs b/src/enums/AdjustmentTypeId.cs index 1b8b5f9e..51db33cb 100644 --- a/src/enums/AdjustmentTypeId.cs +++ b/src/enums/AdjustmentTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ApiCallStatus.cs b/src/enums/ApiCallStatus.cs index b57c6fb2..214ead78 100644 --- a/src/enums/ApiCallStatus.cs +++ b/src/enums/ApiCallStatus.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/AuthenticationTypeId.cs b/src/enums/AuthenticationTypeId.cs index f9a327f8..5dc606c4 100644 --- a/src/enums/AuthenticationTypeId.cs +++ b/src/enums/AuthenticationTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/BatchStatus.cs b/src/enums/BatchStatus.cs index 7fd9f001..3804f982 100644 --- a/src/enums/BatchStatus.cs +++ b/src/enums/BatchStatus.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/BatchType.cs b/src/enums/BatchType.cs index 338858e2..096f95b8 100644 --- a/src/enums/BatchType.cs +++ b/src/enums/BatchType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/BoundaryLevel.cs b/src/enums/BoundaryLevel.cs index a2077430..f497dd0e 100644 --- a/src/enums/BoundaryLevel.cs +++ b/src/enums/BoundaryLevel.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/CertExpressInvitationStatus.cs b/src/enums/CertExpressInvitationStatus.cs index ba001d83..ba1c1ef2 100644 --- a/src/enums/CertExpressInvitationStatus.cs +++ b/src/enums/CertExpressInvitationStatus.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/CertificatePreviewType.cs b/src/enums/CertificatePreviewType.cs index f719384d..d39d94ad 100644 --- a/src/enums/CertificatePreviewType.cs +++ b/src/enums/CertificatePreviewType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/CertificateRequestDeliveryMethod.cs b/src/enums/CertificateRequestDeliveryMethod.cs index c0646776..20c3090c 100644 --- a/src/enums/CertificateRequestDeliveryMethod.cs +++ b/src/enums/CertificateRequestDeliveryMethod.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/CommentType.cs b/src/enums/CommentType.cs index 9ef5872d..5fc1b15d 100644 --- a/src/enums/CommentType.cs +++ b/src/enums/CommentType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/CompanyAccessLevel.cs b/src/enums/CompanyAccessLevel.cs index 499897b2..f31c5b54 100644 --- a/src/enums/CompanyAccessLevel.cs +++ b/src/enums/CompanyAccessLevel.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/CompanyFilingStatus.cs b/src/enums/CompanyFilingStatus.cs index 2cfb1b20..67210a7b 100644 --- a/src/enums/CompanyFilingStatus.cs +++ b/src/enums/CompanyFilingStatus.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/DocumentStatus.cs b/src/enums/DocumentStatus.cs index b450cce5..b2512686 100644 --- a/src/enums/DocumentStatus.cs +++ b/src/enums/DocumentStatus.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/DocumentType.cs b/src/enums/DocumentType.cs index 69c68e75..04327451 100644 --- a/src/enums/DocumentType.cs +++ b/src/enums/DocumentType.cs @@ -10,67 +10,145 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient { /// - /// Document Types + /// Represents the different types of transactions that AvaTax can process. /// public enum DocumentType { /// - /// Sales Order, estimate or quote (default). This is a temporary document type and is not saved in tax history. + /// Represents an estimate, or a sales order, or a quote. + /// + /// This document type is used before a sale has occurred to estimate the final amount of tax to be paid when the + /// sale is completed. + /// + /// For a sales order, the `companyCode` of the transaction refers to the seller and the `customerVendorCode` refers to the buyer. + /// + /// This is a temporary document type and is not saved in tax history. /// SalesOrder, /// - /// Sales Invoice + /// Represents a sale that has been finalized. + /// + /// This document type is used to record a final transaction and calculate the final tax amount with all necessary information. + /// + /// For a sales invoice, the `companyCode` of the transaction refers to the seller and the `customerVendorCode` refers to the buyer. + /// + /// This is a permanent document and is recorded in AvaTax. /// SalesInvoice, /// - /// Purchase order, estimate, or quote. This is a temporary document type and is not saved in tax history. + /// Represents an estimate, or a purchase order, or a quote. + /// + /// This document type is used before a sale has occurred to estimate the final amount of tax to be paid when the + /// sale is completed. + /// + /// For a purchase order, the `companyCode` of the transaction refers to the buyer and the `customerVendorCode` refers to the seller. + /// + /// This is a temporary document type and is not saved in tax history. /// PurchaseOrder, /// - /// Purchase Invoice + /// Represents a sale that has been finalized. + /// + /// This document type is used to record a final transaction and calculate the final tax amount with all necessary information. + /// + /// For a purchase invoice, the `companyCode` of the transaction refers to the buyer and the `customerVendorCode` refers to the seller. + /// + /// This is a permanent document and is recorded in AvaTax. /// PurchaseInvoice, /// - /// Sales Return Order. This is a temporary document type and is not saved in tax history. + /// Represents an estimate of tax to be refunded if a refund or return is processed. + /// + /// This document type is used before a customer chooses to request a refund for a previous sale, and it + /// estimates the final amount of tax to be refunded when the refund is completed. + /// + /// For a return order, the `companyCode` of the transaction refers to the seller who is giving the refund + /// and the `customerVendorCode` refers to the buyer who is requesting the refund. + /// + /// This is a temporary document type and is not saved in tax history. /// ReturnOrder, /// - /// Sales Return Invoice + /// Represents an refund that has been finalized. + /// + /// This document type is used when a customer chooses to request a refund for a previous sale, and it + /// records the final amount of tax that has been refunded when the refund is completed. + /// + /// For a return invoice, the `companyCode` of the transaction refers to the seller who is giving the refund + /// and the `customerVendorCode` refers to the buyer who is requesting the refund. + /// + /// This is a permanent document and is recorded in AvaTax. + /// + /// Please note that many jurisdictions around the United States have special rules about how to report refunds + /// on a sales tax filing, and some refund transactions may be unable to file immediately due to credit netting + /// rules. /// ReturnInvoice, /// - /// InventoryTransferOrder + /// Represents a proposed movement of inventory from one jurisdiction to another. + /// + /// This document type is used when physical goods are shipped from one jurisdiction to another, and it + /// may cause updates in the tax liability for various jurisdictions. + /// + /// For an inventory transfer invoice, the `companyCode` of the transaction refers to the owner of the inventory + /// that will be moved from one location to another. + /// + /// This is a temporary document type and is not saved in tax history. /// InventoryTransferOrder, /// - /// InventoryTransferInvoice + /// Represents a movement of inventory from one jurisdiction to another that has been finalized. + /// + /// This document type is used when physical goods are shipped from one jurisdiction to another, and it + /// may cause updates in the tax liability for various jurisdictions. + /// + /// For an inventory transfer invoice, the `companyCode` of the transaction refers to the owner of the inventory + /// that will be moved from one location to another. + /// + /// This is a permanent document and is recorded in AvaTax. /// InventoryTransferInvoice, /// - /// ReverseChargeOrder + /// Represents a VAT "Reverse Charge" mechanism transaction as defined in the European Union. + /// + /// A Reverse Charge transaction moves the responsibility for VAT reporting from the seller to the buyer, and + /// is intended to allow simplification of commerce and reduce the reporting requirements for sellers that deliver + /// goods and services into the single market. + /// + /// This is a temporary document type and is not saved in tax history. /// ReverseChargeOrder, /// - /// ReverseChargeInvoice + /// Represents a VAT "Reverse Charge" mechanism transaction as defined in the European Union. + /// + /// A Reverse Charge transaction moves the responsibility for VAT reporting from the seller to the buyer, and + /// is intended to allow simplification of commerce and reduce the reporting requirements for sellers that deliver + /// goods and services into the single market. + /// + /// This is a permanent document and is recorded in AvaTax. /// ReverseChargeInvoice, /// - /// No particular type + /// Not a real document type. + /// + /// This value is used when querying for documents. You can specify the type `Any` in some cases to permit the + /// system to find any document matching other criteria. /// Any, diff --git a/src/enums/ErrorCodeId.cs b/src/enums/ErrorCodeId.cs index 56d3c51a..adcea99d 100644 --- a/src/enums/ErrorCodeId.cs +++ b/src/enums/ErrorCodeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -79,6 +80,11 @@ public enum ErrorCodeId /// StringLengthError, + /// + /// + /// + MaxStringLengthError, + /// /// /// @@ -589,6 +595,26 @@ public enum ErrorCodeId /// FailedToDownloadReport, + /// + /// + /// + MalformedFilterException, + + /// + /// + /// + ExpectedConjunctionError, + + /// + /// + /// + CriteriaNotSupportedError, + + /// + /// + /// + CompanyAccountAndParentAccountMismatch, + /// /// Batch errors /// @@ -619,6 +645,16 @@ public enum ErrorCodeId /// BatchCannotDeleteBatchFile, + /// + /// + /// + BatchMustContainOneFile, + + /// + /// + /// + MissingBatchFileContent, + /// /// Point Of Sale API exceptions /// @@ -724,6 +760,11 @@ public enum ErrorCodeId /// InvalidAddress, + /// + /// + /// + InvalidPostalCode, + /// /// Represents a malformed document fetch command /// @@ -819,6 +860,11 @@ public enum ErrorCodeId /// RefundPercentageOutOfRange, + /// + /// + /// + RefundPercentageMissing, + /// /// Free API error codes /// @@ -955,20 +1001,65 @@ public enum ErrorCodeId InvalidCoverLetterTitle, /// - /// Multi company error codes + /// Multi document error codes /// TransactionNotCancelled, /// /// /// - TooManyTransactionLines, + TooManyTransactions, /// /// /// OnlyTaxDateOverrideIsAllowed, + /// + /// + /// + TransactionAlreadyExists, + + /// + /// + /// + DateMismatch, + + /// + /// + /// + InvalidDocumentStatusForVerify, + + /// + /// + /// + TotalAmountMismatch, + + /// + /// + /// + TotalTaxMismatch, + + /// + /// + /// + InvalidDocumentStatusForCommit, + + /// + /// + /// + InvalidDocumentType, + + /// + /// + /// + MultiDocumentPartiallyLocked, + + /// + /// + /// + TransactionIsCommitted, + /// /// Communications Tax error codes /// @@ -994,5 +1085,10 @@ public enum ErrorCodeId /// AccountInNewStatusException, + /// + /// Worksheet Exception + /// + WorksheetException, + } } diff --git a/src/enums/ExemptCertReviewStatusId.cs b/src/enums/ExemptCertReviewStatusId.cs index f8c774b1..24df09d7 100644 --- a/src/enums/ExemptCertReviewStatusId.cs +++ b/src/enums/ExemptCertReviewStatusId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ExemptCertStatusId.cs b/src/enums/ExemptCertStatusId.cs index d44b7b19..c5925946 100644 --- a/src/enums/ExemptCertStatusId.cs +++ b/src/enums/ExemptCertStatusId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ExemptCertTypeId.cs b/src/enums/ExemptCertTypeId.cs index 582fff60..15f63c6d 100644 --- a/src/enums/ExemptCertTypeId.cs +++ b/src/enums/ExemptCertTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/FilingFrequencyId.cs b/src/enums/FilingFrequencyId.cs index 0c8096ae..d5349807 100644 --- a/src/enums/FilingFrequencyId.cs +++ b/src/enums/FilingFrequencyId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/FilingRequestStatus.cs b/src/enums/FilingRequestStatus.cs index 1b168daf..6a29da4f 100644 --- a/src/enums/FilingRequestStatus.cs +++ b/src/enums/FilingRequestStatus.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/FilingStatusId.cs b/src/enums/FilingStatusId.cs index 19f0b609..d4b35ba4 100644 --- a/src/enums/FilingStatusId.cs +++ b/src/enums/FilingStatusId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/FilingTypeId.cs b/src/enums/FilingTypeId.cs index 1982c6e8..b841435c 100644 --- a/src/enums/FilingTypeId.cs +++ b/src/enums/FilingTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/FundingOption.cs b/src/enums/FundingOption.cs index 3cd04eeb..379ebf35 100644 --- a/src/enums/FundingOption.cs +++ b/src/enums/FundingOption.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/JurisTypeId.cs b/src/enums/JurisTypeId.cs index 4fd516c4..101bfa17 100644 --- a/src/enums/JurisTypeId.cs +++ b/src/enums/JurisTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/JurisdictionType.cs b/src/enums/JurisdictionType.cs index 9b0ee991..8b98b27b 100644 --- a/src/enums/JurisdictionType.cs +++ b/src/enums/JurisdictionType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/LocalNexusTypeId.cs b/src/enums/LocalNexusTypeId.cs index f5cac4e7..75f39732 100644 --- a/src/enums/LocalNexusTypeId.cs +++ b/src/enums/LocalNexusTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/MatchingTaxType.cs b/src/enums/MatchingTaxType.cs index cd76ef99..e0d813ef 100644 --- a/src/enums/MatchingTaxType.cs +++ b/src/enums/MatchingTaxType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/NexusTypeId.cs b/src/enums/NexusTypeId.cs index 8e1aa3f4..66072656 100644 --- a/src/enums/NexusTypeId.cs +++ b/src/enums/NexusTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/NoticeCustomerType.cs b/src/enums/NoticeCustomerType.cs index bb5dbf35..ec43120e 100644 --- a/src/enums/NoticeCustomerType.cs +++ b/src/enums/NoticeCustomerType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/NoticePriorityId.cs b/src/enums/NoticePriorityId.cs index cfa98eed..71e7253c 100644 --- a/src/enums/NoticePriorityId.cs +++ b/src/enums/NoticePriorityId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/OutletTypeId.cs b/src/enums/OutletTypeId.cs index c6c3a561..dc04ca46 100644 --- a/src/enums/OutletTypeId.cs +++ b/src/enums/OutletTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ParameterBagDataType.cs b/src/enums/ParameterBagDataType.cs index 93c40277..c416cf69 100644 --- a/src/enums/ParameterBagDataType.cs +++ b/src/enums/ParameterBagDataType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/PasswordStatusId.cs b/src/enums/PasswordStatusId.cs index d459c452..d1d556a7 100644 --- a/src/enums/PasswordStatusId.cs +++ b/src/enums/PasswordStatusId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/PaymentAccountTypeId.cs b/src/enums/PaymentAccountTypeId.cs index 84e7e232..b69baf2a 100644 --- a/src/enums/PaymentAccountTypeId.cs +++ b/src/enums/PaymentAccountTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/PaymentType.cs b/src/enums/PaymentType.cs index 35f5f9d3..71974d55 100644 --- a/src/enums/PaymentType.cs +++ b/src/enums/PaymentType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/PointOfSaleFileType.cs b/src/enums/PointOfSaleFileType.cs index e1708d2d..e1f05a62 100644 --- a/src/enums/PointOfSaleFileType.cs +++ b/src/enums/PointOfSaleFileType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/PointOfSalePartnerId.cs b/src/enums/PointOfSalePartnerId.cs index 3bb3420c..afb26aa6 100644 --- a/src/enums/PointOfSalePartnerId.cs +++ b/src/enums/PointOfSalePartnerId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/RateType.cs b/src/enums/RateType.cs index 09c4dd6f..41ceef75 100644 --- a/src/enums/RateType.cs +++ b/src/enums/RateType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/RefundType.cs b/src/enums/RefundType.cs index e956c185..aba071ac 100644 --- a/src/enums/RefundType.cs +++ b/src/enums/RefundType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ReportDateFilter.cs b/src/enums/ReportDateFilter.cs index 560089d2..c033a90a 100644 --- a/src/enums/ReportDateFilter.cs +++ b/src/enums/ReportDateFilter.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ReportDocType.cs b/src/enums/ReportDocType.cs index 7d3c6ff9..2e718b4f 100644 --- a/src/enums/ReportDocType.cs +++ b/src/enums/ReportDocType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ReportFormat.cs b/src/enums/ReportFormat.cs index 2a73493e..ffca6ee0 100644 --- a/src/enums/ReportFormat.cs +++ b/src/enums/ReportFormat.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ResolutionQuality.cs b/src/enums/ResolutionQuality.cs index f373dc14..249cec0c 100644 --- a/src/enums/ResolutionQuality.cs +++ b/src/enums/ResolutionQuality.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/RoundingLevelId.cs b/src/enums/RoundingLevelId.cs index 97c5aec3..e46ff7b2 100644 --- a/src/enums/RoundingLevelId.cs +++ b/src/enums/RoundingLevelId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ScraperType.cs b/src/enums/ScraperType.cs index 9c648aee..32d6f746 100644 --- a/src/enums/ScraperType.cs +++ b/src/enums/ScraperType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/SecurityRoleId.cs b/src/enums/SecurityRoleId.cs index 496ce55a..08355271 100644 --- a/src/enums/SecurityRoleId.cs +++ b/src/enums/SecurityRoleId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ServiceMode.cs b/src/enums/ServiceMode.cs index 62e4fc63..6391ed17 100644 --- a/src/enums/ServiceMode.cs +++ b/src/enums/ServiceMode.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/ServiceTypeId.cs b/src/enums/ServiceTypeId.cs index 0879ecf1..f7f2089d 100644 --- a/src/enums/ServiceTypeId.cs +++ b/src/enums/ServiceTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/SeverityLevel.cs b/src/enums/SeverityLevel.cs index cae5e96d..0049bdd5 100644 --- a/src/enums/SeverityLevel.cs +++ b/src/enums/SeverityLevel.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/Sourcing.cs b/src/enums/Sourcing.cs index 71f4dc43..4b5d0eaa 100644 --- a/src/enums/Sourcing.cs +++ b/src/enums/Sourcing.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TaxDebugLevel.cs b/src/enums/TaxDebugLevel.cs index 90941a77..606d8b11 100644 --- a/src/enums/TaxDebugLevel.cs +++ b/src/enums/TaxDebugLevel.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TaxDependencyLevelId.cs b/src/enums/TaxDependencyLevelId.cs index 8cc81c97..92d4083a 100644 --- a/src/enums/TaxDependencyLevelId.cs +++ b/src/enums/TaxDependencyLevelId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TaxOverrideType.cs b/src/enums/TaxOverrideType.cs index 8926c386..d7790587 100644 --- a/src/enums/TaxOverrideType.cs +++ b/src/enums/TaxOverrideType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TaxOverrideTypeId.cs b/src/enums/TaxOverrideTypeId.cs index 09d1002a..6bd27d12 100644 --- a/src/enums/TaxOverrideTypeId.cs +++ b/src/enums/TaxOverrideTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TaxRuleTypeId.cs b/src/enums/TaxRuleTypeId.cs index f7b68869..1659596b 100644 --- a/src/enums/TaxRuleTypeId.cs +++ b/src/enums/TaxRuleTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TaxType.cs b/src/enums/TaxType.cs index 11279981..48885b6f 100644 --- a/src/enums/TaxType.cs +++ b/src/enums/TaxType.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/TextCase.cs b/src/enums/TextCase.cs index 3045de83..3bbef6f6 100644 --- a/src/enums/TextCase.cs +++ b/src/enums/TextCase.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/VoidReasonCode.cs b/src/enums/VoidReasonCode.cs index cb91ccb7..601c4558 100644 --- a/src/enums/VoidReasonCode.cs +++ b/src/enums/VoidReasonCode.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/WelcomeEmail.cs b/src/enums/WelcomeEmail.cs index 8af9af0a..495a8776 100644 --- a/src/enums/WelcomeEmail.cs +++ b/src/enums/WelcomeEmail.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/enums/WorksheetTypeId.cs b/src/enums/WorksheetTypeId.cs index eb8b61b8..f1be2bc2 100644 --- a/src/enums/WorksheetTypeId.cs +++ b/src/enums/WorksheetTypeId.cs @@ -10,6 +10,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AccountConfigurationModel.cs b/src/models/AccountConfigurationModel.cs index 7072583b..a7f6d8c7 100644 --- a/src/models/AccountConfigurationModel.cs +++ b/src/models/AccountConfigurationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AccountModel.cs b/src/models/AccountModel.cs index 92b58ea2..d7440000 100644 --- a/src/models/AccountModel.cs +++ b/src/models/AccountModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ActivateAccountModel.cs b/src/models/ActivateAccountModel.cs index 393ccbde..179eea58 100644 --- a/src/models/ActivateAccountModel.cs +++ b/src/models/ActivateAccountModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AddTransactionLineModel.cs b/src/models/AddTransactionLineModel.cs index ace10065..115bd83f 100644 --- a/src/models/AddTransactionLineModel.cs +++ b/src/models/AddTransactionLineModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AddressInfo.cs b/src/models/AddressInfo.cs index bd7d4d05..ce90da1d 100644 --- a/src/models/AddressInfo.cs +++ b/src/models/AddressInfo.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -42,12 +43,27 @@ public class AddressInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/AddressLocationInfo.cs b/src/models/AddressLocationInfo.cs index 6e54e0a5..29238a41 100644 --- a/src/models/AddressLocationInfo.cs +++ b/src/models/AddressLocationInfo.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -48,12 +49,27 @@ public class AddressLocationInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/AddressResolutionModel.cs b/src/models/AddressResolutionModel.cs index 78297ca3..2a9c94bf 100644 --- a/src/models/AddressResolutionModel.cs +++ b/src/models/AddressResolutionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AddressValidationInfo.cs b/src/models/AddressValidationInfo.cs index a23ced7c..e6a52eb1 100644 --- a/src/models/AddressValidationInfo.cs +++ b/src/models/AddressValidationInfo.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -47,12 +48,27 @@ public class AddressValidationInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/AddressesModel.cs b/src/models/AddressesModel.cs index 15aedde4..f86083d0 100644 --- a/src/models/AddressesModel.cs +++ b/src/models/AddressesModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -27,6 +28,11 @@ namespace Avalara.AvaTax.RestClient /// /// In the United States, some jurisdictions recognize the address types `pointOfOrderOrigin` and `pointOfOrderAcceptance`. /// These address types affect the sourcing models of some transactions. + /// + /// If latitude and longitude information is provided for any of these addresses along with line, city, region, country and postal code information, + /// we will be using only latitude and longitude and will discard line, city, region, country and postal code information for the transaction. + /// Please ensure that you have the correct latitude/longitude information for the addresses prior to using the API. + /// If you provide either latitude or longitude information but not both, we will be using the line, city, region, country and postal code information for the addresses. /// public class AddressesModel { diff --git a/src/models/AdjustMultiDocumentModel.cs b/src/models/AdjustMultiDocumentModel.cs new file mode 100644 index 00000000..c6038114 --- /dev/null +++ b/src/models/AdjustMultiDocumentModel.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Replace an existing MultiDocument transaction recorded in AvaTax with a new one. + /// + public class AdjustMultiDocumentModel + { + /// + /// A reason code indicating why this adjustment was made + /// + public AdjustmentReason adjustmentReason { get; set; } + + /// + /// If the AdjustmentReason is "Other", specify the reason here. + /// + /// This is required when the AdjustmentReason is 8 (Other). + /// + public String adjustDescription { get; set; } + + /// + /// Replace the current MultiDocument transaction with tax data calculated for this new MultiDocument transaction + /// + public CreateMultiDocumentModel newTransaction { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/AdjustTransactionModel.cs b/src/models/AdjustTransactionModel.cs index 76c31939..deb33966 100644 --- a/src/models/AdjustTransactionModel.cs +++ b/src/models/AdjustTransactionModel.cs @@ -12,12 +12,13 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient { /// - /// A request to adjust tax for a previously existing transaction + /// Replace an existing transaction recorded in AvaTax with a new one. /// public class AdjustTransactionModel { diff --git a/src/models/ApproveFilingsModel.cs b/src/models/ApproveFilingsModel.cs index 3ccf595b..9400bbfe 100644 --- a/src/models/ApproveFilingsModel.cs +++ b/src/models/ApproveFilingsModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AuditMultiDocumentModel.cs b/src/models/AuditMultiDocumentModel.cs new file mode 100644 index 00000000..80efe380 --- /dev/null +++ b/src/models/AuditMultiDocumentModel.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Information about a previously created MultiDocument transaction + /// + public class AuditMultiDocumentModel + { + /// + /// Reconstructed API request/response pair that can be used to adjust or re-create this MultiDocument transaction. + /// + public ReconstructedMultiDocumentModel reconstructed { get; set; } + + /// + /// Represents the unique code of this MultiDocument transaction. + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public String code { get; set; } + + /// + /// Represents the document type of this MultiDocument transaction. For more information about + /// document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/). + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public DocumentType? type { get; set; } + + /// + /// Server timestamp, in UTC, of the date/time when the original transaction was created + /// + public DateTime? serverTimestamp { get; set; } + + /// + /// Length of time the original API call took + /// + public DateTime? serverDuration { get; set; } + + /// + /// api call status + /// + public ApiCallStatus? apiCallStatus { get; set; } + + /// + /// Original API request/response + /// + public OriginalApiRequestResponseModel original { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/AuditTransactionModel.cs b/src/models/AuditTransactionModel.cs index 481dfc98..97018bca 100644 --- a/src/models/AuditTransactionModel.cs +++ b/src/models/AuditTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -26,6 +27,11 @@ public class AuditTransactionModel /// public Int32? companyId { get; set; } + /// + /// Reconstructed API request/response + /// + public ReconstructedApiRequestResponseModel reconstructed { get; set; } + /// /// Server timestamp, in UTC, of the date/time when the original transaction was created /// @@ -46,11 +52,6 @@ public class AuditTransactionModel /// public OriginalApiRequestResponseModel original { get; set; } - /// - /// Reconstructed API request/response - /// - public ReconstructedApiRequestResponseModel reconstructed { get; set; } - /// /// Convert this object to a JSON string of itself diff --git a/src/models/AvaFileFormModel.cs b/src/models/AvaFileFormModel.cs index a27c15fd..50a03e6e 100644 --- a/src/models/AvaFileFormModel.cs +++ b/src/models/AvaFileFormModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AvaTaxMessage.cs b/src/models/AvaTaxMessage.cs index 13013c2b..af2d05b0 100644 --- a/src/models/AvaTaxMessage.cs +++ b/src/models/AvaTaxMessage.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/BatchFileModel.cs b/src/models/BatchFileModel.cs index 1f7ab7c7..a655dbea 100644 --- a/src/models/BatchFileModel.cs +++ b/src/models/BatchFileModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/BatchModel.cs b/src/models/BatchModel.cs index 2f3b794e..3b856122 100644 --- a/src/models/BatchModel.cs +++ b/src/models/BatchModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/BulkLockTransactionModel.cs b/src/models/BulkLockTransactionModel.cs index 6fb1b21c..0b9204c3 100644 --- a/src/models/BulkLockTransactionModel.cs +++ b/src/models/BulkLockTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/BulkLockTransactionResult.cs b/src/models/BulkLockTransactionResult.cs index b062e40f..8ab8416d 100644 --- a/src/models/BulkLockTransactionResult.cs +++ b/src/models/BulkLockTransactionResult.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CertExpressInvitationModel.cs b/src/models/CertExpressInvitationModel.cs index d6ce4f4d..b598f8c8 100644 --- a/src/models/CertExpressInvitationModel.cs +++ b/src/models/CertExpressInvitationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CertExpressInvitationStatusModel.cs b/src/models/CertExpressInvitationStatusModel.cs index 295fc887..31c939d9 100644 --- a/src/models/CertExpressInvitationStatusModel.cs +++ b/src/models/CertExpressInvitationStatusModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CertificateAttributeModel.cs b/src/models/CertificateAttributeModel.cs index d9f26a8c..7a172aac 100644 --- a/src/models/CertificateAttributeModel.cs +++ b/src/models/CertificateAttributeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CertificateModel.cs b/src/models/CertificateModel.cs index ba489693..15951037 100644 --- a/src/models/CertificateModel.cs +++ b/src/models/CertificateModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ChangeTransactionCodeModel.cs b/src/models/ChangeTransactionCodeModel.cs index bbc8f7f0..25805487 100644 --- a/src/models/ChangeTransactionCodeModel.cs +++ b/src/models/ChangeTransactionCodeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CommitMultiDocumentModel.cs b/src/models/CommitMultiDocumentModel.cs new file mode 100644 index 00000000..a078ea09 --- /dev/null +++ b/src/models/CommitMultiDocumentModel.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Commit this MultiDocument object so that all transactions within it can be reported on a tax filing. + /// + public class CommitMultiDocumentModel + { + /// + /// Represents the unique code of this MultiDocument transaction. + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. /// + /// + public String code { get; set; } + + /// + /// Represents the document type of this MultiDocument transaction. For more information about + /// document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/). + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public DocumentType? type { get; set; } + + /// + /// Set this value to be `true` to commit this transaction. + /// + /// Committing a transaction allows it to be reported on a tax filing. Uncommitted transactions will not be reported. + /// + public Boolean commit { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/CommitTransactionModel.cs b/src/models/CommitTransactionModel.cs index dfd50753..98c2eac2 100644 --- a/src/models/CommitTransactionModel.cs +++ b/src/models/CommitTransactionModel.cs @@ -12,18 +12,20 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient { /// - /// Commit this transaction as permanent + /// Commit this transaction as permanent so that it can be reported on a tax filing. /// public class CommitTransactionModel { /// - /// Set this value to be true to commit this transaction. - /// Committing a transaction allows it to be reported on a tax return. Uncommitted transactions will not be reported. + /// Set this value to be `true` to commit this transaction. + /// + /// Committing a transaction allows it to be reported on a tax filing. Uncommitted transactions will not be reported. /// public Boolean commit { get; set; } diff --git a/src/models/CommunicationsTSPairModel.cs b/src/models/CommunicationsTSPairModel.cs index b4303bdc..476531cb 100644 --- a/src/models/CommunicationsTSPairModel.cs +++ b/src/models/CommunicationsTSPairModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CommunicationsTransactionTypeModel.cs b/src/models/CommunicationsTransactionTypeModel.cs index 1b5061c3..afa5a50e 100644 --- a/src/models/CommunicationsTransactionTypeModel.cs +++ b/src/models/CommunicationsTransactionTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CompanyAddress.cs b/src/models/CompanyAddress.cs index 0401ff4b..823f220b 100644 --- a/src/models/CompanyAddress.cs +++ b/src/models/CompanyAddress.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -32,12 +33,27 @@ public class CompanyAddress public String city { get; set; } /// - /// Two character ISO 3166 Region code for this company's primary business location. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country code for this company's primary business location. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/CompanyConfigurationModel.cs b/src/models/CompanyConfigurationModel.cs index 2cbef48b..e3f3764a 100644 --- a/src/models/CompanyConfigurationModel.cs +++ b/src/models/CompanyConfigurationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CompanyInitializationModel.cs b/src/models/CompanyInitializationModel.cs index ecc4f746..5c5ad6f9 100644 --- a/src/models/CompanyInitializationModel.cs +++ b/src/models/CompanyInitializationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -65,7 +66,14 @@ public class CompanyInitializationModel public String city { get; set; } /// - /// Two character ISO 3166 Region code for this company's primary business location. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -75,7 +83,15 @@ public class CompanyInitializationModel public String postalCode { get; set; } /// - /// Two character ISO 3166 Country code for this company's primary business location. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/CompanyModel.cs b/src/models/CompanyModel.cs index 97b1bf12..03ac94da 100644 --- a/src/models/CompanyModel.cs +++ b/src/models/CompanyModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ContactModel.cs b/src/models/ContactModel.cs index fcf958a4..3b72c80c 100644 --- a/src/models/ContactModel.cs +++ b/src/models/ContactModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -77,7 +78,14 @@ public class ContactModel public String city { get; set; } /// - /// The state, region, or province of the postal mailing address of this contact. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -87,7 +95,15 @@ public class ContactModel public String postalCode { get; set; } /// - /// The ISO 3166 two-character country code of the postal mailing address of this contact. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/CoordinateInfo.cs b/src/models/CoordinateInfo.cs index a3b108ff..bceb4878 100644 --- a/src/models/CoordinateInfo.cs +++ b/src/models/CoordinateInfo.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CoverLetterModel.cs b/src/models/CoverLetterModel.cs index d4056ffd..f09c9145 100644 --- a/src/models/CoverLetterModel.cs +++ b/src/models/CoverLetterModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CreateCertExpressInvitationModel.cs b/src/models/CreateCertExpressInvitationModel.cs index 11825b75..ceb514b6 100644 --- a/src/models/CreateCertExpressInvitationModel.cs +++ b/src/models/CreateCertExpressInvitationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CreateMultiDocumentModel.cs b/src/models/CreateMultiDocumentModel.cs new file mode 100644 index 00000000..e91b7b27 --- /dev/null +++ b/src/models/CreateMultiDocumentModel.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// A MultiDocument transaction represents a sale or purchase that occurred between more than two companies. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + public class CreateMultiDocumentModel + { + /// + /// The transaction code of the MultiDocument transaction. + /// + /// All individual transactions within this MultiDocument object will have this code as a prefix. + /// + /// If you leave the `code` field blank, a GUID will be assigned. + /// + public String code { get; set; } + + /// + /// Lines that will appear on the invoice. + /// + /// For a MultiDocument transaction, each line may represent a different company or reporting location code. AvaTax + /// will separate this MultiDocument transaction object into many different transactions, one for each pair of legal + /// entities, so that each legal entity can file their transactional taxes correctly. + /// + public List lines { get; set; } + + /// + /// Set this value to true to allow this API call to adjust the MultiDocument model if one already exists. + /// + /// If you omit this field, or if the value is `null`, you will receive an error if you try to create two MultiDocument + /// objects with the same `code`. + /// + public Boolean? allowAdjust { get; set; } + + /// + /// Specifies the type of document to create. A document type ending with `Invoice` is a permanent transaction + /// that will be recorded in AvaTax. A document type ending with `Order` is a temporary estimate that will not + /// be preserved. + /// + /// If you omit this value, the API will assume you want to create a `SalesOrder`. + /// + public DocumentType? type { get; set; } + + /// + /// Company Code - Specify the code of the company creating this transaction here. If you leave this value null, + /// your account's default company will be used instead. + /// + public String companyCode { get; set; } + + /// + /// Transaction Date - The date on the invoice, purchase order, etc. + /// + /// By default, this date will be used to calculate the tax rates for the transaction. If you wish to use a + /// different date to calculate tax rates, please specify a `taxOverride` of type `taxDate`. + /// + public DateTime date { get; set; } + + /// + /// Salesperson Code - The client application salesperson reference code. + /// + public String salespersonCode { get; set; } + + /// + /// Customer Code - The client application customer reference code. + /// + public String customerCode { get; set; } + + /// + /// DEPRECATED - Customer Usage Type - The client application customer or usage type. For a list of + /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// Please use entityUseCode instead. + /// + public String customerUsageType { get; set; } + + /// + /// Entity Use Code - The client application customer or usage type. For a list of + /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// + public String entityUseCode { get; set; } + + /// + /// Discount - The discount amount to apply to the document. This value will be applied only to lines + /// that have the `discounted` flag set to true. If no lines have `discounted` set to true, this discount + /// cannot be applied. + /// + public Decimal? discount { get; set; } + + /// + /// Purchase Order Number for this document. + /// + /// This is required for single use exemption certificates to match the order and invoice with the certificate. + /// + public String purchaseOrderNo { get; set; } + + /// + /// Exemption Number for this document. + /// + /// If you specify an exemption number for this document, this document will be considered exempt, and you + /// may be asked to provide proof of this exemption certificate in the event that you are asked by an auditor + /// to verify your exemptions. + /// + public String exemptionNo { get; set; } + + /// + /// Default addresses for all lines in this document. + /// + /// These addresses are the default values that will be used for any lines that do not have their own + /// address information. If you specify addresses for a line, then no default addresses will be loaded + /// for that line. + /// + public AddressesModel addresses { get; set; } + + /// + /// Special parameters for this transaction. + /// + /// To get a full list of available parameters, please use the `/api/v2/definitions/parameters` endpoint. + /// + public Dictionary parameters { get; set; } + + /// + /// Customer-provided Reference Code with information about this transaction. + /// + /// This field could be used to reference the original document for a return invoice, or for any other + /// reference purpose. + /// + public String referenceCode { get; set; } + + /// + /// Sets the sale location code (Outlet ID) for reporting this document to the tax authority. + /// + /// This value is used by Avalara Managed Returns to group documents together by reporting locations + /// for tax authorities that require location-based reporting. + /// + public String reportingLocationCode { get; set; } + + /// + /// Causes the document to be committed if true. This option is only applicable for invoice document + /// types, not orders. + /// + public Boolean? commit { get; set; } + + /// + /// BatchCode for batch operations. + /// + public String batchCode { get; set; } + + /// + /// Specifies a tax override for the entire document + /// + public TaxOverrideModel taxOverride { get; set; } + + /// + /// The three-character ISO 4217 currency code for this transaction. + /// + public String currencyCode { get; set; } + + /// + /// Specifies whether the tax calculation is handled Local, Remote, or Automatic (default). This only + /// applies when using an AvaLocal server. + /// + public ServiceMode? serviceMode { get; set; } + + /// + /// Currency exchange rate from this transaction to the company base currency. + /// + /// This only needs to be set if the transaction currency is different than the company base currency. + /// It defaults to 1.0. + /// + public Decimal? exchangeRate { get; set; } + + /// + /// Effective date of the exchange rate. + /// + public DateTime? exchangeRateEffectiveDate { get; set; } + + /// + /// Sets the Point of Sale Lane Code sent by the User for this document. + /// + public String posLaneCode { get; set; } + + /// + /// VAT business identification number for the customer for this transaction. This number will be used for all lines + /// in the transaction, except for those lines where you have defined a different business identification number. + /// + /// If you specify a VAT business identification number for the customer in this transaction and you have also set up + /// a business identification number for your company during company setup, this transaction will be treated as a + /// business-to-business transaction for VAT purposes and it will be calculated according to VAT tax rules. + /// + public String businessIdentificationNo { get; set; } + + /// + /// Specifies if the Transaction has the seller as IsSellerImporterOfRecord. + /// + public Boolean? isSellerImporterOfRecord { get; set; } + + /// + /// User-supplied description for this transaction. + /// + public String description { get; set; } + + /// + /// User-supplied email address relevant for this transaction. + /// + public String email { get; set; } + + /// + /// If the user wishes to request additional debug information from this transaction, specify a level higher than `normal`. + /// + public TaxDebugLevel? debugLevel { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/CreateOrAdjustTransactionModel.cs b/src/models/CreateOrAdjustTransactionModel.cs index 51ca93a7..302e69b9 100644 --- a/src/models/CreateOrAdjustTransactionModel.cs +++ b/src/models/CreateOrAdjustTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CreateTransactionModel.cs b/src/models/CreateTransactionModel.cs index 0ada242a..525ee9d8 100644 --- a/src/models/CreateTransactionModel.cs +++ b/src/models/CreateTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -22,13 +23,13 @@ namespace Avalara.AvaTax.RestClient public class CreateTransactionModel { /// - /// Transaction Code - the internal reference code used by the client application. This is used for operations such as + /// The internal reference code used by the client application. This is used for operations such as /// Get, Adjust, Settle, and Void. If you leave the transaction code blank, a GUID will be assigned to each transaction. /// public String code { get; set; } /// - /// Document line items list + /// A list of line items that will appear on this transaction. /// public List lines { get; set; } @@ -66,11 +67,18 @@ public class CreateTransactionModel public String customerCode { get; set; } /// - /// Customer Usage Type - The client application customer or usage type. For a list of + /// DEPRECATED - Customer Usage Type - The client application customer or usage type. For a list of /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// Entity Use Code - The client application customer or usage type. For a list of + /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// + public String entityUseCode { get; set; } + /// /// Discount - The discount amount to apply to the document. This value will be applied only to lines /// that have the `discounted` flag set to true. If no lines have `discounted` set to true, this discount diff --git a/src/models/CustomerModel.cs b/src/models/CustomerModel.cs index 0d7ff0ed..584e02f1 100644 --- a/src/models/CustomerModel.cs +++ b/src/models/CustomerModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -112,12 +113,27 @@ public class CustomerModel public DateTime? modifiedDate { get; set; } /// - /// Two character ISO 3166 county code for the country component of the address of this customer. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// Two or three character ISO 3166 region, province, or state name of the address of this customer. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } diff --git a/src/models/CycleAddOptionModel.cs b/src/models/CycleAddOptionModel.cs index 2ba60b28..eddfde19 100644 --- a/src/models/CycleAddOptionModel.cs +++ b/src/models/CycleAddOptionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CycleEditOptionModel.cs b/src/models/CycleEditOptionModel.cs index 2b3acbc6..89cb4a53 100644 --- a/src/models/CycleEditOptionModel.cs +++ b/src/models/CycleEditOptionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CycleExpireModel.cs b/src/models/CycleExpireModel.cs index d627326f..af30eb2d 100644 --- a/src/models/CycleExpireModel.cs +++ b/src/models/CycleExpireModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CycleExpireOptionModel.cs b/src/models/CycleExpireOptionModel.cs index 4f10740a..999178c0 100644 --- a/src/models/CycleExpireOptionModel.cs +++ b/src/models/CycleExpireOptionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/EcmsDetailModel.cs b/src/models/EcmsDetailModel.cs index 09aeca20..46fd4a2d 100644 --- a/src/models/EcmsDetailModel.cs +++ b/src/models/EcmsDetailModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -37,7 +38,14 @@ public class EcmsDetailModel public String stateFips { get; set; } /// - /// Region or State + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -47,7 +55,15 @@ public class EcmsDetailModel public String idNo { get; set; } /// - /// Country that this exempt certificate is for + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/EcmsDetailTaxCodeModel.cs b/src/models/EcmsDetailTaxCodeModel.cs index f1f98e6a..0658cd29 100644 --- a/src/models/EcmsDetailTaxCodeModel.cs +++ b/src/models/EcmsDetailTaxCodeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/EcmsModel.cs b/src/models/EcmsModel.cs index 8695d7f0..b4bed6bb 100644 --- a/src/models/EcmsModel.cs +++ b/src/models/EcmsModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -62,7 +63,14 @@ public class EcmsModel public String city { get; set; } /// - /// Region + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -72,7 +80,15 @@ public class EcmsModel public String postalCode { get; set; } /// - /// Country + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } @@ -112,7 +128,9 @@ public class EcmsModel public DateTime? effectiveDate { get; set; } /// - /// Applicable regions for this exempt certificate + /// A list of applicable regions for this exempt certificate. + /// + /// To list more than one applicable region, separate the list of region codes with commas. /// public String regionsApplicable { get; set; } @@ -152,7 +170,15 @@ public class EcmsModel public Int32? modifiedUserId { get; set; } /// - /// Which country issued this exempt certificate + /// Name or ISO 3166 code identifying the country that issued this ECMS certificate. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String countryIssued { get; set; } diff --git a/src/models/EntityUseCodeModel.cs b/src/models/EntityUseCodeModel.cs index d85baf51..04c5ba4f 100644 --- a/src/models/EntityUseCodeModel.cs +++ b/src/models/EntityUseCodeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ErrorDetail.cs b/src/models/ErrorDetail.cs index dc0e9a67..048300a7 100644 --- a/src/models/ErrorDetail.cs +++ b/src/models/ErrorDetail.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ExemptionReasonModel.cs b/src/models/ExemptionReasonModel.cs index c77933d1..23b62d02 100644 --- a/src/models/ExemptionReasonModel.cs +++ b/src/models/ExemptionReasonModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ExemptionStatusModel.cs b/src/models/ExemptionStatusModel.cs index 71a56dc4..00a2b6b1 100644 --- a/src/models/ExemptionStatusModel.cs +++ b/src/models/ExemptionStatusModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ExportDocumentLineModel.cs b/src/models/ExportDocumentLineModel.cs index 81701af7..1fc973a8 100644 --- a/src/models/ExportDocumentLineModel.cs +++ b/src/models/ExportDocumentLineModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ExposureZoneModel.cs b/src/models/ExposureZoneModel.cs index 7a7a94c3..e2d28a2f 100644 --- a/src/models/ExposureZoneModel.cs +++ b/src/models/ExposureZoneModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingAdjustmentModel.cs b/src/models/FilingAdjustmentModel.cs index 56c739a0..93333505 100644 --- a/src/models/FilingAdjustmentModel.cs +++ b/src/models/FilingAdjustmentModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingAnswerModel.cs b/src/models/FilingAnswerModel.cs index a9fde172..8f3f3f3a 100644 --- a/src/models/FilingAnswerModel.cs +++ b/src/models/FilingAnswerModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingAugmentationModel.cs b/src/models/FilingAugmentationModel.cs index e181cf9a..753a8078 100644 --- a/src/models/FilingAugmentationModel.cs +++ b/src/models/FilingAugmentationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingCalendarEditModel.cs b/src/models/FilingCalendarEditModel.cs index da7ca4c7..a74d9823 100644 --- a/src/models/FilingCalendarEditModel.cs +++ b/src/models/FilingCalendarEditModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingCalendarModel.cs b/src/models/FilingCalendarModel.cs index c93cd13f..ebf37694 100644 --- a/src/models/FilingCalendarModel.cs +++ b/src/models/FilingCalendarModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -38,12 +39,27 @@ public class FilingCalendarModel public String returnName { get; set; } /// - /// The two character ISO 3166 country code of the country that issued the tax form for this filing calendar. + /// Name or ISO 3166 code identifying the country that issued the tax form for this filing calendar. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String formCountry { get; set; } /// - /// The two or three character ISO 3166 code of the region / state / province that issued the tax form for this filing calendar. + /// Name or ISO 3166 code identifying the region that issued the tax form for this filing calendar. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String formRegion { get; set; } @@ -152,7 +168,14 @@ public class FilingCalendarModel public String mailingAddressCity { get; set; } /// - /// The state, region, or province of the mailing address that will be used when filling out this tax return. + /// Name or ISO 3166 code identifying the region of the mailing address that will be used when filling out this tax return. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String mailingAddressRegion { get; set; } @@ -162,7 +185,15 @@ public class FilingCalendarModel public String mailingAddressPostalCode { get; set; } /// - /// The two character ISO-3166 country code of the mailing address that will be used when filling out this tax return. + /// Name or ISO 3166 code identifying the country of the mailing address that will be used when filling out this tax return. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String mailingAddressCountry { get; set; } diff --git a/src/models/FilingFrequencyModel.cs b/src/models/FilingFrequencyModel.cs index 9cb71819..345623e8 100644 --- a/src/models/FilingFrequencyModel.cs +++ b/src/models/FilingFrequencyModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingModel.cs b/src/models/FilingModel.cs index a777a6f5..c78c1ff5 100644 --- a/src/models/FilingModel.cs +++ b/src/models/FilingModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingPaymentModel.cs b/src/models/FilingPaymentModel.cs index b16ae1f4..05306b36 100644 --- a/src/models/FilingPaymentModel.cs +++ b/src/models/FilingPaymentModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingRegionModel.cs b/src/models/FilingRegionModel.cs index f127392a..72ff5c5f 100644 --- a/src/models/FilingRegionModel.cs +++ b/src/models/FilingRegionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingRequestDataModel.cs b/src/models/FilingRequestDataModel.cs index 968c3e69..0fc7c119 100644 --- a/src/models/FilingRequestDataModel.cs +++ b/src/models/FilingRequestDataModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingRequestModel.cs b/src/models/FilingRequestModel.cs index 22348123..1f8a9621 100644 --- a/src/models/FilingRequestModel.cs +++ b/src/models/FilingRequestModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingReturnModel.cs b/src/models/FilingReturnModel.cs index 5f60770f..fd6c64aa 100644 --- a/src/models/FilingReturnModel.cs +++ b/src/models/FilingReturnModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingReturnModelBasic.cs b/src/models/FilingReturnModelBasic.cs index 5242d6be..ddc7ffdc 100644 --- a/src/models/FilingReturnModelBasic.cs +++ b/src/models/FilingReturnModelBasic.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingStatusChangeModel.cs b/src/models/FilingStatusChangeModel.cs index 153e0953..be38bcc7 100644 --- a/src/models/FilingStatusChangeModel.cs +++ b/src/models/FilingStatusChangeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingsCheckupAuthorityModel.cs b/src/models/FilingsCheckupAuthorityModel.cs index ede096f2..aa7d8e5a 100644 --- a/src/models/FilingsCheckupAuthorityModel.cs +++ b/src/models/FilingsCheckupAuthorityModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingsCheckupModel.cs b/src/models/FilingsCheckupModel.cs index 82e27139..dfe51d56 100644 --- a/src/models/FilingsCheckupModel.cs +++ b/src/models/FilingsCheckupModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FilingsCheckupSuggestedFormModel.cs b/src/models/FilingsCheckupSuggestedFormModel.cs index 5ee9c3c5..46c37b90 100644 --- a/src/models/FilingsCheckupSuggestedFormModel.cs +++ b/src/models/FilingsCheckupSuggestedFormModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FreeTrialRequestModel.cs b/src/models/FreeTrialRequestModel.cs index f969d0ec..5cfc0ddc 100644 --- a/src/models/FreeTrialRequestModel.cs +++ b/src/models/FreeTrialRequestModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FundingConfigurationModel.cs b/src/models/FundingConfigurationModel.cs new file mode 100644 index 00000000..85dd7aee --- /dev/null +++ b/src/models/FundingConfigurationModel.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Status of an Avalara Managed Returns funding configuration for a company + /// + public class FundingConfigurationModel + { + /// + /// CompanyID + /// + public Int32? companyId { get; set; } + + /// + /// Domain + /// + public String systemType { get; set; } + + /// + /// Recipient + /// + public String currency { get; set; } + + /// + /// Sender + /// + public Boolean? isFundingSetup { get; set; } + + /// + /// DocumentKey + /// + public String fundingMethod { get; set; } + + /// + /// LastPolled + /// + public DateTime? lastUpdated { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/FundingESignMethodReturn.cs b/src/models/FundingESignMethodReturn.cs index e3594fb0..9ad8d608 100644 --- a/src/models/FundingESignMethodReturn.cs +++ b/src/models/FundingESignMethodReturn.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FundingInitiateModel.cs b/src/models/FundingInitiateModel.cs index d2bbd677..5cd060bc 100644 --- a/src/models/FundingInitiateModel.cs +++ b/src/models/FundingInitiateModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/FundingStatusModel.cs b/src/models/FundingStatusModel.cs index 3d08b8de..756adde7 100644 --- a/src/models/FundingStatusModel.cs +++ b/src/models/FundingStatusModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/IsoCountryModel.cs b/src/models/IsoCountryModel.cs index 797dc11f..02270784 100644 --- a/src/models/IsoCountryModel.cs +++ b/src/models/IsoCountryModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -27,7 +28,14 @@ public class IsoCountryModel public String code { get; set; } /// - /// The full name of this country as it is known in US English + /// The three character ISO 3166 country code + /// + public String alpha3Code { get; set; } + + /// + /// The full name of this country in uppercase. + /// + /// For names in proper or formal case, or for names in other languages, please examine the `localizedNames` element for an appropriate name. /// public String name { get; set; } @@ -36,6 +44,13 @@ public class IsoCountryModel /// public Boolean? isEuropeanUnion { get; set; } + /// + /// A list of localized names in a variety of languages. + /// + /// This list is maintained by the International Standards Organization. + /// + public List localizedNames { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/IsoLocalizedName.cs b/src/models/IsoLocalizedName.cs new file mode 100644 index 00000000..2a77e3e6 --- /dev/null +++ b/src/models/IsoLocalizedName.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Represents a language-specific localized name of a particular geographic entity such + /// as a country or a region. + /// + public class IsoLocalizedName + { + /// + /// The two-character alphanumeric code identifying the language in which this name is used. + /// + /// Note that languageAlpha2Code and language3AlphaCode refer to the same language. + /// + public String languageAlpha2Code { get; set; } + + /// + /// The three-character alphanumeric code identifying the language in which this name is used. + /// + /// Note that languageAlpha2Code and language3AlphaCode refer to the same language. + /// + public String languageAlpha3Code { get; set; } + + /// + /// The name of this geographic entity as known in this language. + /// + public String name { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/IsoRegionModel.cs b/src/models/IsoRegionModel.cs index 1fc5f1a6..8510ca5c 100644 --- a/src/models/IsoRegionModel.cs +++ b/src/models/IsoRegionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -32,7 +33,9 @@ public class IsoRegionModel public String code { get; set; } /// - /// The full name, using localized characters, for this region + /// The full name, using localized characters, for this region, in uppercase. + /// + /// For names in proper or formal case, or for names in other languages, please examine the `localizedNames` element for an appropriate name. /// public String name { get; set; } @@ -47,6 +50,13 @@ public class IsoRegionModel /// public Boolean? streamlinedSalesTax { get; set; } + /// + /// A list of localized names in a variety of languages. + /// + /// This list is maintained by the International Standards Organization. + /// + public List localizedNames { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/ItemModel.cs b/src/models/ItemModel.cs index 13122862..ed6eeb07 100644 --- a/src/models/ItemModel.cs +++ b/src/models/ItemModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/JurisdictionModel.cs b/src/models/JurisdictionModel.cs index 95207b52..23d832bb 100644 --- a/src/models/JurisdictionModel.cs +++ b/src/models/JurisdictionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -52,7 +53,14 @@ public class JurisdictionModel public String signatureCode { get; set; } /// - /// The state assigned code for this jurisdiction, if any. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -72,7 +80,15 @@ public class JurisdictionModel public String county { get; set; } /// - /// The Country name of this jurisdiction + /// Name or ISO 3166 code identifying the country of this jurisdiction. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/JurisdictionOverrideModel.cs b/src/models/JurisdictionOverrideModel.cs index b2651099..4ddb153a 100644 --- a/src/models/JurisdictionOverrideModel.cs +++ b/src/models/JurisdictionOverrideModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -50,12 +51,22 @@ public class JurisdictionOverrideModel public String city { get; set; } /// - /// The two or three character ISO region code of the region, state, or province affected by this override. + /// Name or ISO 3166 code identifying the region within the country to be affected by this override. + /// + /// Note that only United States addresses are affected by the jurisdiction override system. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// /// The two character ISO-3166 country code of the country affected by this override. + /// /// Note that only United States addresses are affected by the jurisdiction override system. /// public String country { get; set; } diff --git a/src/models/LicenseKeyModel.cs b/src/models/LicenseKeyModel.cs index 68f472d5..1396dabb 100644 --- a/src/models/LicenseKeyModel.cs +++ b/src/models/LicenseKeyModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LineItemModel.cs b/src/models/LineItemModel.cs index 412fe622..85043c39 100644 --- a/src/models/LineItemModel.cs +++ b/src/models/LineItemModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -54,10 +55,16 @@ public class LineItemModel public String taxCode { get; set; } /// - /// Customer Usage Type - The client application customer or usage type. + /// DEPERECATED - Customer Usage Type - The client application customer or usage type. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// Entity Use Code - The client application customer or usage type. + /// + public String entityUseCode { get; set; } + /// /// Item Code (SKU) /// @@ -74,7 +81,11 @@ public class LineItemModel public Boolean? discounted { get; set; } /// - /// Indicates if line has Tax Included; defaults to false + /// Indicates whether the `amount` for this line already includes tax. + /// + /// If this value is `true`, the final price of this line including tax will equal the value in `amount`. + /// + /// If this value is `null` or `false`, the final price will equal `amount` plus whatever taxes apply to this line. /// public Boolean? taxIncluded { get; set; } diff --git a/src/models/LinkCertificatesModel.cs b/src/models/LinkCertificatesModel.cs index 5bf5d0b3..9d513138 100644 --- a/src/models/LinkCertificatesModel.cs +++ b/src/models/LinkCertificatesModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LinkCustomersModel.cs b/src/models/LinkCustomersModel.cs index dcc23763..e352a08b 100644 --- a/src/models/LinkCustomersModel.cs +++ b/src/models/LinkCustomersModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LocationModel.cs b/src/models/LocationModel.cs index bb9ce5e7..78f6ec3e 100644 --- a/src/models/LocationModel.cs +++ b/src/models/LocationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -78,7 +79,14 @@ public class LocationModel public String county { get; set; } /// - /// The state, region, or province of the physical address of this location. + /// Name or ISO 3166 code identifying the region within the country of the physical address of this location. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -88,7 +96,15 @@ public class LocationModel public String postalCode { get; set; } /// - /// The two character ISO-3166 country code of the physical address of this location. + /// Name or ISO 3166 code identifying the country of the physical address of this location. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/LocationQuestionModel.cs b/src/models/LocationQuestionModel.cs index b33d1149..c2b47b22 100644 --- a/src/models/LocationQuestionModel.cs +++ b/src/models/LocationQuestionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LocationSettingModel.cs b/src/models/LocationSettingModel.cs index dce23c99..abf1f654 100644 --- a/src/models/LocationSettingModel.cs +++ b/src/models/LocationSettingModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LocationValidationModel.cs b/src/models/LocationValidationModel.cs index 9f51f85d..f2e795a5 100644 --- a/src/models/LocationValidationModel.cs +++ b/src/models/LocationValidationModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LockTransactionModel.cs b/src/models/LockTransactionModel.cs index d6a08c28..cfad59b8 100644 --- a/src/models/LockTransactionModel.cs +++ b/src/models/LockTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LoginVerificationInputModel.cs b/src/models/LoginVerificationInputModel.cs index c75cd92d..38073440 100644 --- a/src/models/LoginVerificationInputModel.cs +++ b/src/models/LoginVerificationInputModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LoginVerificationOutputModel.cs b/src/models/LoginVerificationOutputModel.cs index 9fef2fa5..783d5964 100644 --- a/src/models/LoginVerificationOutputModel.cs +++ b/src/models/LoginVerificationOutputModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/MrsCompanyModel.cs b/src/models/MrsCompanyModel.cs new file mode 100644 index 00000000..e268c090 --- /dev/null +++ b/src/models/MrsCompanyModel.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// A company and account + /// + public class MrsCompanyModel + { + /// + /// The unique ID number of this company. + /// + public Int32? companyId { get; set; } + + /// + /// The name of this company, as shown to customers. + /// + public String companyName { get; set; } + + /// + /// The unique ID number of the account this company belongs to. + /// + public Int32? accountId { get; set; } + + /// + /// The name of this account, as shown to customers. + /// + public String accountName { get; set; } + + /// + /// The taxpayer identification number for the company + /// + public String tin { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/MultiDocumentLineItemModel.cs b/src/models/MultiDocumentLineItemModel.cs new file mode 100644 index 00000000..eae3617c --- /dev/null +++ b/src/models/MultiDocumentLineItemModel.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Represents one line item in a MultiDocument transaction + /// + public class MultiDocumentLineItemModel + { + /// + /// Specify the code of the company for this line of transaction. + /// + /// If you leave this value null, the `companyCode` at the root level will be used instead. + /// + public String companyCode { get; set; } + + /// + /// Sets the sale location code (Outlet ID) for reporting this document to the tax authority. + /// + /// If you leave this value `null`, the `reportingLocationCode` at the root level will be used instead. + /// + public String reportingLocationCode { get; set; } + + /// + /// Line number within this document + /// + public String number { get; set; } + + /// + /// Quantity of items in this line + /// + public Decimal quantity { get; set; } + + /// + /// Total amount for this line + /// + public Decimal amount { get; set; } + + /// + /// The addresses to use for this transaction line. + /// + /// If you set this value to `null`, or if you omit this element from your API call, then instead the transaction + /// will use the `addresses` from the document level. + /// + /// If you specify any other value besides `null`, only addresses specified for this line will be used for this line. + /// + public AddressesModel addresses { get; set; } + + /// + /// Tax Code - System or Custom Tax Code. + /// + /// You can use your own tax code mapping or standard Avalara tax codes. For a full list of tax codes, see `ListTaxCodes`. + /// + public String taxCode { get; set; } + + /// + /// DEPERECATED - Customer Usage Type - The client application customer or usage type. + /// Please use entityUseCode instead. + /// + public String customerUsageType { get; set; } + + /// + /// Entity Use Code - The client application customer or usage type. + /// + public String entityUseCode { get; set; } + + /// + /// Item Code (SKU) + /// + public String itemCode { get; set; } + + /// + /// Exemption number for this line + /// + public String exemptionCode { get; set; } + + /// + /// True if the document discount should be applied to this line + /// + public Boolean? discounted { get; set; } + + /// + /// Indicates whether the `amount` for this line already includes tax. + /// + /// If this value is `true`, the final price of this line including tax will equal the value in `amount`. + /// + /// If this value is `null` or `false`, the final price will equal `amount` plus whatever taxes apply to this line. + /// + public Boolean? taxIncluded { get; set; } + + /// + /// Revenue Account + /// + public String revenueAccount { get; set; } + + /// + /// Reference 1 - Client specific reference field + /// + public String ref1 { get; set; } + + /// + /// Reference 2 - Client specific reference field + /// + public String ref2 { get; set; } + + /// + /// Item description. This is required for SST transactions if an unmapped ItemCode is used. + /// + public String description { get; set; } + + /// + /// VAT business identification number for the customer for this line item. If you leave this field empty, + /// this line item will use whatever business identification number you provided at the transaction level. + /// + /// If you specify a VAT business identification number for the customer in this transaction and you have also set up + /// a business identification number for your company during company setup, this transaction will be treated as a + /// business-to-business transaction for VAT purposes and it will be calculated according to VAT tax rules. + /// + public String businessIdentificationNo { get; set; } + + /// + /// Specifies a tax override for this line + /// + public TaxOverrideModel taxOverride { get; set; } + + /// + /// Special parameters that apply to this line within this transaction. + /// To get a full list of available parameters, please use the /api/v2/definitions/parameters endpoint. + /// + public Dictionary parameters { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/MultiDocumentModel.cs b/src/models/MultiDocumentModel.cs new file mode 100644 index 00000000..09636b47 --- /dev/null +++ b/src/models/MultiDocumentModel.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// A MultiDocument transaction represents a sale or purchase that occurred between more than two companies. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + public class MultiDocumentModel + { + /// + /// The unique ID number of this MultiDocument object. + /// + public Int64? id { get; set; } + + /// + /// The unique ID number of the AvaTax customer account that created this MultiDocument object. + /// + public Int32? accountId { get; set; } + + /// + /// The transaction code of the MultiDocument transaction. + /// + /// All individual transactions within this MultiDocument object will have this code as a prefix. + /// + public String code { get; set; } + + /// + /// Indicates the type of MultiDocument transaction. Common values are: + /// + /// * SalesOrder - An estimate that is not permanently recorded + /// * SalesInvoice - An invoice that can be reported on a tax return + /// + /// For more information about document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/) + /// + public DocumentType? type { get; set; } + + /// + /// The user ID of the user who created this record. + /// + public Int32? createdUserId { get; set; } + + /// + /// The date/time when this record was created. + /// + public DateTime? createdDate { get; set; } + + /// + /// The date/time when this record was last modified. + /// + public DateTime? modifiedDate { get; set; } + + /// + /// The user ID of the user who last modified this record. + /// + public Int32? modifiedUserId { get; set; } + + /// + /// A separate document will exist for each unique combination of buyer and seller in this MultiDocument transaction. + /// + public List documents { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/NewAccountModel.cs b/src/models/NewAccountModel.cs index 4bce358a..18fe08fa 100644 --- a/src/models/NewAccountModel.cs +++ b/src/models/NewAccountModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NewAccountRequestModel.cs b/src/models/NewAccountRequestModel.cs index be3e0ef2..b6e9eb41 100644 --- a/src/models/NewAccountRequestModel.cs +++ b/src/models/NewAccountRequestModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -93,6 +94,7 @@ public class NewAccountRequestModel /// /// Company code to be assigned to the company created for this account. + /// If no company code is provided, this will be defaulted to "DEFAULT" company code. /// public String companyCode { get; set; } diff --git a/src/models/NexusByTaxFormModel.cs b/src/models/NexusByTaxFormModel.cs index f3b971b9..2ed81070 100644 --- a/src/models/NexusByTaxFormModel.cs +++ b/src/models/NexusByTaxFormModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NexusModel.cs b/src/models/NexusModel.cs index 4f02ccdd..ddde451c 100644 --- a/src/models/NexusModel.cs +++ b/src/models/NexusModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -32,12 +33,29 @@ public class NexusModel public Int32 companyId { get; set; } /// - /// The two character ISO-3166 country code of the country in which this company declared nexus. + /// Name or ISO 3166 code identifying the country in which this company declared nexus. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// The two or three character ISO region code of the region, state, or province in which this company declared nexus. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// If the `jurisTypeId` field is set to `CNT` or `Country`, this field can be left blank. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -82,8 +100,18 @@ public class NexusModel public String stateAssignedNo { get; set; } /// - /// (DEPRECATED) The type of nexus that this company is declaring. - /// Please use NexusTaxTypeGroupId instead. + /// The type of nexus that this company is declaring. + /// + /// If you are voluntarily declaring nexus in a jurisdiction, you should select `SalesOrSellersUseTax` for your + /// nexus type option. This option allows you to calculate tax correctly whether you are selling in-state or + /// shipping from an out-of-state location. + /// + /// If you are legally obligated to declare nexus due to physical presence or other sufficient nexus, you + /// should select `SalesTax`. This indicates that, as a legal requirement, your company must always collect + /// and remit full sales tax in this jurisdiction. + /// + /// If you are participating in the Streamlined Sales Tax program, your SST administrator will select nexus + /// settings for you in all SST jurisdictions. Do not select any SST options by yourself. /// public NexusTypeId? nexusTypeId { get; set; } diff --git a/src/models/NexusTaxTypeGroupModel.cs b/src/models/NexusTaxTypeGroupModel.cs index 360588d6..229acf84 100644 --- a/src/models/NexusTaxTypeGroupModel.cs +++ b/src/models/NexusTaxTypeGroupModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeCommentModel.cs b/src/models/NoticeCommentModel.cs index ec037b51..314bee34 100644 --- a/src/models/NoticeCommentModel.cs +++ b/src/models/NoticeCommentModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeCustomerFundingOptionModel.cs b/src/models/NoticeCustomerFundingOptionModel.cs index 28970fa8..7e6b7600 100644 --- a/src/models/NoticeCustomerFundingOptionModel.cs +++ b/src/models/NoticeCustomerFundingOptionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeCustomerTypeModel.cs b/src/models/NoticeCustomerTypeModel.cs index 5162be7d..7acd7e96 100644 --- a/src/models/NoticeCustomerTypeModel.cs +++ b/src/models/NoticeCustomerTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeFilingTypeModel.cs b/src/models/NoticeFilingTypeModel.cs index 040c47b9..b0dbe2b9 100644 --- a/src/models/NoticeFilingTypeModel.cs +++ b/src/models/NoticeFilingTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeFinanceModel.cs b/src/models/NoticeFinanceModel.cs index dcaaeae2..d2a699a0 100644 --- a/src/models/NoticeFinanceModel.cs +++ b/src/models/NoticeFinanceModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeModel.cs b/src/models/NoticeModel.cs index 15e12575..11bfeea5 100644 --- a/src/models/NoticeModel.cs +++ b/src/models/NoticeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -64,12 +65,27 @@ public class NoticeModel public NoticeCustomerType customerTypeId { get; set; } /// - /// The country the notice is in + /// Name or ISO 3166 code identifying the country that sent this notice. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// The region the notice is for + /// Name or ISO 3166 code identifying the region within the country that sent this notice. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } diff --git a/src/models/NoticePriorityModel.cs b/src/models/NoticePriorityModel.cs index 13b13a97..a6ad0ce9 100644 --- a/src/models/NoticePriorityModel.cs +++ b/src/models/NoticePriorityModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeReasonModel.cs b/src/models/NoticeReasonModel.cs index a8903be5..fea27aa2 100644 --- a/src/models/NoticeReasonModel.cs +++ b/src/models/NoticeReasonModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeResponsibilityDetailModel.cs b/src/models/NoticeResponsibilityDetailModel.cs index 1b995f6d..6dcdbdbf 100644 --- a/src/models/NoticeResponsibilityDetailModel.cs +++ b/src/models/NoticeResponsibilityDetailModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeResponsibilityModel.cs b/src/models/NoticeResponsibilityModel.cs index c8423036..330a88bf 100644 --- a/src/models/NoticeResponsibilityModel.cs +++ b/src/models/NoticeResponsibilityModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeRootCauseDetailModel.cs b/src/models/NoticeRootCauseDetailModel.cs index b0170ae6..7ea0d0a4 100644 --- a/src/models/NoticeRootCauseDetailModel.cs +++ b/src/models/NoticeRootCauseDetailModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeRootCauseModel.cs b/src/models/NoticeRootCauseModel.cs index 2a832056..f153b5af 100644 --- a/src/models/NoticeRootCauseModel.cs +++ b/src/models/NoticeRootCauseModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeStatusModel.cs b/src/models/NoticeStatusModel.cs index f8f88bb3..50033e43 100644 --- a/src/models/NoticeStatusModel.cs +++ b/src/models/NoticeStatusModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NoticeTypeModel.cs b/src/models/NoticeTypeModel.cs index 4eb23f8e..e388c61e 100644 --- a/src/models/NoticeTypeModel.cs +++ b/src/models/NoticeTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/OriginalApiRequestResponseModel.cs b/src/models/OriginalApiRequestResponseModel.cs index 32adc3ef..1e589dbc 100644 --- a/src/models/OriginalApiRequestResponseModel.cs +++ b/src/models/OriginalApiRequestResponseModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ParameterModel.cs b/src/models/ParameterModel.cs index 7267dc0f..029a6b56 100644 --- a/src/models/ParameterModel.cs +++ b/src/models/ParameterModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/PasswordChangeModel.cs b/src/models/PasswordChangeModel.cs index 4d8ac7a1..9fe77790 100644 --- a/src/models/PasswordChangeModel.cs +++ b/src/models/PasswordChangeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/PingResultModel.cs b/src/models/PingResultModel.cs index e468a16f..67db1f7e 100644 --- a/src/models/PingResultModel.cs +++ b/src/models/PingResultModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/PoNumberModel.cs b/src/models/PoNumberModel.cs index b9a59d16..43fc5f3a 100644 --- a/src/models/PoNumberModel.cs +++ b/src/models/PoNumberModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/PointOfSaleDataRequestModel.cs b/src/models/PointOfSaleDataRequestModel.cs index 0115e334..5f24edfa 100644 --- a/src/models/PointOfSaleDataRequestModel.cs +++ b/src/models/PointOfSaleDataRequestModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/RateModel.cs b/src/models/RateModel.cs index a94b194e..988a4128 100644 --- a/src/models/RateModel.cs +++ b/src/models/RateModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/RateTypeModel.cs b/src/models/RateTypeModel.cs index 8a6a9ffd..f3e6f950 100644 --- a/src/models/RateTypeModel.cs +++ b/src/models/RateTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -22,7 +23,7 @@ namespace Avalara.AvaTax.RestClient public class RateTypeModel { /// - /// The unique ID number of this tax authority. + /// The unique ID number of this rate type. /// public String id { get; set; } diff --git a/src/models/RebuildFilingsModel.cs b/src/models/RebuildFilingsModel.cs index 1f9f11f3..996b70a4 100644 --- a/src/models/RebuildFilingsModel.cs +++ b/src/models/RebuildFilingsModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ReconstructedApiRequestResponseModel.cs b/src/models/ReconstructedApiRequestResponseModel.cs index 82409208..f249bf5c 100644 --- a/src/models/ReconstructedApiRequestResponseModel.cs +++ b/src/models/ReconstructedApiRequestResponseModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ReconstructedMultiDocumentModel.cs b/src/models/ReconstructedMultiDocumentModel.cs new file mode 100644 index 00000000..7f589efd --- /dev/null +++ b/src/models/ReconstructedMultiDocumentModel.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Contains information about the original API request and response that created + /// a MultiDocument object. + /// + public class ReconstructedMultiDocumentModel + { + /// + /// The original request that was used to create a MultiDocument object. + /// + public CreateMultiDocumentModel request { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/RefundTransactionModel.cs b/src/models/RefundTransactionModel.cs index 116bba98..c9bda4c3 100644 --- a/src/models/RefundTransactionModel.cs +++ b/src/models/RefundTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/RemoveTransactionLineModel.cs b/src/models/RemoveTransactionLineModel.cs index 796184ff..4d238274 100644 --- a/src/models/RemoveTransactionLineModel.cs +++ b/src/models/RemoveTransactionLineModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ReportModel.cs b/src/models/ReportModel.cs index 43fbf1d7..da130e5f 100644 --- a/src/models/ReportModel.cs +++ b/src/models/ReportModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ReportParametersModel.cs b/src/models/ReportParametersModel.cs index e6c5271a..749800ea 100644 --- a/src/models/ReportParametersModel.cs +++ b/src/models/ReportParametersModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ResetLicenseKeyModel.cs b/src/models/ResetLicenseKeyModel.cs index 035da198..db06eef4 100644 --- a/src/models/ResetLicenseKeyModel.cs +++ b/src/models/ResetLicenseKeyModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ResourceFileTypeModel.cs b/src/models/ResourceFileTypeModel.cs index f6d228e1..eb89185a 100644 --- a/src/models/ResourceFileTypeModel.cs +++ b/src/models/ResourceFileTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ResourceFileUploadRequestModel.cs b/src/models/ResourceFileUploadRequestModel.cs index d56089ff..f7259d91 100644 --- a/src/models/ResourceFileUploadRequestModel.cs +++ b/src/models/ResourceFileUploadRequestModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/SecurityRoleModel.cs b/src/models/SecurityRoleModel.cs index 65b2f12d..e6ee4e0e 100644 --- a/src/models/SecurityRoleModel.cs +++ b/src/models/SecurityRoleModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/SetPasswordModel.cs b/src/models/SetPasswordModel.cs index 8a9e4853..e7e013a2 100644 --- a/src/models/SetPasswordModel.cs +++ b/src/models/SetPasswordModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/SettingModel.cs b/src/models/SettingModel.cs index 47e17643..a723a7e0 100644 --- a/src/models/SettingModel.cs +++ b/src/models/SettingModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/SettleTransactionModel.cs b/src/models/SettleTransactionModel.cs index 1c9f03de..63d45d4d 100644 --- a/src/models/SettleTransactionModel.cs +++ b/src/models/SettleTransactionModel.cs @@ -12,30 +12,39 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient { /// /// Settle this transaction with your ledger by executing one or many actions against that transaction. + /// /// You may use this endpoint to verify the transaction, change the transaction's code, and commit the transaction for reporting purposes. /// This endpoint may be used to execute any or all of these actions at once. /// public class SettleTransactionModel { /// - /// To use the "Settle" endpoint to verify a transaction, fill out this value. + /// To verify this transaction, you may provide information in this field. + /// + /// If you leave this field null, the transaction will not be verified. /// public VerifyTransactionModel verify { get; set; } /// - /// To use the "Settle" endpoint to change a transaction's code, fill out this value. + /// To change the code for this transaction, you may provide information in this field. + /// + /// If you leave this field null, the transaction's code will not be changed. /// public ChangeTransactionCodeModel changeCode { get; set; } /// - /// To use the "Settle" endpoint to commit a transaction for reporting purposes, fill out this value. - /// If you use Avalara Returns, committing a transaction will cause that transaction to be filed. + /// To commit this transaction so that it can be reported on a tax filing, you may provide information in this field. + /// + /// If you leave this field null, the transaction's commit status will not be changed. + /// + /// If you use Avalara's Managed Returns Service, committing a transaction will allow that transaction to be filed. /// public CommitTransactionModel commit { get; set; } diff --git a/src/models/SkyscraperStatusModel.cs b/src/models/SkyscraperStatusModel.cs index 9e94ccde..15885913 100644 --- a/src/models/SkyscraperStatusModel.cs +++ b/src/models/SkyscraperStatusModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/SubscriptionModel.cs b/src/models/SubscriptionModel.cs index 34371a01..9d4e9663 100644 --- a/src/models/SubscriptionModel.cs +++ b/src/models/SubscriptionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/SubscriptionTypeModel.cs b/src/models/SubscriptionTypeModel.cs index d136314b..6cc9d226 100644 --- a/src/models/SubscriptionTypeModel.cs +++ b/src/models/SubscriptionTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxAuthorityFormModel.cs b/src/models/TaxAuthorityFormModel.cs index 0e36226e..3cde9e1e 100644 --- a/src/models/TaxAuthorityFormModel.cs +++ b/src/models/TaxAuthorityFormModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxAuthorityInfo.cs b/src/models/TaxAuthorityInfo.cs index 3a1a5bfa..7e5e4f90 100644 --- a/src/models/TaxAuthorityInfo.cs +++ b/src/models/TaxAuthorityInfo.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxAuthorityModel.cs b/src/models/TaxAuthorityModel.cs index b66f84b1..c13af617 100644 --- a/src/models/TaxAuthorityModel.cs +++ b/src/models/TaxAuthorityModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxAuthorityTypeModel.cs b/src/models/TaxAuthorityTypeModel.cs index 4d1315f0..5a07c236 100644 --- a/src/models/TaxAuthorityTypeModel.cs +++ b/src/models/TaxAuthorityTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxCodeModel.cs b/src/models/TaxCodeModel.cs index 809fc988..a3e2166f 100644 --- a/src/models/TaxCodeModel.cs +++ b/src/models/TaxCodeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxCodeTypesModel.cs b/src/models/TaxCodeTypesModel.cs index 183b784c..15cfa5c2 100644 --- a/src/models/TaxCodeTypesModel.cs +++ b/src/models/TaxCodeTypesModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxOverrideModel.cs b/src/models/TaxOverrideModel.cs index 6d27ff75..e6098020 100644 --- a/src/models/TaxOverrideModel.cs +++ b/src/models/TaxOverrideModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxRateModel.cs b/src/models/TaxRateModel.cs index 9f66928b..e34bb99a 100644 --- a/src/models/TaxRateModel.cs +++ b/src/models/TaxRateModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxRuleModel.cs b/src/models/TaxRuleModel.cs index 0002ea84..be053924 100644 --- a/src/models/TaxRuleModel.cs +++ b/src/models/TaxRuleModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -64,10 +65,16 @@ public class TaxRuleModel public JurisTypeId? jurisTypeId { get; set; } /// - /// The type of customer usage to which this rule applies. + /// DEPRECATED - The type of customer usage to which this rule applies. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// The type of customer usage to which this rule applies. + /// + public String entityUseCode { get; set; } + /// /// Indicates which tax types to which this rule applies. /// @@ -142,12 +149,27 @@ public class TaxRuleModel public Boolean? isSTPro { get; set; } /// - /// The two character ISO 3166 country code for the locations where this rule applies. + /// Name or ISO 3166 code identifying the country where this rule will apply. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// The state, region, or province name for the locations where this rule applies. + /// Name or ISO 3166 code identifying the region where this rule will apply. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } diff --git a/src/models/TaxSubTypeModel.cs b/src/models/TaxSubTypeModel.cs index 5f057083..15dd7d4e 100644 --- a/src/models/TaxSubTypeModel.cs +++ b/src/models/TaxSubTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxTypeGroupModel.cs b/src/models/TaxTypeGroupModel.cs index adbe6ee0..204c7c4c 100644 --- a/src/models/TaxTypeGroupModel.cs +++ b/src/models/TaxTypeGroupModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TransactionAddressModel.cs b/src/models/TransactionAddressModel.cs index 946103fa..c3080529 100644 --- a/src/models/TransactionAddressModel.cs +++ b/src/models/TransactionAddressModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TransactionLineDetailModel.cs b/src/models/TransactionLineDetailModel.cs index 22c44b45..a8824f6a 100644 --- a/src/models/TransactionLineDetailModel.cs +++ b/src/models/TransactionLineDetailModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TransactionLineLocationTypeModel.cs b/src/models/TransactionLineLocationTypeModel.cs index 6eaf8c3f..f923e950 100644 --- a/src/models/TransactionLineLocationTypeModel.cs +++ b/src/models/TransactionLineLocationTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TransactionLineModel.cs b/src/models/TransactionLineModel.cs index 3e8b0c17..09e4ed6a 100644 --- a/src/models/TransactionLineModel.cs +++ b/src/models/TransactionLineModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -42,10 +43,16 @@ public class TransactionLineModel public Int32? boundaryOverrideId { get; set; } /// - /// The customer usage type for this line item. Usage type often affects taxability rules. + /// DEPRECATED - The customer usage type for this line item. Usage type often affects taxability rules. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// The entity use code for this line item. Usage type often affects taxability rules. + /// + public String entityUseCode { get; set; } + /// /// A description of the item or service represented by this line. /// @@ -206,7 +213,11 @@ public class TransactionLineModel public String taxOverrideReason { get; set; } /// - /// True if tax was included in the purchase price of the item. + /// Indicates whether the `amount` for this line already includes tax. + /// + /// If this value is `true`, the final price of this line including tax will equal the value in `amount`. + /// + /// If this value is `null` or `false`, the final price will equal `amount` plus whatever taxes apply to this line. /// public Boolean? taxIncluded { get; set; } diff --git a/src/models/TransactionLocationTypeModel.cs b/src/models/TransactionLocationTypeModel.cs index e621f889..9fc5ea6d 100644 --- a/src/models/TransactionLocationTypeModel.cs +++ b/src/models/TransactionLocationTypeModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TransactionModel.cs b/src/models/TransactionModel.cs index e4ce5bb1..514dc579 100644 --- a/src/models/TransactionModel.cs +++ b/src/models/TransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -70,10 +71,16 @@ public class TransactionModel public String currencyCode { get; set; } /// - /// The customer usage type for this transaction. Customer usage types often affect exemption or taxability rules. + /// DEPRECATED - The customer usage type for this transaction. Customer usage types often affect exemption or taxability rules. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// The entity use code for this transaction. Entity use codes often affect exemption or taxability rules. + /// + public String entityUseCode { get; set; } + /// /// CustomerVendorCode /// @@ -216,6 +223,13 @@ public class TransactionModel /// /// If true, this seller was considered the importer of record of a product shipped internationally. + /// + /// If this transaction is not an international transaction, this field may be left blank. + /// + /// The "importer of record" is liable to pay customs and import duties for products shipped internationally. If + /// you specify that the seller is the importer of record, then estimates of customs and import duties will be added + /// as tax details to the transaction. Otherwise, the buyer is considered the importer of record, and customs + /// and import duties will not be added to the tax details for this transaction. /// public Boolean? isSellerImporterOfRecord { get; set; } @@ -264,11 +278,6 @@ public class TransactionModel /// public List locationTypes { get; set; } - /// - /// If this transaction has been adjusted, this list contains all the previous versions of the document. - /// - public List history { get; set; } - /// /// Contains a summary of tax on this transaction. /// diff --git a/src/models/TransactionSummary.cs b/src/models/TransactionSummary.cs index 1e9db40d..08654db5 100644 --- a/src/models/TransactionSummary.cs +++ b/src/models/TransactionSummary.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/UPCModel.cs b/src/models/UPCModel.cs index 344feb91..23bda0c5 100644 --- a/src/models/UPCModel.cs +++ b/src/models/UPCModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/UserEntitlementModel.cs b/src/models/UserEntitlementModel.cs index ebe6e1f5..e33866cc 100644 --- a/src/models/UserEntitlementModel.cs +++ b/src/models/UserEntitlementModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/UserModel.cs b/src/models/UserModel.cs index 16cc3c01..818cf36b 100644 --- a/src/models/UserModel.cs +++ b/src/models/UserModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/ValidatedAddressInfo.cs b/src/models/ValidatedAddressInfo.cs index 5a470b7c..c3e46f03 100644 --- a/src/models/ValidatedAddressInfo.cs +++ b/src/models/ValidatedAddressInfo.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient @@ -23,12 +24,12 @@ public class ValidatedAddressInfo { /// /// Address type code. One of: - /// * F - Firm or company address - /// * G - General Delivery address - /// * H - High-rise or business complex - /// * P - PO Box address - /// * R - Rural route address - /// * S - Street or residential address + /// * Firm or company address + /// * General Delivery address + /// * High-rise or business complex + /// * PO Box address + /// * Rural route address + /// * Street or residential address /// public String addressType { get; set; } @@ -53,12 +54,27 @@ public class ValidatedAddressInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/VerifyMultiDocumentModel.cs b/src/models/VerifyMultiDocumentModel.cs new file mode 100644 index 00000000..90a5cc04 --- /dev/null +++ b/src/models/VerifyMultiDocumentModel.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + * @author Greg Hester + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Verify that a MultiDocument object matches the information in your accounting system. + /// + /// If all attributes of the MultiDocument object match the values in your request, the + /// MultiDocument object will be moved to the document status `Posted`. + /// + /// For more information on document status, see [DocumentStatus](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentStatus/). + /// + public class VerifyMultiDocumentModel + { + /// + /// Represents the unique code of this MultiDocument transaction. + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public String code { get; set; } + + /// + /// Represents the document type of this MultiDocument transaction. For more information about + /// document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/). + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public DocumentType type { get; set; } + + /// + /// Set this value if you wish to verify a match between `verifyTransactionDate` and + /// the `documentDate` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. + /// + public DateTime? verifyTransactionDate { get; set; } + + /// + /// Set this value if you wish to verify a match between `verifyTotalAmount` and + /// the `totalAmount` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. + /// + public Decimal? verifyTotalAmount { get; set; } + + /// + /// Set this value if you wish to verify a match between `verifyTotalTax` and + /// the `totalTax` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. + /// + public Decimal? verifyTotalTax { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/VerifyTransactionModel.cs b/src/models/VerifyTransactionModel.cs index b941bc35..a1231dce 100644 --- a/src/models/VerifyTransactionModel.cs +++ b/src/models/VerifyTransactionModel.cs @@ -12,33 +12,41 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient { /// /// Verify this transaction by matching it to values in your accounting system. + /// + /// You may specify one or more of the following fields to verify: `date`, `totalAmount`, or `totalTax`. + /// This call will report an error if there is any difference between the data stored in AvaTax and + /// the data stored in your accounting system. /// public class VerifyTransactionModel { /// - /// Transaction Date - The date on the invoice, purchase order, etc. - /// - /// This is used to verify data consistency with the client application. + /// Set this value if you wish to verify a match between `verifyTransactionDate` and + /// the `documentDate` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. /// public DateTime? verifyTransactionDate { get; set; } /// - /// Total Amount - The total amount (not including tax) for the document. - /// - /// This is used to verify data consistency with the client application. + /// Set this value if you wish to verify a match between `verifyTotalAmount` and + /// the `totalAmount` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. /// public Decimal? verifyTotalAmount { get; set; } /// - /// Total Tax - The total tax for the document. - /// - /// This is used to verify data consistency with the client application. + /// Set this value if you wish to verify a match between `verifyTotalTax` and + /// the `totalTax` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. /// public Decimal? verifyTotalTax { get; set; } diff --git a/src/models/VoidTransactionModel.cs b/src/models/VoidTransactionModel.cs index 8b677558..b0aa6750 100644 --- a/src/models/VoidTransactionModel.cs +++ b/src/models/VoidTransactionModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/requiredFilingCalendarDataFieldModel.cs b/src/models/requiredFilingCalendarDataFieldModel.cs index 496ff7df..ff948430 100644 --- a/src/models/requiredFilingCalendarDataFieldModel.cs +++ b/src/models/requiredFilingCalendarDataFieldModel.cs @@ -12,6 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester */ namespace Avalara.AvaTax.RestClient From 62a7f2ffd8ba98586599f1f589c6138d821dad15 Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Thu, 30 Nov 2017 14:57:17 -0800 Subject: [PATCH 02/13] Fixed missing project files. --- src/Avalara.AvaTax.net20.csproj | 11 +++++++++++ src/Avalara.AvaTax.net45.csproj | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Avalara.AvaTax.net20.csproj b/src/Avalara.AvaTax.net20.csproj index 417cb1b2..e98fc3a1 100644 --- a/src/Avalara.AvaTax.net20.csproj +++ b/src/Avalara.AvaTax.net20.csproj @@ -131,8 +131,10 @@ + + @@ -146,6 +148,7 @@ + @@ -158,6 +161,7 @@ + @@ -192,10 +196,12 @@ + + @@ -211,7 +217,10 @@ + + + @@ -241,6 +250,7 @@ + @@ -278,6 +288,7 @@ + diff --git a/src/Avalara.AvaTax.net45.csproj b/src/Avalara.AvaTax.net45.csproj index 6956fa10..21963a12 100644 --- a/src/Avalara.AvaTax.net45.csproj +++ b/src/Avalara.AvaTax.net45.csproj @@ -136,8 +136,10 @@ + + @@ -151,6 +153,7 @@ + @@ -163,6 +166,7 @@ + @@ -197,10 +201,12 @@ + + @@ -216,7 +222,10 @@ + + + @@ -246,6 +255,7 @@ + @@ -283,6 +293,7 @@ + From 8f51306619a23f0019bf25b2c3ae7f0f8692b4de Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Wed, 13 Dec 2017 10:40:18 -0800 Subject: [PATCH 03/13] Regenerated SDK after Sandbox Deployment. --- GlobalAssemblyInfo.cs | 4 +- src/AvaTaxApi.cs | 4 +- src/Avalara.AvaTax.nuspec | 2 +- src/models/FilingReturnModelBasic.cs | 5 +++ src/models/FreeTrialRequestModel.cs | 15 +++++++ src/models/NewAccountModel.cs | 5 +++ src/models/NewAccountRequestModel.cs | 64 ++++++++++++++++++++++------ src/models/RefundTransactionModel.cs | 25 ++++++++--- src/models/TransactionModel.cs | 5 +++ 9 files changed, 105 insertions(+), 24 deletions(-) diff --git a/GlobalAssemblyInfo.cs b/GlobalAssemblyInfo.cs index 9f8d2475..5fe5beb6 100644 --- a/GlobalAssemblyInfo.cs +++ b/GlobalAssemblyInfo.cs @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("17.12.0.856")] -[assembly: AssemblyFileVersion("17.12.0.856")] +[assembly: AssemblyVersion("17.12.0.147")] +[assembly: AssemblyFileVersion("17.12.0.147")] diff --git a/src/AvaTaxApi.cs b/src/AvaTaxApi.cs index 34d5d5a2..7fb0c216 100644 --- a/src/AvaTaxApi.cs +++ b/src/AvaTaxApi.cs @@ -17,7 +17,7 @@ * @author Zhenya Frolov * @copyright 2004-2017 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 17.12.0-856 + * @version 17.12.0-147 * @link https://github.com/avadev/AvaTax-REST-V2-DotNet-SDK */ @@ -28,7 +28,7 @@ public partial class AvaTaxClient /// /// Returns the version number of the API used to generate this class /// - public static string API_VERSION { get { return "17.12.0-856"; } } + public static string API_VERSION { get { return "17.12.0-147"; } } #region Methods diff --git a/src/Avalara.AvaTax.nuspec b/src/Avalara.AvaTax.nuspec index 5111ac49..6ab787ca 100644 --- a/src/Avalara.AvaTax.nuspec +++ b/src/Avalara.AvaTax.nuspec @@ -2,7 +2,7 @@ Avalara.AvaTax - 17.12.0.856 + 17.12.0.147 Avalara AvaTax SDK Add world-class tax estimation and calculation to your project with Avalara's AvaTax suite of APIs and services. Ted Spence, Zhenya Frolov diff --git a/src/models/FilingReturnModelBasic.cs b/src/models/FilingReturnModelBasic.cs index ddc7ffdc..80e78e8c 100644 --- a/src/models/FilingReturnModelBasic.cs +++ b/src/models/FilingReturnModelBasic.cs @@ -37,6 +37,11 @@ public class FilingReturnModelBasic /// public Int64? filingId { get; set; } + /// + /// The resourceFileId of the return + /// + public Int64? resourceFileId { get; set; } + /// /// The region id that this return belongs too /// diff --git a/src/models/FreeTrialRequestModel.cs b/src/models/FreeTrialRequestModel.cs index 5cfc0ddc..0b22c746 100644 --- a/src/models/FreeTrialRequestModel.cs +++ b/src/models/FreeTrialRequestModel.cs @@ -49,6 +49,21 @@ public class FreeTrialRequestModel /// public String phone { get; set; } + /// + /// Campaign identifier for Notification purpose + /// + public String campaign { get; set; } + + /// + /// The Address information of the account + /// + public CompanyAddress companyAddress { get; set; } + + /// + /// Website of the company or user requesting a free trial + /// + public String website { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/NewAccountModel.cs b/src/models/NewAccountModel.cs index 18fe08fa..18477b46 100644 --- a/src/models/NewAccountModel.cs +++ b/src/models/NewAccountModel.cs @@ -52,6 +52,11 @@ public class NewAccountModel /// public String licenseKey { get; set; } + /// + /// The payment url where the payment method can be set up + /// + public String paymentUrl { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/NewAccountRequestModel.cs b/src/models/NewAccountRequestModel.cs index b6e9eb41..517ebfd1 100644 --- a/src/models/NewAccountRequestModel.cs +++ b/src/models/NewAccountRequestModel.cs @@ -24,37 +24,68 @@ namespace Avalara.AvaTax.RestClient public class NewAccountRequestModel { /// - /// Offer with which the partner account needs to be created + /// The offer code provided to you by your Avalara business development contact. + /// + /// This code controls what services and rates the customer will be provisioned with upon creation. + /// + /// If you do not know your offer code, please contact your Avalara business development representative. /// public String offer { get; set; } + /// + /// If your Avalara business development representative requests, please provide the campaign ID associated with your + /// signup process. This campaign identifier helps Avalara match users to the context in which they learned about the product + /// to help improve the accuracy of our messaging. + /// + /// The `campaign` field must be either null or a value provided to you by an Avalara business development representative. + /// If you provide an unexpected value in this field, your API call will fail. + /// + public String campaign { get; set; } + + /// + /// If your Avalara business development representative requests, please provide the lead source value associated with your + /// signup process. This lead source identifier helps Avalara match users to the context in which they learned about the product + /// to help improve the accuracy of our messaging. + /// + /// The `leadSource` field must be either null or a value provided to you by an Avalara business development representative. + /// If you provide an unexpected value in this field, your API call will fail. + /// + public String leadSource { get; set; } + /// /// The date on which the account should take effect. If null, defaults to today. + /// + /// You should leave this value `null` unless specifically requested by your Avalara business development manager. /// public DateTime? effectiveDate { get; set; } /// - /// The date on which the account should expire. If null, defaults to a 90-day trial account. + /// The date on which the account should expire. + /// + /// You should leave this value `null` unless specifically requested by your Avalara business development manager. /// public DateTime? endDate { get; set; } /// - /// Account Name + /// The name of the account to create /// public String accountName { get; set; } /// - /// Website of the partner account being created + /// Website of the new customer whose account is being created. + /// + /// It is strongly recommended to provide the customer's website URL, as this will help our support representatives better + /// assist customers. /// public String website { get; set; } /// - /// First Name of the primary contact person for this account + /// First name of the primary contact person for this account /// public String firstName { get; set; } /// - /// Last Name of the primary contact person for this account + /// Last name of the primary contact person for this account /// public String lastName { get; set; } @@ -74,16 +105,20 @@ public class NewAccountRequestModel public String email { get; set; } /// - /// If no password is supplied, an a tempoarary password is generated by the system and emailed to the user. The user will - /// be challenged to change this password upon logging in to the Admin Console. If supplied, will be the set password for - /// the default created user, and the user will not be challenged to change their password upon login to the Admin Console. + /// If instructed by your Avalara business development manager, set this value to a temporary password to permit the user to continue their onboarding process. + /// + /// If this value is null, a temporary password is generated by the system and emailed to the user. + /// + /// The user will then be asked to choose a permanent password when they first log on to the AvaTax website. /// public String userPassword { get; set; } /// - /// Normal - If a welcome email needs to be generated for the user. - /// Suppressed - If no welcome email needs to be generated for the user. - /// Custom - If a custom welcome email needs to be generated for the user. + /// This option controls what type of a welcome email is sent when the account is created. + /// + /// * `Normal` - A standard welcome email will be sent. + /// * `Suppressed` - No email will be sent. + /// * `Custom` - If your Avalara business development representative provides you with a customized welcome email for your customers, please select this option. /// public WelcomeEmail? welcomeEmail { get; set; } @@ -94,6 +129,7 @@ public class NewAccountRequestModel /// /// Company code to be assigned to the company created for this account. + /// /// If no company code is provided, this will be defaulted to "DEFAULT" company code. /// public String companyCode { get; set; } @@ -105,11 +141,15 @@ public class NewAccountRequestModel /// /// Set this to true if and only if the owner of the newly created account accepts Avalara's terms and conditions for your account. + /// + /// Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. /// public Boolean? acceptAvalaraTermsAndConditions { get; set; } /// /// Set this to true if and only if the owner of the newly created account has fully read Avalara's terms and conditions for your account. + /// + /// Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. /// public Boolean? haveReadAvalaraTermsAndConditions { get; set; } diff --git a/src/models/RefundTransactionModel.cs b/src/models/RefundTransactionModel.cs index c9bda4c3..d4a276f8 100644 --- a/src/models/RefundTransactionModel.cs +++ b/src/models/RefundTransactionModel.cs @@ -23,32 +23,43 @@ namespace Avalara.AvaTax.RestClient public class RefundTransactionModel { /// - /// the transaction code for this refund + /// The transaction code for the refund. This code will be saved to the `ReturnInvoice` transaction, and does not need to match the code of the original sale. /// public String refundTransactionCode { get; set; } /// - /// The date of the refund. If null, today's date will be used + /// The date of the refund. For customers using Avalara's Managed Returns Service, this date controls the month in which the refund + /// transaction will be reported on a tax filing. /// - public DateTime? refundDate { get; set; } + public DateTime refundDate { get; set; } /// - /// Type of this refund + /// Type of this refund. + /// + /// To submit a full refund, specify `Full`. + /// + /// To refund only specific lines from the transaction, specify `Partial` and indicate the lines you wish to apply in the `refundLines` field. + /// + /// To refund the tax that was paid in the previous transaction, specify `TaxOnly`. + /// + /// To issue a percentage-based discount, specify `Percentage`. /// public RefundType? refundType { get; set; } /// - /// Percentage for refund + /// The percentage for refund. + /// + /// This value only applies if you choose `refundType = Percentage` or `refundType = Partial`. /// public Decimal? refundPercentage { get; set; } /// - /// Process refund for these lines + /// If you chose a refund of type `Partial`, this indicates which lines from the original transaction are being refunded. /// public List refundLines { get; set; } /// - /// Reference code for this refund + /// A user-defined reference field containing information about this refund. /// public String referenceCode { get; set; } diff --git a/src/models/TransactionModel.cs b/src/models/TransactionModel.cs index 514dc579..aeaaa326 100644 --- a/src/models/TransactionModel.cs +++ b/src/models/TransactionModel.cs @@ -150,6 +150,11 @@ public class TransactionModel /// public Decimal? totalExempt { get; set; } + /// + /// The total amount of discounts applied to all lines within this transaction. + /// + public Decimal? totalDiscount { get; set; } + /// /// The total tax calculated for all lines in this transaction. /// From 75c5c6fe2a61415ddc97919c18cb60ab405a066c Mon Sep 17 00:00:00 2001 From: Greg Hester <32106280+greg-hester-avalara@users.noreply.github.com> Date: Wed, 13 Dec 2017 12:32:16 -0800 Subject: [PATCH 04/13] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72f0cc56..f58d44fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: csharp solution: Avalara.AvaTax.netstandard11.sln dist: trusty sudo: required -dotnet: 1.0.1 +dotnet: 1.0.0-preview2-003131 mono: latest install: - sudo apt-get install -y gtk-sharp2 @@ -21,4 +21,4 @@ script: after_success: - echo "Branch is $TRAVIS_BRANCH" - echo "Pull Request is $TRAVIS_PULL_REQUEST_BRANCH" - - if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "Successfully merged to master - take further actions here"; fi \ No newline at end of file + - if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "Successfully merged to master - take further actions here"; fi From e9564ad3a93967b234c8b1de08dc9340f62b6d81 Mon Sep 17 00:00:00 2001 From: Greg Hester <32106280+greg-hester-avalara@users.noreply.github.com> Date: Wed, 13 Dec 2017 12:44:40 -0800 Subject: [PATCH 05/13] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f58d44fc..4f0bfe96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: csharp solution: Avalara.AvaTax.netstandard11.sln dist: trusty sudo: required -dotnet: 1.0.0-preview2-003131 +dotnet: 1.0.0-preview2-003133 mono: latest install: - sudo apt-get install -y gtk-sharp2 From 60bc8367d235e38cb9c17ba909e686fbee098075 Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Wed, 13 Dec 2017 12:51:03 -0800 Subject: [PATCH 06/13] test --- tests/netstandard/NexusTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/netstandard/NexusTests.cs b/tests/netstandard/NexusTests.cs index 1887ddb7..52d12347 100644 --- a/tests/netstandard/NexusTests.cs +++ b/tests/netstandard/NexusTests.cs @@ -165,4 +165,4 @@ public void CreateAndDeleteNexus() Assert.NotNull(errorResult); } } -} \ No newline at end of file +} \ No newline at end of file From c992f46dce711590f4499524223692028c571ecd Mon Sep 17 00:00:00 2001 From: Greg Hester <32106280+greg-hester-avalara@users.noreply.github.com> Date: Wed, 13 Dec 2017 13:02:47 -0800 Subject: [PATCH 07/13] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4f0bfe96..67edfc3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: csharp solution: Avalara.AvaTax.netstandard11.sln dist: trusty sudo: required -dotnet: 1.0.0-preview2-003133 +dotnet: 1.0.1 mono: latest install: - sudo apt-get install -y gtk-sharp2 From ef97b5a18c863954419f9bfb9b6c2dcfaa3b1b2f Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Wed, 13 Dec 2017 13:03:02 -0800 Subject: [PATCH 08/13] test --- tests/netstandard/NexusTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/netstandard/NexusTests.cs b/tests/netstandard/NexusTests.cs index 52d12347..1887ddb7 100644 --- a/tests/netstandard/NexusTests.cs +++ b/tests/netstandard/NexusTests.cs @@ -165,4 +165,4 @@ public void CreateAndDeleteNexus() Assert.NotNull(errorResult); } } -} \ No newline at end of file +} \ No newline at end of file From 5772f82e9b5d7d2aa37973d9dec53f2633b41978 Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Thu, 14 Dec 2017 10:47:27 -0800 Subject: [PATCH 09/13] Small update. --- src/AvaTaxApi.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AvaTaxApi.cs b/src/AvaTaxApi.cs index 7fb0c216..39ea8184 100644 --- a/src/AvaTaxApi.cs +++ b/src/AvaTaxApi.cs @@ -15,6 +15,7 @@ * * @author Ted Spence * @author Zhenya Frolov + * @author Greg Hester * @copyright 2004-2017 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 * @version 17.12.0-147 From 3a7abec024c5ec0b4d7891b81c6686c5191dd9cb Mon Sep 17 00:00:00 2001 From: ted-spence-avalara Date: Fri, 15 Dec 2017 16:40:05 -0800 Subject: [PATCH 10/13] Update for 17.12 - https://developer.avalara.com/blog/2017/11/27/AvaTax-17-12-patch-notes --- GlobalAssemblyInfo.cs | 4 +- src/AvaTaxApi.cs | 1118 +++++++++++++++-- src/Avalara.AvaTax.nuspec | 2 +- src/enums/DocumentType.cs | 101 +- src/enums/ErrorCodeId.cs | 99 +- src/models/AddressInfo.cs | 19 +- src/models/AddressLocationInfo.cs | 19 +- src/models/AddressValidationInfo.cs | 19 +- src/models/AddressesModel.cs | 5 + src/models/AdjustMultiDocumentModel.cs | 51 + src/models/AdjustTransactionModel.cs | 2 +- src/models/AuditMultiDocumentModel.cs | 74 ++ src/models/AuditTransactionModel.cs | 10 +- src/models/CommitMultiDocumentModel.cs | 56 + src/models/CommitTransactionModel.cs | 7 +- src/models/CompanyAddress.cs | 19 +- src/models/CompanyInitializationModel.cs | 19 +- src/models/ContactModel.cs | 19 +- src/models/CreateMultiDocumentModel.cs | 241 ++++ src/models/CreateTransactionModel.cs | 13 +- src/models/CustomerModel.cs | 19 +- src/models/EcmsDetailModel.cs | 19 +- src/models/EcmsModel.cs | 33 +- src/models/FilingCalendarModel.cs | 38 +- src/models/FilingReturnModelBasic.cs | 5 + src/models/FreeTrialRequestModel.cs | 15 + src/models/FundingConfigurationModel.cs | 64 + src/models/IsoCountryModel.cs | 16 +- src/models/IsoLocalizedName.cs | 54 + src/models/IsoRegionModel.cs | 11 +- src/models/JurisdictionModel.cs | 19 +- src/models/JurisdictionOverrideModel.cs | 12 +- src/models/LineItemModel.cs | 14 +- src/models/LocationModel.cs | 19 +- src/models/MrsCompanyModel.cs | 59 + src/models/MultiDocumentLineItemModel.cs | 156 +++ src/models/MultiDocumentModel.cs | 91 ++ src/models/NewAccountModel.cs | 5 + src/models/NewAccountRequestModel.cs | 65 +- src/models/NexusModel.cs | 35 +- src/models/NoticeModel.cs | 19 +- src/models/RateTypeModel.cs | 2 +- src/models/ReconstructedMultiDocumentModel.cs | 40 + src/models/RefundTransactionModel.cs | 25 +- src/models/SettleTransactionModel.cs | 16 +- src/models/TaxRuleModel.cs | 27 +- src/models/TransactionLineModel.cs | 14 +- src/models/TransactionModel.cs | 25 +- src/models/ValidatedAddressInfo.cs | 31 +- src/models/VerifyMultiDocumentModel.cs | 78 ++ src/models/VerifyTransactionModel.cs | 25 +- 51 files changed, 2719 insertions(+), 229 deletions(-) create mode 100644 src/models/AdjustMultiDocumentModel.cs create mode 100644 src/models/AuditMultiDocumentModel.cs create mode 100644 src/models/CommitMultiDocumentModel.cs create mode 100644 src/models/CreateMultiDocumentModel.cs create mode 100644 src/models/FundingConfigurationModel.cs create mode 100644 src/models/IsoLocalizedName.cs create mode 100644 src/models/MrsCompanyModel.cs create mode 100644 src/models/MultiDocumentLineItemModel.cs create mode 100644 src/models/MultiDocumentModel.cs create mode 100644 src/models/ReconstructedMultiDocumentModel.cs create mode 100644 src/models/VerifyMultiDocumentModel.cs diff --git a/GlobalAssemblyInfo.cs b/GlobalAssemblyInfo.cs index 2d5759df..5fe5beb6 100644 --- a/GlobalAssemblyInfo.cs +++ b/GlobalAssemblyInfo.cs @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("17.9.0.126")] -[assembly: AssemblyFileVersion("17.9.0.126")] +[assembly: AssemblyVersion("17.12.0.147")] +[assembly: AssemblyFileVersion("17.12.0.147")] diff --git a/src/AvaTaxApi.cs b/src/AvaTaxApi.cs index 48dd7a23..7fb0c216 100644 --- a/src/AvaTaxApi.cs +++ b/src/AvaTaxApi.cs @@ -17,7 +17,7 @@ * @author Zhenya Frolov * @copyright 2004-2017 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 17.9.0-126 + * @version 17.12.0-147 * @link https://github.com/avadev/AvaTax-REST-V2-DotNet-SDK */ @@ -28,7 +28,7 @@ public partial class AvaTaxClient /// /// Returns the version number of the API used to generate this class /// - public static string API_VERSION { get { return "17.9.0-126"; } } + public static string API_VERSION { get { return "17.12.0-147"; } } #region Methods @@ -918,6 +918,24 @@ public List DeleteCompany(Int32 id) } + /// + /// Check the funding configuration of a company + /// + /// + /// This API is available by invitation only. + /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. + /// Returns the funding configuration of the requested company. + /// . + /// + /// The unique identifier of the company + public FundingConfigurationModel FundingConfigurationByCompany(Int32 companyId) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/funding/configuration"); + path.ApplyField("companyId", companyId); + return RestCall("Get", path, null); + } + + /// /// Retrieve a single company /// @@ -1003,13 +1021,13 @@ public String GetFilingStatus(Int32 id) /// - /// Check managed returns funding configuration for a company + /// Check managed returns funding status for a company /// /// /// This API is available by invitation only. /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. /// Returns a list of funding setup requests and their current status. - /// Each object in the result is a request that was made to setup or adjust funding configuration for this company. + /// Each object in the result is a request that was made to setup or adjust funding status for this company. /// /// The unique identifier of the company public List ListFundingRequestsByCompany(Int32 id) @@ -1028,10 +1046,10 @@ public List ListFundingRequestsByCompany(Int32 id) /// /// Get a list of companies with an active MRS service. /// - public FetchResult ListMrsCompanies() + public FetchResult ListMrsCompanies() { var path = new AvaTaxPath("/api/v2/companies/mrs"); - return RestCall>("Get", path, null); + return RestCall>("Get", path, null); } @@ -1915,6 +1933,7 @@ public FetchResult ListLoginVerifiers(String filter, Int3 /// /// /// Returns the full list of all Avalara-supported nexus for all countries and regions. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus. /// /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . @@ -1946,9 +1965,24 @@ public FetchResult ListNexus(String filter, Int32? top, Int32? skip, /// The first address line portion of this address. /// The first address line portion of this address. /// The city portion of this address. - /// The region, state, or province code portion of this address. + /// Name or ISO 3166 code identifying the region portion of the address. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code or zip code portion of this address. - /// The two-character ISO-3166 code of the country portion of this address. + /// Name or ISO 3166 code identifying the country portion of this address. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -1976,6 +2010,7 @@ public FetchResult ListNexusByAddress(String line1, String line2, St /// /// /// Returns all Avalara-supported nexus for the specified country. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country. /// /// The country in which you want to fetch the system nexus @@ -2000,6 +2035,7 @@ public FetchResult ListNexusByCountry(String country, String filter, /// /// /// Returns all Avalara-supported nexus for the specified country and region. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country and region. /// /// The two-character ISO-3166 code for the country. @@ -3306,13 +3342,13 @@ public FilingsCheckupModel FilingsCheckupReports(Int32 companyId, Int32 year, In /// This API is available by invitation only. /// /// The ID of the company that owns the filings. - /// The unique id of the worksheet return. + /// The unique id of the worksheet return. /// The unique id of the document you are downloading - public FileResult GetFilingAttachment(Int32 companyId, Int64 filingId, Int64? fileId) + public FileResult GetFilingAttachment(Int32 companyId, Int64 filingReturnId, Int64? fileId) { - var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingId}/attachment"); + var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingReturnId}/attachment"); path.ApplyField("companyId", companyId); - path.ApplyField("filingId", filingId); + path.ApplyField("filingReturnId", filingReturnId); path.AddQuery("fileId", fileId); return RestCallFile("Get", path, null); } @@ -3489,7 +3525,8 @@ public FetchResult GetFilingsByReturnName(Int32 companyId, Int16 ye /// The status of the return(s) you are trying to retrieve /// The country of the return(s) you are trying to retrieve /// The region of the return(s) you are trying to retrieve - public FetchResult GetFilingsReturns(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region) + /// The filing calendar id of the return you are trying to retrieve + public FetchResult GetFilingsReturns(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region, Int64? filingCalendarId) { var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/returns"); path.ApplyField("companyId", companyId); @@ -3499,6 +3536,7 @@ public FetchResult GetFilingsReturns(Int32 companyId, In path.AddQuery("status", status); path.AddQuery("country", country); path.AddQuery("region", region); + path.AddQuery("filingCalendarId", filingCalendarId); return RestCall>("Get", path, null); } @@ -3711,9 +3749,24 @@ public NewAccountModel RequestFreeTrial(FreeTrialRequestModel model) /// The street address of the location. /// The street address of the location. /// The city name of the location. - /// The state or region of the location + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code of the location. - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. public TaxRateModel TaxRatesByAddress(String line1, String line2, String line3, String city, String region, String postalCode, String country) { var path = new AvaTaxPath("/api/v2/taxrates/byaddress"); @@ -3729,11 +3782,13 @@ public TaxRateModel TaxRatesByAddress(String line1, String line2, String line3, /// - /// FREE API - Sales tax rates for a specified country and postal code + /// FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes. /// /// /// # Free-To-Use /// + /// This API is only available for a US postal codes. + /// /// The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. /// Any customer can request a free AvaTax account and make use of the TaxRates API. /// @@ -3758,7 +3813,15 @@ public TaxRateModel TaxRatesByAddress(String line1, String line2, String line3, /// Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) /// for information on how to upgrade to the full AvaTax CreateTransaction API. /// - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// The postal code of the location. public TaxRateModel TaxRatesByPostalCode(String country, String postalCode) { @@ -4257,6 +4320,341 @@ public LocationValidationModel ValidateLocation(Int32 companyId, Int32 id) } + /// + /// Adjust a MultiDocument transaction + /// + /// + /// Adjusts the current MultiDocument transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you adjust a transaction, that transaction's status is recorded as `Adjusted`. + /// + /// Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments. + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// Specifies objects to include in this fetch call + /// The adjust request you wish to execute + public MultiDocumentModel AdjustMultiDocumentTransaction(String code, DocumentType type, String include, AdjustMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/adjust"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("include", include); + return RestCall("Post", path, model); + } + + + /// + /// Get audit information about a MultiDocument transaction + /// + /// + /// Retrieve audit information about a MultiDocument transaction stored in AvaTax. + /// + /// The audit API retrieves audit information related to a specific MultiDocument transaction. This audit + /// information includes the following: + /// + /// * The `code` of the MultiDocument transaction + /// * The `type` of the MultiDocument transaction + /// * The server timestamp representing the exact server time when the transaction was created + /// * The server duration - how long it took to process this transaction + /// * Whether exact API call details were logged + /// * A reconstructed API call showing what the original create call looked like + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + public AuditMultiDocumentModel AuditMultiDocumentTransaction(String code, DocumentType type) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/audit"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return RestCall("Get", path, null); + } + + + /// + /// Commit a MultiDocument transaction + /// + /// + /// Marks a list of transactions by changing its status to `Committed`. + /// + /// Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Any changes made to a committed transaction will generate a transaction history. + /// + /// The commit request you wish to execute + public MultiDocumentModel CommitMultiDocumentTransaction(CommitMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/commit"); + return RestCall("Post", path, model); + } + + + /// + /// Create a new MultiDocument transaction + /// + /// + /// Records a new MultiDocument transaction in AvaTax. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This API will report an error if you attempt to create a transaction when one already exists with the specified `code`. + /// If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust` + /// value to `true`. + /// + /// To generate a refund for a transaction, use the `RefundTransaction` API. + /// + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. + /// + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + /// + /// Specifies objects to include in the response after transaction is created + /// the multi document transaction model + public MultiDocumentModel CreateMultiDocumentTransaction(String include, CreateMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$include", include); + return RestCall("Post", path, model); + } + + + /// + /// Retrieve a MultiDocument transaction + /// + /// + /// Get the current MultiDocument transaction identified by this URL. + /// + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// + /// + /// Specifies objects to include in the response after transaction is created + public MultiDocumentModel GetMultiDocumentTransactionByCodeAndType(String code, DocumentType type, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return RestCall("Get", path, null); + } + + + /// + /// Retrieve a MultiDocument transaction by ID + /// + /// + /// Get the unique MultiDocument transaction identified by this URL. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted + /// by using the `AdjustTransaction` endpoint. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// The unique ID number of the MultiDocument transaction to retrieve + /// Specifies objects to include in the response after transaction is created + public MultiDocumentModel GetMultiDocumentTransactionById(Int64 id, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{id}"); + path.ApplyField("id", id); + path.AddQuery("$include", include); + return RestCall("Get", path, null); + } + + + /// + /// Retrieve all MultiDocument transactions + /// + /// + /// List all MultiDocument transactions within this account. + /// + /// This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument + /// transactions, please use the pagination features of the API. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Specifies objects to include in the response after transaction is created + /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. + /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public FetchResult ListMultiDocumentTransactions(String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$filter", filter); + path.AddQuery("$include", include); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return RestCall>("Get", path, null); + } + + + /// + /// Create a refund for a MultiDocument transaction + /// + /// + /// Create a refund for a MultiDocument transaction. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund + /// for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and + /// specify individual line items from the original sale for refund. + /// + /// The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that + /// was calculated during the original transaction, regardless of any changes to your company's configuration, rules, + /// nexus, or any other setting. + /// + /// This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following + /// common refund scenarios: + /// + /// * A full refund of a previous sale + /// * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase + /// * Refunding one or more items (lines) from a previous sale + /// * Granting a customer a percentage refund of a previous sale + /// + /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to + /// create a custom refund transaction. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + /// + /// The code of this MultiDocument transaction + /// The type of this MultiDocument transaction + /// Specifies objects to include in the response after transaction is created + /// Information about the refund to create + public MultiDocumentModel RefundMultiDocumentTransaction(String code, DocumentType type, String include, RefundTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/refund"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return RestCall("Post", path, model); + } + + + /// + /// Verify a MultiDocument transaction + /// + /// + /// Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values. + /// + /// If the transaction does not match these expected values, this API will return an error code indicating which value did not match. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax + public MultiDocumentModel VerifyMultiDocumentTransaction(VerifyMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/verify"); + return RestCall("Post", path, model); + } + + + /// + /// Void a MultiDocument transaction + /// + /// + /// Voids the current transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you void a transaction, that transaction's status is recorded as `DocVoided`. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`, + /// and they are no longer available to be voided. + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// The void request you wish to execute + public MultiDocumentModel VoidMultiDocumentTransaction(String code, DocumentType type, VoidTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/void"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return RestCall("Post", path, model); + } + + /// /// Create a new nexus /// @@ -4910,27 +5308,7 @@ public List CreateSubscriptions(Int32 accountId, List - /// Create new users - /// - /// - /// # For Registrar Use Only - /// This API is for use by Avalara Registrar administrative users only. - /// - /// Create one or more new user objects attached to this account. - /// A user represents one person with access privileges to make API calls and work with a specific account. - /// - /// The unique ID number of the account where these users will be created. - /// The user or array of users you wish to create. - public List CreateUsers(Int32 accountId, List model) - { - var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); - path.ApplyField("accountId", accountId); - return RestCall>("Post", path, model); - } - - - /// - /// Delete a single account + /// Delete a single account /// /// /// # For Registrar Use Only @@ -5646,6 +6024,35 @@ public FileResult BuildTaxContentFileForLocation(Int32 companyId, Int32 id, Date } + /// + /// Download a file listing tax rates by postal code + /// + /// + /// Download a CSV file containing all five digit postal codes in the United States and their sales + /// and use tax rates for tangible personal property. + /// + /// This rates file is intended to be used as a default for tax calculation when your software cannot + /// call the `CreateTransaction` API call. When using this file, your software will be unable to + /// handle complex tax rules such as: + /// + /// * Zip+9 - This tax file does not contain + /// * Different product types - This tax file contains tangible personal property tax rates only. + /// * Mixed sourcing - This tax file cannot be used to resolve origin-based taxes. + /// * Threshold-based taxes - This tax file does not contain information about thresholds. + /// + /// If you use this file to provide default tax rates, please ensure that your software calls `CreateTransaction` + /// to reconcile the actual transaction and determine the difference between the estimated general tax + /// rate and the final transaction tax. + /// + /// The date for which point-of-sale data would be calculated (today by default). Example input: 2016-12-31 + public FileResult DownloadTaxRatesByZipCode(DateTime date) + { + var path = new AvaTaxPath("/api/v2/taxratesbyzipcode/download/{date}"); + path.ApplyField("date", date); + return RestCallFile("Get", path, null); + } + + /// /// Create a new tax rule /// @@ -5804,7 +6211,7 @@ public TaxRuleModel UpdateTaxRule(Int32 companyId, Int32 id, TaxRuleModel model) /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -5941,8 +6348,13 @@ public BulkLockTransactionResult BulkLockTransaction(BulkLockTransactionModel mo /// Change a transaction's code /// /// - /// Renames a transaction uniquely identified by this URL by changing its code to a new code. - /// After this API call succeeds, the transaction will have a new URL matching its new code. + /// Renames a transaction uniquely identified by this URL by changing its `code` value. + /// + /// This API is available as long as the transaction is in `saved` or `posted` status. When a transaction + /// is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method. + /// + /// After this API call succeeds, the transaction will have a new URL matching its new `code`. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). /// @@ -6001,7 +6413,7 @@ public TransactionModel CommitTransaction(String companyCode, String transaction /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6029,8 +6441,11 @@ public TransactionModel CreateOrAdjustTransaction(String include, CreateOrAdjust /// /// Records a new transaction in AvaTax. /// - /// The `CreateTransaction` endpoint uses the configuration values specified by your company to identify the correct tax rules - /// and rates to apply to all line items in this transaction, and reports the total tax calculated by AvaTax based on your + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules + /// and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your /// company's configuration and the data provided in this API call. /// /// The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To @@ -6039,11 +6454,15 @@ public TransactionModel CreateOrAdjustTransaction(String include, CreateOrAdjust /// /// To generate a refund for a transaction, use the `RefundTransaction` API. /// - /// If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database. + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. /// - /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6076,7 +6495,7 @@ public TransactionModel CreateTransaction(String include, CreateTransactionModel /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6105,8 +6524,7 @@ public TransactionModel DeleteLines(String include, RemoveTransactionLineModel m /// /// To fetch other kinds of transactions, use `GetTransactionByCodeAndType`. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -6136,8 +6554,7 @@ public TransactionModel GetTransactionByCode(String companyCode, String transact /// /// Get the current transaction identified by this URL. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -6168,11 +6585,14 @@ public TransactionModel GetTransactionByCodeAndType(String companyCode, String t /// /// /// Get the unique transaction identified by this URL. + /// /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted - /// by using the 'Adjust Transaction' endpoint. + /// by using the `AdjustTransaction` endpoint. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6197,12 +6617,18 @@ public TransactionModel GetTransactionById(Int64 id, String include) /// /// /// List all transactions attached to this company. + /// /// This endpoint is limited to returning 1,000 transactions at a time maximum. + /// + /// When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field + /// criteria, the query will default to looking at only those transactions with `date` in the past 30 days. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). /// /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines @@ -6282,7 +6708,7 @@ public TransactionModel LockTransaction(String companyCode, String transactionCo /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to /// create a custom refund transaction. /// - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -6497,6 +6923,30 @@ public UPCModel UpdateUPC(Int32 companyId, Int32 id, UPCModel model) } + /// + /// Create new users + /// + /// + /// Create one or more new user objects attached to this account. + /// + /// A user represents one person with access privileges to make API calls and work with a specific account. + /// + /// Users who are account administrators or company users are permitted to create user records to invite + /// additional team members to work with AvaTax. + /// + /// A newly created user will receive an email inviting them to create their password. This means that you + /// must provide a valid email address for all user accounts created. + /// + /// The unique ID number of the account where these users will be created. + /// The user or array of users you wish to create. + public List CreateUsers(Int32 accountId, List model) + { + var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); + path.ApplyField("accountId", accountId); + return RestCall>("Post", path, model); + } + + /// /// Retrieve a single user /// @@ -7564,6 +8014,24 @@ public async Task> DeleteCompanyAsync(Int32 id) } + /// + /// Check the funding configuration of a company; + /// + /// + /// This API is available by invitation only. + /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. + /// Returns the funding configuration of the requested company. + /// .; + /// + /// The unique identifier of the company + public async Task FundingConfigurationByCompanyAsync(Int32 companyId) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/funding/configuration"); + path.ApplyField("companyId", companyId); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + /// /// Retrieve a single company; /// @@ -7649,13 +8117,13 @@ public async Task GetFilingStatusAsync(Int32 id) /// - /// Check managed returns funding configuration for a company; + /// Check managed returns funding status for a company; /// /// /// This API is available by invitation only. /// Requires a subscription to Avalara Managed Returns or SST Certified Service Provider. /// Returns a list of funding setup requests and their current status. - /// Each object in the result is a request that was made to setup or adjust funding configuration for this company.; + /// Each object in the result is a request that was made to setup or adjust funding status for this company.; /// /// The unique identifier of the company public async Task> ListFundingRequestsByCompanyAsync(Int32 id) @@ -7674,10 +8142,10 @@ public async Task> ListFundingRequestsByCompanyAsync(In /// /// Get a list of companies with an active MRS service.; /// - public async Task> ListMrsCompaniesAsync() + public async Task> ListMrsCompaniesAsync() { var path = new AvaTaxPath("/api/v2/companies/mrs"); - return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); } @@ -8561,6 +9029,7 @@ public async Task> ListLoginVerifiersAsync(St /// /// /// Returns the full list of all Avalara-supported nexus for all countries and regions. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus.; /// /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . @@ -8592,9 +9061,24 @@ public async Task> ListNexusAsync(String filter, Int32? /// The first address line portion of this address. /// The first address line portion of this address. /// The city portion of this address. - /// The region, state, or province code portion of this address. + /// Name or ISO 3166 code identifying the region portion of the address. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code or zip code portion of this address. - /// The two-character ISO-3166 code of the country portion of this address. + /// Name or ISO 3166 code identifying the country portion of this address. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -8622,6 +9106,7 @@ public async Task> ListNexusByAddressAsync(String line1, /// /// /// Returns all Avalara-supported nexus for the specified country. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country.; /// /// The country in which you want to fetch the system nexus @@ -8646,6 +9131,7 @@ public async Task> ListNexusByCountryAsync(String countr /// /// /// Returns all Avalara-supported nexus for the specified country and region. + /// /// This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country and region.; /// /// The two-character ISO-3166 code for the country. @@ -9952,13 +10438,13 @@ public async Task FilingsCheckupReportsAsync(Int32 companyI /// This API is available by invitation only.; /// /// The ID of the company that owns the filings. - /// The unique id of the worksheet return. + /// The unique id of the worksheet return. /// The unique id of the document you are downloading - public async Task GetFilingAttachmentAsync(Int32 companyId, Int64 filingId, Int64? fileId) + public async Task GetFilingAttachmentAsync(Int32 companyId, Int64 filingReturnId, Int64? fileId) { - var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingId}/attachment"); + var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/{filingReturnId}/attachment"); path.ApplyField("companyId", companyId); - path.ApplyField("filingId", filingId); + path.ApplyField("filingReturnId", filingReturnId); path.AddQuery("fileId", fileId); return await RestCallAsync("Get", path, null).ConfigureAwait(false); } @@ -10135,7 +10621,8 @@ public async Task> GetFilingsByReturnNameAsync(Int32 co /// The status of the return(s) you are trying to retrieve /// The country of the return(s) you are trying to retrieve /// The region of the return(s) you are trying to retrieve - public async Task> GetFilingsReturnsAsync(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region) + /// The filing calendar id of the return you are trying to retrieve + public async Task> GetFilingsReturnsAsync(Int32 companyId, Int32? endPeriodMonth, Int32? endPeriodYear, FilingFrequencyId? frequency, FilingStatusId? status, String country, String region, Int64? filingCalendarId) { var path = new AvaTaxPath("/api/v2/companies/{companyId}/filings/returns"); path.ApplyField("companyId", companyId); @@ -10145,6 +10632,7 @@ public async Task> GetFilingsReturnsAsync(In path.AddQuery("status", status); path.AddQuery("country", country); path.AddQuery("region", region); + path.AddQuery("filingCalendarId", filingCalendarId); return await RestCallAsync>("Get", path, null).ConfigureAwait(false); } @@ -10357,9 +10845,24 @@ public async Task RequestFreeTrialAsync(FreeTrialRequestModel m /// The street address of the location. /// The street address of the location. /// The city name of the location. - /// The state or region of the location + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// The postal code of the location. - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. public async Task TaxRatesByAddressAsync(String line1, String line2, String line3, String city, String region, String postalCode, String country) { var path = new AvaTaxPath("/api/v2/taxrates/byaddress"); @@ -10375,11 +10878,13 @@ public async Task TaxRatesByAddressAsync(String line1, String line /// - /// FREE API - Sales tax rates for a specified country and postal code; + /// FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes.; /// /// /// # Free-To-Use /// + /// This API is only available for a US postal codes. + /// /// The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. /// Any customer can request a free AvaTax account and make use of the TaxRates API. /// @@ -10404,7 +10909,15 @@ public async Task TaxRatesByAddressAsync(String line1, String line /// Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) /// for information on how to upgrade to the full AvaTax CreateTransaction API.; /// - /// The two letter ISO-3166 country code. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// The postal code of the location. public async Task TaxRatesByPostalCodeAsync(String country, String postalCode) { @@ -10903,6 +11416,341 @@ public async Task ValidateLocationAsync(Int32 companyId } + /// + /// Adjust a MultiDocument transaction; + /// + /// + /// Adjusts the current MultiDocument transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you adjust a transaction, that transaction's status is recorded as `Adjusted`. + /// + /// Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments.; + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// Specifies objects to include in this fetch call + /// The adjust request you wish to execute + public async Task AdjustMultiDocumentTransactionAsync(String code, DocumentType type, String include, AdjustMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/adjust"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("include", include); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Get audit information about a MultiDocument transaction; + /// + /// + /// Retrieve audit information about a MultiDocument transaction stored in AvaTax. + /// + /// The audit API retrieves audit information related to a specific MultiDocument transaction. This audit + /// information includes the following: + /// + /// * The `code` of the MultiDocument transaction + /// * The `type` of the MultiDocument transaction + /// * The server timestamp representing the exact server time when the transaction was created + /// * The server duration - how long it took to process this transaction + /// * Whether exact API call details were logged + /// * A reconstructed API call showing what the original create call looked like + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds).; + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + public async Task AuditMultiDocumentTransactionAsync(String code, DocumentType type) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/audit"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Commit a MultiDocument transaction; + /// + /// + /// Marks a list of transactions by changing its status to `Committed`. + /// + /// Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Any changes made to a committed transaction will generate a transaction history.; + /// + /// The commit request you wish to execute + public async Task CommitMultiDocumentTransactionAsync(CommitMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/commit"); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Create a new MultiDocument transaction; + /// + /// + /// Records a new MultiDocument transaction in AvaTax. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This API will report an error if you attempt to create a transaction when one already exists with the specified `code`. + /// If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust` + /// value to `true`. + /// + /// To generate a refund for a transaction, use the `RefundTransaction` API. + /// + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. + /// + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.; + /// + /// Specifies objects to include in the response after transaction is created + /// the multi document transaction model + public async Task CreateMultiDocumentTransactionAsync(String include, CreateMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$include", include); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Retrieve a MultiDocument transaction; + /// + /// + /// Get the current MultiDocument transaction identified by this URL. + /// + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size); + /// + /// + /// + /// Specifies objects to include in the response after transaction is created + public async Task GetMultiDocumentTransactionByCodeAndTypeAsync(String code, DocumentType type, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Retrieve a MultiDocument transaction by ID; + /// + /// + /// Get the unique MultiDocument transaction identified by this URL. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted + /// by using the `AdjustTransaction` endpoint. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size); + /// + /// The unique ID number of the MultiDocument transaction to retrieve + /// Specifies objects to include in the response after transaction is created + public async Task GetMultiDocumentTransactionByIdAsync(Int64 id, String include) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{id}"); + path.ApplyField("id", id); + path.AddQuery("$include", include); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Retrieve all MultiDocument transactions; + /// + /// + /// List all MultiDocument transactions within this account. + /// + /// This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument + /// transactions, please use the pagination features of the API. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size); + /// + /// A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . + /// Specifies objects to include in the response after transaction is created + /// If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. + /// If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public async Task> ListMultiDocumentTransactionsAsync(String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument"); + path.AddQuery("$filter", filter); + path.AddQuery("$include", include); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Create a refund for a MultiDocument transaction; + /// + /// + /// Create a refund for a MultiDocument transaction. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + /// The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund + /// for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and + /// specify individual line items from the original sale for refund. + /// + /// The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that + /// was calculated during the original transaction, regardless of any changes to your company's configuration, rules, + /// nexus, or any other setting. + /// + /// This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following + /// common refund scenarios: + /// + /// * A full refund of a previous sale + /// * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase + /// * Refunding one or more items (lines) from a previous sale + /// * Granting a customer a percentage refund of a previous sale + /// + /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to + /// create a custom refund transaction. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// * Lines + /// * Details (implies lines) + /// * Summary (implies details) + /// * Addresses + /// * SummaryOnly (omit lines and details - reduces API response size) + /// * LinesOnly (omit details - reduces API response size) + /// + /// If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.; + /// + /// The code of this MultiDocument transaction + /// The type of this MultiDocument transaction + /// Specifies objects to include in the response after transaction is created + /// Information about the refund to create + public async Task RefundMultiDocumentTransactionAsync(String code, DocumentType type, String include, RefundTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/refund"); + path.ApplyField("code", code); + path.ApplyField("type", type); + path.AddQuery("$include", include); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Verify a MultiDocument transaction; + /// + /// + /// Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values. + /// + /// If the transaction does not match these expected values, this API will return an error code indicating which value did not match. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds).; + /// + /// Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax + public async Task VerifyMultiDocumentTransactionAsync(VerifyMultiDocumentModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/verify"); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Void a MultiDocument transaction; + /// + /// + /// Voids the current transaction uniquely identified by this URL. + /// + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// When you void a transaction, that transaction's status is recorded as `DocVoided`. + /// + /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`, + /// and they are no longer available to be voided.; + /// + /// The transaction code for this MultiDocument transaction + /// The transaction type for this MultiDocument transaction + /// The void request you wish to execute + public async Task VoidMultiDocumentTransactionAsync(String code, DocumentType type, VoidTransactionModel model) + { + var path = new AvaTaxPath("/api/v2/transactions/multidocument/{code}/type/{type}/void"); + path.ApplyField("code", code); + path.ApplyField("type", type); + return await RestCallAsync("Post", path, model).ConfigureAwait(false); + } + + /// /// Create a new nexus; /// @@ -11555,26 +12403,6 @@ public async Task> CreateSubscriptionsAsync(Int32 accoun } - /// - /// Create new users; - /// - /// - /// # For Registrar Use Only - /// This API is for use by Avalara Registrar administrative users only. - /// - /// Create one or more new user objects attached to this account. - /// A user represents one person with access privileges to make API calls and work with a specific account.; - /// - /// The unique ID number of the account where these users will be created. - /// The user or array of users you wish to create. - public async Task> CreateUsersAsync(Int32 accountId, List model) - { - var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); - path.ApplyField("accountId", accountId); - return await RestCallAsync>("Post", path, model).ConfigureAwait(false); - } - - /// /// Delete a single account; /// @@ -12292,6 +13120,35 @@ public async Task BuildTaxContentFileForLocationAsync(Int32 companyI } + /// + /// Download a file listing tax rates by postal code; + /// + /// + /// Download a CSV file containing all five digit postal codes in the United States and their sales + /// and use tax rates for tangible personal property. + /// + /// This rates file is intended to be used as a default for tax calculation when your software cannot + /// call the `CreateTransaction` API call. When using this file, your software will be unable to + /// handle complex tax rules such as: + /// + /// * Zip+9 - This tax file does not contain + /// * Different product types - This tax file contains tangible personal property tax rates only. + /// * Mixed sourcing - This tax file cannot be used to resolve origin-based taxes. + /// * Threshold-based taxes - This tax file does not contain information about thresholds. + /// + /// If you use this file to provide default tax rates, please ensure that your software calls `CreateTransaction` + /// to reconcile the actual transaction and determine the difference between the estimated general tax + /// rate and the final transaction tax.; + /// + /// The date for which point-of-sale data would be calculated (today by default). Example input: 2016-12-31 + public async Task DownloadTaxRatesByZipCodeAsync(DateTime date) + { + var path = new AvaTaxPath("/api/v2/taxratesbyzipcode/download/{date}"); + path.ApplyField("date", date); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + /// /// Create a new tax rule; /// @@ -12450,7 +13307,7 @@ public async Task UpdateTaxRuleAsync(Int32 companyId, Int32 id, Ta /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12587,8 +13444,13 @@ public async Task BulkLockTransactionAsync(BulkLockTr /// Change a transaction's code; /// /// - /// Renames a transaction uniquely identified by this URL by changing its code to a new code. - /// After this API call succeeds, the transaction will have a new URL matching its new code. + /// Renames a transaction uniquely identified by this URL by changing its `code` value. + /// + /// This API is available as long as the transaction is in `saved` or `posted` status. When a transaction + /// is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method. + /// + /// After this API call succeeds, the transaction will have a new URL matching its new `code`. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds).; /// @@ -12647,7 +13509,7 @@ public async Task CommitTransactionAsync(String companyCode, S /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12675,8 +13537,11 @@ public async Task CreateOrAdjustTransactionAsync(String includ /// /// Records a new transaction in AvaTax. /// - /// The `CreateTransaction` endpoint uses the configuration values specified by your company to identify the correct tax rules - /// and rates to apply to all line items in this transaction, and reports the total tax calculated by AvaTax based on your + /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + /// sales, purchases, inventory transfer, and returns (also called refunds). + /// + /// The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules + /// and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your /// company's configuration and the data provided in this API call. /// /// The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To @@ -12685,11 +13550,15 @@ public async Task CreateOrAdjustTransactionAsync(String includ /// /// To generate a refund for a transaction, use the `RefundTransaction` API. /// - /// If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database. + /// The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + /// a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. /// - /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + /// provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + /// information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + /// using the best available address location information. + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12722,7 +13591,7 @@ public async Task CreateTransactionAsync(String include, Creat /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12751,8 +13620,7 @@ public async Task DeleteLinesAsync(String include, RemoveTrans /// /// To fetch other kinds of transactions, use `GetTransactionByCodeAndType`. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -12782,8 +13650,7 @@ public async Task GetTransactionByCodeAsync(String companyCode /// /// Get the current transaction identified by this URL. /// - /// If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of - /// the transaction will be attached to the `history` data field. + /// If this transaction was adjusted, the return value of this API will be the current transaction with this code. /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// @@ -12814,11 +13681,14 @@ public async Task GetTransactionByCodeAndTypeAsync(String comp /// /// /// Get the unique transaction identified by this URL. + /// /// This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted - /// by using the 'Adjust Transaction' endpoint. + /// by using the `AdjustTransaction` endpoint. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -12843,12 +13713,18 @@ public async Task GetTransactionByIdAsync(Int64 id, String inc /// /// /// List all transactions attached to this company. + /// /// This endpoint is limited to returning 1,000 transactions at a time maximum. + /// + /// When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field + /// criteria, the query will default to looking at only those transactions with `date` in the past 30 days. + /// /// A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like /// sales, purchases, inventory transfer, and returns (also called refunds). /// /// Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . /// Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + /// /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines @@ -12928,7 +13804,7 @@ public async Task LockTransactionAsync(String companyCode, Str /// For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to /// create a custom refund transaction. /// - /// You may specify one or more of the following values in the '$include' parameter to fetch additional nested data, using commas to separate multiple values: + /// You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values: /// /// * Lines /// * Details (implies lines) @@ -13143,6 +14019,30 @@ public async Task UpdateUPCAsync(Int32 companyId, Int32 id, UPCModel m } + /// + /// Create new users; + /// + /// + /// Create one or more new user objects attached to this account. + /// + /// A user represents one person with access privileges to make API calls and work with a specific account. + /// + /// Users who are account administrators or company users are permitted to create user records to invite + /// additional team members to work with AvaTax. + /// + /// A newly created user will receive an email inviting them to create their password. This means that you + /// must provide a valid email address for all user accounts created.; + /// + /// The unique ID number of the account where these users will be created. + /// The user or array of users you wish to create. + public async Task> CreateUsersAsync(Int32 accountId, List model) + { + var path = new AvaTaxPath("/api/v2/accounts/{accountId}/users"); + path.ApplyField("accountId", accountId); + return await RestCallAsync>("Post", path, model).ConfigureAwait(false); + } + + /// /// Retrieve a single user; /// diff --git a/src/Avalara.AvaTax.nuspec b/src/Avalara.AvaTax.nuspec index 4f5c60e0..6ab787ca 100644 --- a/src/Avalara.AvaTax.nuspec +++ b/src/Avalara.AvaTax.nuspec @@ -2,7 +2,7 @@ Avalara.AvaTax - 17.9.0.126 + 17.12.0.147 Avalara AvaTax SDK Add world-class tax estimation and calculation to your project with Avalara's AvaTax suite of APIs and services. Ted Spence, Zhenya Frolov diff --git a/src/enums/DocumentType.cs b/src/enums/DocumentType.cs index 69c68e75..ff88ba11 100644 --- a/src/enums/DocumentType.cs +++ b/src/enums/DocumentType.cs @@ -15,62 +15,139 @@ namespace Avalara.AvaTax.RestClient { /// - /// Document Types + /// Represents the different types of transactions that AvaTax can process. /// public enum DocumentType { /// - /// Sales Order, estimate or quote (default). This is a temporary document type and is not saved in tax history. + /// Represents an estimate, or a sales order, or a quote. + /// + /// This document type is used before a sale has occurred to estimate the final amount of tax to be paid when the + /// sale is completed. + /// + /// For a sales order, the `companyCode` of the transaction refers to the seller and the `customerVendorCode` refers to the buyer. + /// + /// This is a temporary document type and is not saved in tax history. /// SalesOrder, /// - /// Sales Invoice + /// Represents a sale that has been finalized. + /// + /// This document type is used to record a final transaction and calculate the final tax amount with all necessary information. + /// + /// For a sales invoice, the `companyCode` of the transaction refers to the seller and the `customerVendorCode` refers to the buyer. + /// + /// This is a permanent document and is recorded in AvaTax. /// SalesInvoice, /// - /// Purchase order, estimate, or quote. This is a temporary document type and is not saved in tax history. + /// Represents an estimate, or a purchase order, or a quote. + /// + /// This document type is used before a sale has occurred to estimate the final amount of tax to be paid when the + /// sale is completed. + /// + /// For a purchase order, the `companyCode` of the transaction refers to the buyer and the `customerVendorCode` refers to the seller. + /// + /// This is a temporary document type and is not saved in tax history. /// PurchaseOrder, /// - /// Purchase Invoice + /// Represents a sale that has been finalized. + /// + /// This document type is used to record a final transaction and calculate the final tax amount with all necessary information. + /// + /// For a purchase invoice, the `companyCode` of the transaction refers to the buyer and the `customerVendorCode` refers to the seller. + /// + /// This is a permanent document and is recorded in AvaTax. /// PurchaseInvoice, /// - /// Sales Return Order. This is a temporary document type and is not saved in tax history. + /// Represents an estimate of tax to be refunded if a refund or return is processed. + /// + /// This document type is used before a customer chooses to request a refund for a previous sale, and it + /// estimates the final amount of tax to be refunded when the refund is completed. + /// + /// For a return order, the `companyCode` of the transaction refers to the seller who is giving the refund + /// and the `customerVendorCode` refers to the buyer who is requesting the refund. + /// + /// This is a temporary document type and is not saved in tax history. /// ReturnOrder, /// - /// Sales Return Invoice + /// Represents an refund that has been finalized. + /// + /// This document type is used when a customer chooses to request a refund for a previous sale, and it + /// records the final amount of tax that has been refunded when the refund is completed. + /// + /// For a return invoice, the `companyCode` of the transaction refers to the seller who is giving the refund + /// and the `customerVendorCode` refers to the buyer who is requesting the refund. + /// + /// This is a permanent document and is recorded in AvaTax. + /// + /// Please note that many jurisdictions around the United States have special rules about how to report refunds + /// on a sales tax filing, and some refund transactions may be unable to file immediately due to credit netting + /// rules. /// ReturnInvoice, /// - /// InventoryTransferOrder + /// Represents a proposed movement of inventory from one jurisdiction to another. + /// + /// This document type is used when physical goods are shipped from one jurisdiction to another, and it + /// may cause updates in the tax liability for various jurisdictions. + /// + /// For an inventory transfer invoice, the `companyCode` of the transaction refers to the owner of the inventory + /// that will be moved from one location to another. + /// + /// This is a temporary document type and is not saved in tax history. /// InventoryTransferOrder, /// - /// InventoryTransferInvoice + /// Represents a movement of inventory from one jurisdiction to another that has been finalized. + /// + /// This document type is used when physical goods are shipped from one jurisdiction to another, and it + /// may cause updates in the tax liability for various jurisdictions. + /// + /// For an inventory transfer invoice, the `companyCode` of the transaction refers to the owner of the inventory + /// that will be moved from one location to another. + /// + /// This is a permanent document and is recorded in AvaTax. /// InventoryTransferInvoice, /// - /// ReverseChargeOrder + /// Represents a VAT "Reverse Charge" mechanism transaction as defined in the European Union. + /// + /// A Reverse Charge transaction moves the responsibility for VAT reporting from the seller to the buyer, and + /// is intended to allow simplification of commerce and reduce the reporting requirements for sellers that deliver + /// goods and services into the single market. + /// + /// This is a temporary document type and is not saved in tax history. /// ReverseChargeOrder, /// - /// ReverseChargeInvoice + /// Represents a VAT "Reverse Charge" mechanism transaction as defined in the European Union. + /// + /// A Reverse Charge transaction moves the responsibility for VAT reporting from the seller to the buyer, and + /// is intended to allow simplification of commerce and reduce the reporting requirements for sellers that deliver + /// goods and services into the single market. + /// + /// This is a permanent document and is recorded in AvaTax. /// ReverseChargeInvoice, /// - /// No particular type + /// Not a real document type. + /// + /// This value is used when querying for documents. You can specify the type `Any` in some cases to permit the + /// system to find any document matching other criteria. /// Any, diff --git a/src/enums/ErrorCodeId.cs b/src/enums/ErrorCodeId.cs index 56d3c51a..e96c9fcb 100644 --- a/src/enums/ErrorCodeId.cs +++ b/src/enums/ErrorCodeId.cs @@ -79,6 +79,11 @@ public enum ErrorCodeId /// StringLengthError, + /// + /// + /// + MaxStringLengthError, + /// /// /// @@ -589,6 +594,26 @@ public enum ErrorCodeId /// FailedToDownloadReport, + /// + /// + /// + MalformedFilterException, + + /// + /// + /// + ExpectedConjunctionError, + + /// + /// + /// + CriteriaNotSupportedError, + + /// + /// + /// + CompanyAccountAndParentAccountMismatch, + /// /// Batch errors /// @@ -619,6 +644,16 @@ public enum ErrorCodeId /// BatchCannotDeleteBatchFile, + /// + /// + /// + BatchMustContainOneFile, + + /// + /// + /// + MissingBatchFileContent, + /// /// Point Of Sale API exceptions /// @@ -724,6 +759,11 @@ public enum ErrorCodeId /// InvalidAddress, + /// + /// + /// + InvalidPostalCode, + /// /// Represents a malformed document fetch command /// @@ -819,6 +859,11 @@ public enum ErrorCodeId /// RefundPercentageOutOfRange, + /// + /// + /// + RefundPercentageMissing, + /// /// Free API error codes /// @@ -955,20 +1000,65 @@ public enum ErrorCodeId InvalidCoverLetterTitle, /// - /// Multi company error codes + /// Multi document error codes /// TransactionNotCancelled, /// /// /// - TooManyTransactionLines, + TooManyTransactions, /// /// /// OnlyTaxDateOverrideIsAllowed, + /// + /// + /// + TransactionAlreadyExists, + + /// + /// + /// + DateMismatch, + + /// + /// + /// + InvalidDocumentStatusForVerify, + + /// + /// + /// + TotalAmountMismatch, + + /// + /// + /// + TotalTaxMismatch, + + /// + /// + /// + InvalidDocumentStatusForCommit, + + /// + /// + /// + InvalidDocumentType, + + /// + /// + /// + MultiDocumentPartiallyLocked, + + /// + /// + /// + TransactionIsCommitted, + /// /// Communications Tax error codes /// @@ -994,5 +1084,10 @@ public enum ErrorCodeId /// AccountInNewStatusException, + /// + /// Worksheet Exception + /// + WorksheetException, + } } diff --git a/src/models/AddressInfo.cs b/src/models/AddressInfo.cs index bd7d4d05..58f15008 100644 --- a/src/models/AddressInfo.cs +++ b/src/models/AddressInfo.cs @@ -42,12 +42,27 @@ public class AddressInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/AddressLocationInfo.cs b/src/models/AddressLocationInfo.cs index 6e54e0a5..e546dcc9 100644 --- a/src/models/AddressLocationInfo.cs +++ b/src/models/AddressLocationInfo.cs @@ -48,12 +48,27 @@ public class AddressLocationInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/AddressValidationInfo.cs b/src/models/AddressValidationInfo.cs index a23ced7c..ddc94dde 100644 --- a/src/models/AddressValidationInfo.cs +++ b/src/models/AddressValidationInfo.cs @@ -47,12 +47,27 @@ public class AddressValidationInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/AddressesModel.cs b/src/models/AddressesModel.cs index 15aedde4..f3c9654d 100644 --- a/src/models/AddressesModel.cs +++ b/src/models/AddressesModel.cs @@ -27,6 +27,11 @@ namespace Avalara.AvaTax.RestClient /// /// In the United States, some jurisdictions recognize the address types `pointOfOrderOrigin` and `pointOfOrderAcceptance`. /// These address types affect the sourcing models of some transactions. + /// + /// If latitude and longitude information is provided for any of these addresses along with line, city, region, country and postal code information, + /// we will be using only latitude and longitude and will discard line, city, region, country and postal code information for the transaction. + /// Please ensure that you have the correct latitude/longitude information for the addresses prior to using the API. + /// If you provide either latitude or longitude information but not both, we will be using the line, city, region, country and postal code information for the addresses. /// public class AddressesModel { diff --git a/src/models/AdjustMultiDocumentModel.cs b/src/models/AdjustMultiDocumentModel.cs new file mode 100644 index 00000000..362de5ea --- /dev/null +++ b/src/models/AdjustMultiDocumentModel.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Replace an existing MultiDocument transaction recorded in AvaTax with a new one. + /// + public class AdjustMultiDocumentModel + { + /// + /// A reason code indicating why this adjustment was made + /// + public AdjustmentReason adjustmentReason { get; set; } + + /// + /// If the AdjustmentReason is "Other", specify the reason here. + /// + /// This is required when the AdjustmentReason is 8 (Other). + /// + public String adjustDescription { get; set; } + + /// + /// Replace the current MultiDocument transaction with tax data calculated for this new MultiDocument transaction + /// + public CreateMultiDocumentModel newTransaction { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/AdjustTransactionModel.cs b/src/models/AdjustTransactionModel.cs index 76c31939..d781bbaf 100644 --- a/src/models/AdjustTransactionModel.cs +++ b/src/models/AdjustTransactionModel.cs @@ -17,7 +17,7 @@ namespace Avalara.AvaTax.RestClient { /// - /// A request to adjust tax for a previously existing transaction + /// Replace an existing transaction recorded in AvaTax with a new one. /// public class AdjustTransactionModel { diff --git a/src/models/AuditMultiDocumentModel.cs b/src/models/AuditMultiDocumentModel.cs new file mode 100644 index 00000000..9fc03888 --- /dev/null +++ b/src/models/AuditMultiDocumentModel.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Information about a previously created MultiDocument transaction + /// + public class AuditMultiDocumentModel + { + /// + /// Reconstructed API request/response pair that can be used to adjust or re-create this MultiDocument transaction. + /// + public ReconstructedMultiDocumentModel reconstructed { get; set; } + + /// + /// Represents the unique code of this MultiDocument transaction. + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public String code { get; set; } + + /// + /// Represents the document type of this MultiDocument transaction. For more information about + /// document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/). + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public DocumentType? type { get; set; } + + /// + /// Server timestamp, in UTC, of the date/time when the original transaction was created + /// + public DateTime? serverTimestamp { get; set; } + + /// + /// Length of time the original API call took + /// + public DateTime? serverDuration { get; set; } + + /// + /// api call status + /// + public ApiCallStatus? apiCallStatus { get; set; } + + /// + /// Original API request/response + /// + public OriginalApiRequestResponseModel original { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/AuditTransactionModel.cs b/src/models/AuditTransactionModel.cs index 481dfc98..1cfdc2c4 100644 --- a/src/models/AuditTransactionModel.cs +++ b/src/models/AuditTransactionModel.cs @@ -26,6 +26,11 @@ public class AuditTransactionModel /// public Int32? companyId { get; set; } + /// + /// Reconstructed API request/response + /// + public ReconstructedApiRequestResponseModel reconstructed { get; set; } + /// /// Server timestamp, in UTC, of the date/time when the original transaction was created /// @@ -46,11 +51,6 @@ public class AuditTransactionModel /// public OriginalApiRequestResponseModel original { get; set; } - /// - /// Reconstructed API request/response - /// - public ReconstructedApiRequestResponseModel reconstructed { get; set; } - /// /// Convert this object to a JSON string of itself diff --git a/src/models/CommitMultiDocumentModel.cs b/src/models/CommitMultiDocumentModel.cs new file mode 100644 index 00000000..806bd45b --- /dev/null +++ b/src/models/CommitMultiDocumentModel.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Commit this MultiDocument object so that all transactions within it can be reported on a tax filing. + /// + public class CommitMultiDocumentModel + { + /// + /// Represents the unique code of this MultiDocument transaction. + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. /// + /// + public String code { get; set; } + + /// + /// Represents the document type of this MultiDocument transaction. For more information about + /// document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/). + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public DocumentType? type { get; set; } + + /// + /// Set this value to be `true` to commit this transaction. + /// + /// Committing a transaction allows it to be reported on a tax filing. Uncommitted transactions will not be reported. + /// + public Boolean commit { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/CommitTransactionModel.cs b/src/models/CommitTransactionModel.cs index dfd50753..de12c288 100644 --- a/src/models/CommitTransactionModel.cs +++ b/src/models/CommitTransactionModel.cs @@ -17,13 +17,14 @@ namespace Avalara.AvaTax.RestClient { /// - /// Commit this transaction as permanent + /// Commit this transaction as permanent so that it can be reported on a tax filing. /// public class CommitTransactionModel { /// - /// Set this value to be true to commit this transaction. - /// Committing a transaction allows it to be reported on a tax return. Uncommitted transactions will not be reported. + /// Set this value to be `true` to commit this transaction. + /// + /// Committing a transaction allows it to be reported on a tax filing. Uncommitted transactions will not be reported. /// public Boolean commit { get; set; } diff --git a/src/models/CompanyAddress.cs b/src/models/CompanyAddress.cs index 0401ff4b..1cd9b769 100644 --- a/src/models/CompanyAddress.cs +++ b/src/models/CompanyAddress.cs @@ -32,12 +32,27 @@ public class CompanyAddress public String city { get; set; } /// - /// Two character ISO 3166 Region code for this company's primary business location. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country code for this company's primary business location. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/CompanyInitializationModel.cs b/src/models/CompanyInitializationModel.cs index ecc4f746..c9e8295b 100644 --- a/src/models/CompanyInitializationModel.cs +++ b/src/models/CompanyInitializationModel.cs @@ -65,7 +65,14 @@ public class CompanyInitializationModel public String city { get; set; } /// - /// Two character ISO 3166 Region code for this company's primary business location. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -75,7 +82,15 @@ public class CompanyInitializationModel public String postalCode { get; set; } /// - /// Two character ISO 3166 Country code for this company's primary business location. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/ContactModel.cs b/src/models/ContactModel.cs index fcf958a4..183e14b0 100644 --- a/src/models/ContactModel.cs +++ b/src/models/ContactModel.cs @@ -77,7 +77,14 @@ public class ContactModel public String city { get; set; } /// - /// The state, region, or province of the postal mailing address of this contact. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -87,7 +94,15 @@ public class ContactModel public String postalCode { get; set; } /// - /// The ISO 3166 two-character country code of the postal mailing address of this contact. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/CreateMultiDocumentModel.cs b/src/models/CreateMultiDocumentModel.cs new file mode 100644 index 00000000..36fcb54d --- /dev/null +++ b/src/models/CreateMultiDocumentModel.cs @@ -0,0 +1,241 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// A MultiDocument transaction represents a sale or purchase that occurred between more than two companies. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + public class CreateMultiDocumentModel + { + /// + /// The transaction code of the MultiDocument transaction. + /// + /// All individual transactions within this MultiDocument object will have this code as a prefix. + /// + /// If you leave the `code` field blank, a GUID will be assigned. + /// + public String code { get; set; } + + /// + /// Lines that will appear on the invoice. + /// + /// For a MultiDocument transaction, each line may represent a different company or reporting location code. AvaTax + /// will separate this MultiDocument transaction object into many different transactions, one for each pair of legal + /// entities, so that each legal entity can file their transactional taxes correctly. + /// + public List lines { get; set; } + + /// + /// Set this value to true to allow this API call to adjust the MultiDocument model if one already exists. + /// + /// If you omit this field, or if the value is `null`, you will receive an error if you try to create two MultiDocument + /// objects with the same `code`. + /// + public Boolean? allowAdjust { get; set; } + + /// + /// Specifies the type of document to create. A document type ending with `Invoice` is a permanent transaction + /// that will be recorded in AvaTax. A document type ending with `Order` is a temporary estimate that will not + /// be preserved. + /// + /// If you omit this value, the API will assume you want to create a `SalesOrder`. + /// + public DocumentType? type { get; set; } + + /// + /// Company Code - Specify the code of the company creating this transaction here. If you leave this value null, + /// your account's default company will be used instead. + /// + public String companyCode { get; set; } + + /// + /// Transaction Date - The date on the invoice, purchase order, etc. + /// + /// By default, this date will be used to calculate the tax rates for the transaction. If you wish to use a + /// different date to calculate tax rates, please specify a `taxOverride` of type `taxDate`. + /// + public DateTime date { get; set; } + + /// + /// Salesperson Code - The client application salesperson reference code. + /// + public String salespersonCode { get; set; } + + /// + /// Customer Code - The client application customer reference code. + /// + public String customerCode { get; set; } + + /// + /// DEPRECATED - Customer Usage Type - The client application customer or usage type. For a list of + /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// Please use entityUseCode instead. + /// + public String customerUsageType { get; set; } + + /// + /// Entity Use Code - The client application customer or usage type. For a list of + /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// + public String entityUseCode { get; set; } + + /// + /// Discount - The discount amount to apply to the document. This value will be applied only to lines + /// that have the `discounted` flag set to true. If no lines have `discounted` set to true, this discount + /// cannot be applied. + /// + public Decimal? discount { get; set; } + + /// + /// Purchase Order Number for this document. + /// + /// This is required for single use exemption certificates to match the order and invoice with the certificate. + /// + public String purchaseOrderNo { get; set; } + + /// + /// Exemption Number for this document. + /// + /// If you specify an exemption number for this document, this document will be considered exempt, and you + /// may be asked to provide proof of this exemption certificate in the event that you are asked by an auditor + /// to verify your exemptions. + /// + public String exemptionNo { get; set; } + + /// + /// Default addresses for all lines in this document. + /// + /// These addresses are the default values that will be used for any lines that do not have their own + /// address information. If you specify addresses for a line, then no default addresses will be loaded + /// for that line. + /// + public AddressesModel addresses { get; set; } + + /// + /// Special parameters for this transaction. + /// + /// To get a full list of available parameters, please use the `/api/v2/definitions/parameters` endpoint. + /// + public Dictionary parameters { get; set; } + + /// + /// Customer-provided Reference Code with information about this transaction. + /// + /// This field could be used to reference the original document for a return invoice, or for any other + /// reference purpose. + /// + public String referenceCode { get; set; } + + /// + /// Sets the sale location code (Outlet ID) for reporting this document to the tax authority. + /// + /// This value is used by Avalara Managed Returns to group documents together by reporting locations + /// for tax authorities that require location-based reporting. + /// + public String reportingLocationCode { get; set; } + + /// + /// Causes the document to be committed if true. This option is only applicable for invoice document + /// types, not orders. + /// + public Boolean? commit { get; set; } + + /// + /// BatchCode for batch operations. + /// + public String batchCode { get; set; } + + /// + /// Specifies a tax override for the entire document + /// + public TaxOverrideModel taxOverride { get; set; } + + /// + /// The three-character ISO 4217 currency code for this transaction. + /// + public String currencyCode { get; set; } + + /// + /// Specifies whether the tax calculation is handled Local, Remote, or Automatic (default). This only + /// applies when using an AvaLocal server. + /// + public ServiceMode? serviceMode { get; set; } + + /// + /// Currency exchange rate from this transaction to the company base currency. + /// + /// This only needs to be set if the transaction currency is different than the company base currency. + /// It defaults to 1.0. + /// + public Decimal? exchangeRate { get; set; } + + /// + /// Effective date of the exchange rate. + /// + public DateTime? exchangeRateEffectiveDate { get; set; } + + /// + /// Sets the Point of Sale Lane Code sent by the User for this document. + /// + public String posLaneCode { get; set; } + + /// + /// VAT business identification number for the customer for this transaction. This number will be used for all lines + /// in the transaction, except for those lines where you have defined a different business identification number. + /// + /// If you specify a VAT business identification number for the customer in this transaction and you have also set up + /// a business identification number for your company during company setup, this transaction will be treated as a + /// business-to-business transaction for VAT purposes and it will be calculated according to VAT tax rules. + /// + public String businessIdentificationNo { get; set; } + + /// + /// Specifies if the Transaction has the seller as IsSellerImporterOfRecord. + /// + public Boolean? isSellerImporterOfRecord { get; set; } + + /// + /// User-supplied description for this transaction. + /// + public String description { get; set; } + + /// + /// User-supplied email address relevant for this transaction. + /// + public String email { get; set; } + + /// + /// If the user wishes to request additional debug information from this transaction, specify a level higher than `normal`. + /// + public TaxDebugLevel? debugLevel { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/CreateTransactionModel.cs b/src/models/CreateTransactionModel.cs index 0ada242a..7e09c4fc 100644 --- a/src/models/CreateTransactionModel.cs +++ b/src/models/CreateTransactionModel.cs @@ -22,13 +22,13 @@ namespace Avalara.AvaTax.RestClient public class CreateTransactionModel { /// - /// Transaction Code - the internal reference code used by the client application. This is used for operations such as + /// The internal reference code used by the client application. This is used for operations such as /// Get, Adjust, Settle, and Void. If you leave the transaction code blank, a GUID will be assigned to each transaction. /// public String code { get; set; } /// - /// Document line items list + /// A list of line items that will appear on this transaction. /// public List lines { get; set; } @@ -66,11 +66,18 @@ public class CreateTransactionModel public String customerCode { get; set; } /// - /// Customer Usage Type - The client application customer or usage type. For a list of + /// DEPRECATED - Customer Usage Type - The client application customer or usage type. For a list of /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// Entity Use Code - The client application customer or usage type. For a list of + /// available usage types, see `/api/v2/definitions/entityusecodes`. + /// + public String entityUseCode { get; set; } + /// /// Discount - The discount amount to apply to the document. This value will be applied only to lines /// that have the `discounted` flag set to true. If no lines have `discounted` set to true, this discount diff --git a/src/models/CustomerModel.cs b/src/models/CustomerModel.cs index 0d7ff0ed..d4dd83d5 100644 --- a/src/models/CustomerModel.cs +++ b/src/models/CustomerModel.cs @@ -112,12 +112,27 @@ public class CustomerModel public DateTime? modifiedDate { get; set; } /// - /// Two character ISO 3166 county code for the country component of the address of this customer. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// Two or three character ISO 3166 region, province, or state name of the address of this customer. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } diff --git a/src/models/EcmsDetailModel.cs b/src/models/EcmsDetailModel.cs index 09aeca20..8f6e570e 100644 --- a/src/models/EcmsDetailModel.cs +++ b/src/models/EcmsDetailModel.cs @@ -37,7 +37,14 @@ public class EcmsDetailModel public String stateFips { get; set; } /// - /// Region or State + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -47,7 +54,15 @@ public class EcmsDetailModel public String idNo { get; set; } /// - /// Country that this exempt certificate is for + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/EcmsModel.cs b/src/models/EcmsModel.cs index 8695d7f0..e8faf985 100644 --- a/src/models/EcmsModel.cs +++ b/src/models/EcmsModel.cs @@ -62,7 +62,14 @@ public class EcmsModel public String city { get; set; } /// - /// Region + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -72,7 +79,15 @@ public class EcmsModel public String postalCode { get; set; } /// - /// Country + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } @@ -112,7 +127,9 @@ public class EcmsModel public DateTime? effectiveDate { get; set; } /// - /// Applicable regions for this exempt certificate + /// A list of applicable regions for this exempt certificate. + /// + /// To list more than one applicable region, separate the list of region codes with commas. /// public String regionsApplicable { get; set; } @@ -152,7 +169,15 @@ public class EcmsModel public Int32? modifiedUserId { get; set; } /// - /// Which country issued this exempt certificate + /// Name or ISO 3166 code identifying the country that issued this ECMS certificate. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String countryIssued { get; set; } diff --git a/src/models/FilingCalendarModel.cs b/src/models/FilingCalendarModel.cs index c93cd13f..643e6d90 100644 --- a/src/models/FilingCalendarModel.cs +++ b/src/models/FilingCalendarModel.cs @@ -38,12 +38,27 @@ public class FilingCalendarModel public String returnName { get; set; } /// - /// The two character ISO 3166 country code of the country that issued the tax form for this filing calendar. + /// Name or ISO 3166 code identifying the country that issued the tax form for this filing calendar. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String formCountry { get; set; } /// - /// The two or three character ISO 3166 code of the region / state / province that issued the tax form for this filing calendar. + /// Name or ISO 3166 code identifying the region that issued the tax form for this filing calendar. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String formRegion { get; set; } @@ -152,7 +167,14 @@ public class FilingCalendarModel public String mailingAddressCity { get; set; } /// - /// The state, region, or province of the mailing address that will be used when filling out this tax return. + /// Name or ISO 3166 code identifying the region of the mailing address that will be used when filling out this tax return. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String mailingAddressRegion { get; set; } @@ -162,7 +184,15 @@ public class FilingCalendarModel public String mailingAddressPostalCode { get; set; } /// - /// The two character ISO-3166 country code of the mailing address that will be used when filling out this tax return. + /// Name or ISO 3166 code identifying the country of the mailing address that will be used when filling out this tax return. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String mailingAddressCountry { get; set; } diff --git a/src/models/FilingReturnModelBasic.cs b/src/models/FilingReturnModelBasic.cs index 5242d6be..136e961a 100644 --- a/src/models/FilingReturnModelBasic.cs +++ b/src/models/FilingReturnModelBasic.cs @@ -36,6 +36,11 @@ public class FilingReturnModelBasic /// public Int64? filingId { get; set; } + /// + /// The resourceFileId of the return + /// + public Int64? resourceFileId { get; set; } + /// /// The region id that this return belongs too /// diff --git a/src/models/FreeTrialRequestModel.cs b/src/models/FreeTrialRequestModel.cs index f969d0ec..d3d5cbbe 100644 --- a/src/models/FreeTrialRequestModel.cs +++ b/src/models/FreeTrialRequestModel.cs @@ -48,6 +48,21 @@ public class FreeTrialRequestModel /// public String phone { get; set; } + /// + /// Campaign identifier for Notification purpose + /// + public String campaign { get; set; } + + /// + /// The Address information of the account + /// + public CompanyAddress companyAddress { get; set; } + + /// + /// Website of the company or user requesting a free trial + /// + public String website { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/FundingConfigurationModel.cs b/src/models/FundingConfigurationModel.cs new file mode 100644 index 00000000..1447dec5 --- /dev/null +++ b/src/models/FundingConfigurationModel.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Status of an Avalara Managed Returns funding configuration for a company + /// + public class FundingConfigurationModel + { + /// + /// CompanyID + /// + public Int32? companyId { get; set; } + + /// + /// Domain + /// + public String systemType { get; set; } + + /// + /// Recipient + /// + public String currency { get; set; } + + /// + /// Sender + /// + public Boolean? isFundingSetup { get; set; } + + /// + /// DocumentKey + /// + public String fundingMethod { get; set; } + + /// + /// LastPolled + /// + public DateTime? lastUpdated { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/IsoCountryModel.cs b/src/models/IsoCountryModel.cs index 797dc11f..c1ee69fe 100644 --- a/src/models/IsoCountryModel.cs +++ b/src/models/IsoCountryModel.cs @@ -27,7 +27,14 @@ public class IsoCountryModel public String code { get; set; } /// - /// The full name of this country as it is known in US English + /// The three character ISO 3166 country code + /// + public String alpha3Code { get; set; } + + /// + /// The full name of this country in uppercase. + /// + /// For names in proper or formal case, or for names in other languages, please examine the `localizedNames` element for an appropriate name. /// public String name { get; set; } @@ -36,6 +43,13 @@ public class IsoCountryModel /// public Boolean? isEuropeanUnion { get; set; } + /// + /// A list of localized names in a variety of languages. + /// + /// This list is maintained by the International Standards Organization. + /// + public List localizedNames { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/IsoLocalizedName.cs b/src/models/IsoLocalizedName.cs new file mode 100644 index 00000000..87df7771 --- /dev/null +++ b/src/models/IsoLocalizedName.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Represents a language-specific localized name of a particular geographic entity such + /// as a country or a region. + /// + public class IsoLocalizedName + { + /// + /// The two-character alphanumeric code identifying the language in which this name is used. + /// + /// Note that languageAlpha2Code and language3AlphaCode refer to the same language. + /// + public String languageAlpha2Code { get; set; } + + /// + /// The three-character alphanumeric code identifying the language in which this name is used. + /// + /// Note that languageAlpha2Code and language3AlphaCode refer to the same language. + /// + public String languageAlpha3Code { get; set; } + + /// + /// The name of this geographic entity as known in this language. + /// + public String name { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/IsoRegionModel.cs b/src/models/IsoRegionModel.cs index 1fc5f1a6..b5bf196d 100644 --- a/src/models/IsoRegionModel.cs +++ b/src/models/IsoRegionModel.cs @@ -32,7 +32,9 @@ public class IsoRegionModel public String code { get; set; } /// - /// The full name, using localized characters, for this region + /// The full name, using localized characters, for this region, in uppercase. + /// + /// For names in proper or formal case, or for names in other languages, please examine the `localizedNames` element for an appropriate name. /// public String name { get; set; } @@ -47,6 +49,13 @@ public class IsoRegionModel /// public Boolean? streamlinedSalesTax { get; set; } + /// + /// A list of localized names in a variety of languages. + /// + /// This list is maintained by the International Standards Organization. + /// + public List localizedNames { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/JurisdictionModel.cs b/src/models/JurisdictionModel.cs index 95207b52..f3911c6a 100644 --- a/src/models/JurisdictionModel.cs +++ b/src/models/JurisdictionModel.cs @@ -52,7 +52,14 @@ public class JurisdictionModel public String signatureCode { get; set; } /// - /// The state assigned code for this jurisdiction, if any. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -72,7 +79,15 @@ public class JurisdictionModel public String county { get; set; } /// - /// The Country name of this jurisdiction + /// Name or ISO 3166 code identifying the country of this jurisdiction. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/JurisdictionOverrideModel.cs b/src/models/JurisdictionOverrideModel.cs index b2651099..05cff908 100644 --- a/src/models/JurisdictionOverrideModel.cs +++ b/src/models/JurisdictionOverrideModel.cs @@ -50,12 +50,22 @@ public class JurisdictionOverrideModel public String city { get; set; } /// - /// The two or three character ISO region code of the region, state, or province affected by this override. + /// Name or ISO 3166 code identifying the region within the country to be affected by this override. + /// + /// Note that only United States addresses are affected by the jurisdiction override system. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// /// The two character ISO-3166 country code of the country affected by this override. + /// /// Note that only United States addresses are affected by the jurisdiction override system. /// public String country { get; set; } diff --git a/src/models/LineItemModel.cs b/src/models/LineItemModel.cs index 412fe622..3e25de66 100644 --- a/src/models/LineItemModel.cs +++ b/src/models/LineItemModel.cs @@ -54,10 +54,16 @@ public class LineItemModel public String taxCode { get; set; } /// - /// Customer Usage Type - The client application customer or usage type. + /// DEPERECATED - Customer Usage Type - The client application customer or usage type. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// Entity Use Code - The client application customer or usage type. + /// + public String entityUseCode { get; set; } + /// /// Item Code (SKU) /// @@ -74,7 +80,11 @@ public class LineItemModel public Boolean? discounted { get; set; } /// - /// Indicates if line has Tax Included; defaults to false + /// Indicates whether the `amount` for this line already includes tax. + /// + /// If this value is `true`, the final price of this line including tax will equal the value in `amount`. + /// + /// If this value is `null` or `false`, the final price will equal `amount` plus whatever taxes apply to this line. /// public Boolean? taxIncluded { get; set; } diff --git a/src/models/LocationModel.cs b/src/models/LocationModel.cs index bb9ce5e7..2c9340e6 100644 --- a/src/models/LocationModel.cs +++ b/src/models/LocationModel.cs @@ -78,7 +78,14 @@ public class LocationModel public String county { get; set; } /// - /// The state, region, or province of the physical address of this location. + /// Name or ISO 3166 code identifying the region within the country of the physical address of this location. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -88,7 +95,15 @@ public class LocationModel public String postalCode { get; set; } /// - /// The two character ISO-3166 country code of the physical address of this location. + /// Name or ISO 3166 code identifying the country of the physical address of this location. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/MrsCompanyModel.cs b/src/models/MrsCompanyModel.cs new file mode 100644 index 00000000..5d58bb51 --- /dev/null +++ b/src/models/MrsCompanyModel.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// A company and account + /// + public class MrsCompanyModel + { + /// + /// The unique ID number of this company. + /// + public Int32? companyId { get; set; } + + /// + /// The name of this company, as shown to customers. + /// + public String companyName { get; set; } + + /// + /// The unique ID number of the account this company belongs to. + /// + public Int32? accountId { get; set; } + + /// + /// The name of this account, as shown to customers. + /// + public String accountName { get; set; } + + /// + /// The taxpayer identification number for the company + /// + public String tin { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/MultiDocumentLineItemModel.cs b/src/models/MultiDocumentLineItemModel.cs new file mode 100644 index 00000000..ea305b92 --- /dev/null +++ b/src/models/MultiDocumentLineItemModel.cs @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Represents one line item in a MultiDocument transaction + /// + public class MultiDocumentLineItemModel + { + /// + /// Specify the code of the company for this line of transaction. + /// + /// If you leave this value null, the `companyCode` at the root level will be used instead. + /// + public String companyCode { get; set; } + + /// + /// Sets the sale location code (Outlet ID) for reporting this document to the tax authority. + /// + /// If you leave this value `null`, the `reportingLocationCode` at the root level will be used instead. + /// + public String reportingLocationCode { get; set; } + + /// + /// Line number within this document + /// + public String number { get; set; } + + /// + /// Quantity of items in this line + /// + public Decimal quantity { get; set; } + + /// + /// Total amount for this line + /// + public Decimal amount { get; set; } + + /// + /// The addresses to use for this transaction line. + /// + /// If you set this value to `null`, or if you omit this element from your API call, then instead the transaction + /// will use the `addresses` from the document level. + /// + /// If you specify any other value besides `null`, only addresses specified for this line will be used for this line. + /// + public AddressesModel addresses { get; set; } + + /// + /// Tax Code - System or Custom Tax Code. + /// + /// You can use your own tax code mapping or standard Avalara tax codes. For a full list of tax codes, see `ListTaxCodes`. + /// + public String taxCode { get; set; } + + /// + /// DEPERECATED - Customer Usage Type - The client application customer or usage type. + /// Please use entityUseCode instead. + /// + public String customerUsageType { get; set; } + + /// + /// Entity Use Code - The client application customer or usage type. + /// + public String entityUseCode { get; set; } + + /// + /// Item Code (SKU) + /// + public String itemCode { get; set; } + + /// + /// Exemption number for this line + /// + public String exemptionCode { get; set; } + + /// + /// True if the document discount should be applied to this line + /// + public Boolean? discounted { get; set; } + + /// + /// Indicates whether the `amount` for this line already includes tax. + /// + /// If this value is `true`, the final price of this line including tax will equal the value in `amount`. + /// + /// If this value is `null` or `false`, the final price will equal `amount` plus whatever taxes apply to this line. + /// + public Boolean? taxIncluded { get; set; } + + /// + /// Revenue Account + /// + public String revenueAccount { get; set; } + + /// + /// Reference 1 - Client specific reference field + /// + public String ref1 { get; set; } + + /// + /// Reference 2 - Client specific reference field + /// + public String ref2 { get; set; } + + /// + /// Item description. This is required for SST transactions if an unmapped ItemCode is used. + /// + public String description { get; set; } + + /// + /// VAT business identification number for the customer for this line item. If you leave this field empty, + /// this line item will use whatever business identification number you provided at the transaction level. + /// + /// If you specify a VAT business identification number for the customer in this transaction and you have also set up + /// a business identification number for your company during company setup, this transaction will be treated as a + /// business-to-business transaction for VAT purposes and it will be calculated according to VAT tax rules. + /// + public String businessIdentificationNo { get; set; } + + /// + /// Specifies a tax override for this line + /// + public TaxOverrideModel taxOverride { get; set; } + + /// + /// Special parameters that apply to this line within this transaction. + /// To get a full list of available parameters, please use the /api/v2/definitions/parameters endpoint. + /// + public Dictionary parameters { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/MultiDocumentModel.cs b/src/models/MultiDocumentModel.cs new file mode 100644 index 00000000..855d19da --- /dev/null +++ b/src/models/MultiDocumentModel.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// A MultiDocument transaction represents a sale or purchase that occurred between more than two companies. + /// + /// A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + /// involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + /// a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + /// document. This separation of documents allows each seller to file their taxes separately. + /// + public class MultiDocumentModel + { + /// + /// The unique ID number of this MultiDocument object. + /// + public Int64? id { get; set; } + + /// + /// The unique ID number of the AvaTax customer account that created this MultiDocument object. + /// + public Int32? accountId { get; set; } + + /// + /// The transaction code of the MultiDocument transaction. + /// + /// All individual transactions within this MultiDocument object will have this code as a prefix. + /// + public String code { get; set; } + + /// + /// Indicates the type of MultiDocument transaction. Common values are: + /// + /// * SalesOrder - An estimate that is not permanently recorded + /// * SalesInvoice - An invoice that can be reported on a tax return + /// + /// For more information about document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/) + /// + public DocumentType? type { get; set; } + + /// + /// The user ID of the user who created this record. + /// + public Int32? createdUserId { get; set; } + + /// + /// The date/time when this record was created. + /// + public DateTime? createdDate { get; set; } + + /// + /// The date/time when this record was last modified. + /// + public DateTime? modifiedDate { get; set; } + + /// + /// The user ID of the user who last modified this record. + /// + public Int32? modifiedUserId { get; set; } + + /// + /// A separate document will exist for each unique combination of buyer and seller in this MultiDocument transaction. + /// + public List documents { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/NewAccountModel.cs b/src/models/NewAccountModel.cs index 4bce358a..911f6c9a 100644 --- a/src/models/NewAccountModel.cs +++ b/src/models/NewAccountModel.cs @@ -51,6 +51,11 @@ public class NewAccountModel /// public String licenseKey { get; set; } + /// + /// The payment url where the payment method can be set up + /// + public String paymentUrl { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/NewAccountRequestModel.cs b/src/models/NewAccountRequestModel.cs index be3e0ef2..95cb7363 100644 --- a/src/models/NewAccountRequestModel.cs +++ b/src/models/NewAccountRequestModel.cs @@ -23,37 +23,68 @@ namespace Avalara.AvaTax.RestClient public class NewAccountRequestModel { /// - /// Offer with which the partner account needs to be created + /// The offer code provided to you by your Avalara business development contact. + /// + /// This code controls what services and rates the customer will be provisioned with upon creation. + /// + /// If you do not know your offer code, please contact your Avalara business development representative. /// public String offer { get; set; } + /// + /// If your Avalara business development representative requests, please provide the campaign ID associated with your + /// signup process. This campaign identifier helps Avalara match users to the context in which they learned about the product + /// to help improve the accuracy of our messaging. + /// + /// The `campaign` field must be either null or a value provided to you by an Avalara business development representative. + /// If you provide an unexpected value in this field, your API call will fail. + /// + public String campaign { get; set; } + + /// + /// If your Avalara business development representative requests, please provide the lead source value associated with your + /// signup process. This lead source identifier helps Avalara match users to the context in which they learned about the product + /// to help improve the accuracy of our messaging. + /// + /// The `leadSource` field must be either null or a value provided to you by an Avalara business development representative. + /// If you provide an unexpected value in this field, your API call will fail. + /// + public String leadSource { get; set; } + /// /// The date on which the account should take effect. If null, defaults to today. + /// + /// You should leave this value `null` unless specifically requested by your Avalara business development manager. /// public DateTime? effectiveDate { get; set; } /// - /// The date on which the account should expire. If null, defaults to a 90-day trial account. + /// The date on which the account should expire. + /// + /// You should leave this value `null` unless specifically requested by your Avalara business development manager. /// public DateTime? endDate { get; set; } /// - /// Account Name + /// The name of the account to create /// public String accountName { get; set; } /// - /// Website of the partner account being created + /// Website of the new customer whose account is being created. + /// + /// It is strongly recommended to provide the customer's website URL, as this will help our support representatives better + /// assist customers. /// public String website { get; set; } /// - /// First Name of the primary contact person for this account + /// First name of the primary contact person for this account /// public String firstName { get; set; } /// - /// Last Name of the primary contact person for this account + /// Last name of the primary contact person for this account /// public String lastName { get; set; } @@ -73,16 +104,20 @@ public class NewAccountRequestModel public String email { get; set; } /// - /// If no password is supplied, an a tempoarary password is generated by the system and emailed to the user. The user will - /// be challenged to change this password upon logging in to the Admin Console. If supplied, will be the set password for - /// the default created user, and the user will not be challenged to change their password upon login to the Admin Console. + /// If instructed by your Avalara business development manager, set this value to a temporary password to permit the user to continue their onboarding process. + /// + /// If this value is null, a temporary password is generated by the system and emailed to the user. + /// + /// The user will then be asked to choose a permanent password when they first log on to the AvaTax website. /// public String userPassword { get; set; } /// - /// Normal - If a welcome email needs to be generated for the user. - /// Suppressed - If no welcome email needs to be generated for the user. - /// Custom - If a custom welcome email needs to be generated for the user. + /// This option controls what type of a welcome email is sent when the account is created. + /// + /// * `Normal` - A standard welcome email will be sent. + /// * `Suppressed` - No email will be sent. + /// * `Custom` - If your Avalara business development representative provides you with a customized welcome email for your customers, please select this option. /// public WelcomeEmail? welcomeEmail { get; set; } @@ -93,6 +128,8 @@ public class NewAccountRequestModel /// /// Company code to be assigned to the company created for this account. + /// + /// If no company code is provided, this will be defaulted to "DEFAULT" company code. /// public String companyCode { get; set; } @@ -103,11 +140,15 @@ public class NewAccountRequestModel /// /// Set this to true if and only if the owner of the newly created account accepts Avalara's terms and conditions for your account. + /// + /// Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. /// public Boolean? acceptAvalaraTermsAndConditions { get; set; } /// /// Set this to true if and only if the owner of the newly created account has fully read Avalara's terms and conditions for your account. + /// + /// Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. /// public Boolean? haveReadAvalaraTermsAndConditions { get; set; } diff --git a/src/models/NexusModel.cs b/src/models/NexusModel.cs index 4f02ccdd..1ccbcfdd 100644 --- a/src/models/NexusModel.cs +++ b/src/models/NexusModel.cs @@ -32,12 +32,29 @@ public class NexusModel public Int32 companyId { get; set; } /// - /// The two character ISO-3166 country code of the country in which this company declared nexus. + /// Name or ISO 3166 code identifying the country in which this company declared nexus. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// The two or three character ISO region code of the region, state, or province in which this company declared nexus. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// If the `jurisTypeId` field is set to `CNT` or `Country`, this field can be left blank. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } @@ -82,8 +99,18 @@ public class NexusModel public String stateAssignedNo { get; set; } /// - /// (DEPRECATED) The type of nexus that this company is declaring. - /// Please use NexusTaxTypeGroupId instead. + /// The type of nexus that this company is declaring. + /// + /// If you are voluntarily declaring nexus in a jurisdiction, you should select `SalesOrSellersUseTax` for your + /// nexus type option. This option allows you to calculate tax correctly whether you are selling in-state or + /// shipping from an out-of-state location. + /// + /// If you are legally obligated to declare nexus due to physical presence or other sufficient nexus, you + /// should select `SalesTax`. This indicates that, as a legal requirement, your company must always collect + /// and remit full sales tax in this jurisdiction. + /// + /// If you are participating in the Streamlined Sales Tax program, your SST administrator will select nexus + /// settings for you in all SST jurisdictions. Do not select any SST options by yourself. /// public NexusTypeId? nexusTypeId { get; set; } diff --git a/src/models/NoticeModel.cs b/src/models/NoticeModel.cs index 15e12575..901c084b 100644 --- a/src/models/NoticeModel.cs +++ b/src/models/NoticeModel.cs @@ -64,12 +64,27 @@ public class NoticeModel public NoticeCustomerType customerTypeId { get; set; } /// - /// The country the notice is in + /// Name or ISO 3166 code identifying the country that sent this notice. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// The region the notice is for + /// Name or ISO 3166 code identifying the region within the country that sent this notice. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } diff --git a/src/models/RateTypeModel.cs b/src/models/RateTypeModel.cs index 8a6a9ffd..32325653 100644 --- a/src/models/RateTypeModel.cs +++ b/src/models/RateTypeModel.cs @@ -22,7 +22,7 @@ namespace Avalara.AvaTax.RestClient public class RateTypeModel { /// - /// The unique ID number of this tax authority. + /// The unique ID number of this rate type. /// public String id { get; set; } diff --git a/src/models/ReconstructedMultiDocumentModel.cs b/src/models/ReconstructedMultiDocumentModel.cs new file mode 100644 index 00000000..9cc06b12 --- /dev/null +++ b/src/models/ReconstructedMultiDocumentModel.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Contains information about the original API request and response that created + /// a MultiDocument object. + /// + public class ReconstructedMultiDocumentModel + { + /// + /// The original request that was used to create a MultiDocument object. + /// + public CreateMultiDocumentModel request { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/RefundTransactionModel.cs b/src/models/RefundTransactionModel.cs index 116bba98..bc1aa65a 100644 --- a/src/models/RefundTransactionModel.cs +++ b/src/models/RefundTransactionModel.cs @@ -22,32 +22,43 @@ namespace Avalara.AvaTax.RestClient public class RefundTransactionModel { /// - /// the transaction code for this refund + /// The transaction code for the refund. This code will be saved to the `ReturnInvoice` transaction, and does not need to match the code of the original sale. /// public String refundTransactionCode { get; set; } /// - /// The date of the refund. If null, today's date will be used + /// The date of the refund. For customers using Avalara's Managed Returns Service, this date controls the month in which the refund + /// transaction will be reported on a tax filing. /// - public DateTime? refundDate { get; set; } + public DateTime refundDate { get; set; } /// - /// Type of this refund + /// Type of this refund. + /// + /// To submit a full refund, specify `Full`. + /// + /// To refund only specific lines from the transaction, specify `Partial` and indicate the lines you wish to apply in the `refundLines` field. + /// + /// To refund the tax that was paid in the previous transaction, specify `TaxOnly`. + /// + /// To issue a percentage-based discount, specify `Percentage`. /// public RefundType? refundType { get; set; } /// - /// Percentage for refund + /// The percentage for refund. + /// + /// This value only applies if you choose `refundType = Percentage` or `refundType = Partial`. /// public Decimal? refundPercentage { get; set; } /// - /// Process refund for these lines + /// If you chose a refund of type `Partial`, this indicates which lines from the original transaction are being refunded. /// public List refundLines { get; set; } /// - /// Reference code for this refund + /// A user-defined reference field containing information about this refund. /// public String referenceCode { get; set; } diff --git a/src/models/SettleTransactionModel.cs b/src/models/SettleTransactionModel.cs index 1c9f03de..f89b5b43 100644 --- a/src/models/SettleTransactionModel.cs +++ b/src/models/SettleTransactionModel.cs @@ -18,24 +18,32 @@ namespace Avalara.AvaTax.RestClient { /// /// Settle this transaction with your ledger by executing one or many actions against that transaction. + /// /// You may use this endpoint to verify the transaction, change the transaction's code, and commit the transaction for reporting purposes. /// This endpoint may be used to execute any or all of these actions at once. /// public class SettleTransactionModel { /// - /// To use the "Settle" endpoint to verify a transaction, fill out this value. + /// To verify this transaction, you may provide information in this field. + /// + /// If you leave this field null, the transaction will not be verified. /// public VerifyTransactionModel verify { get; set; } /// - /// To use the "Settle" endpoint to change a transaction's code, fill out this value. + /// To change the code for this transaction, you may provide information in this field. + /// + /// If you leave this field null, the transaction's code will not be changed. /// public ChangeTransactionCodeModel changeCode { get; set; } /// - /// To use the "Settle" endpoint to commit a transaction for reporting purposes, fill out this value. - /// If you use Avalara Returns, committing a transaction will cause that transaction to be filed. + /// To commit this transaction so that it can be reported on a tax filing, you may provide information in this field. + /// + /// If you leave this field null, the transaction's commit status will not be changed. + /// + /// If you use Avalara's Managed Returns Service, committing a transaction will allow that transaction to be filed. /// public CommitTransactionModel commit { get; set; } diff --git a/src/models/TaxRuleModel.cs b/src/models/TaxRuleModel.cs index 0002ea84..a0893027 100644 --- a/src/models/TaxRuleModel.cs +++ b/src/models/TaxRuleModel.cs @@ -64,10 +64,16 @@ public class TaxRuleModel public JurisTypeId? jurisTypeId { get; set; } /// - /// The type of customer usage to which this rule applies. + /// DEPRECATED - The type of customer usage to which this rule applies. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// The type of customer usage to which this rule applies. + /// + public String entityUseCode { get; set; } + /// /// Indicates which tax types to which this rule applies. /// @@ -142,12 +148,27 @@ public class TaxRuleModel public Boolean? isSTPro { get; set; } /// - /// The two character ISO 3166 country code for the locations where this rule applies. + /// Name or ISO 3166 code identifying the country where this rule will apply. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } /// - /// The state, region, or province name for the locations where this rule applies. + /// Name or ISO 3166 code identifying the region where this rule will apply. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } diff --git a/src/models/TransactionLineModel.cs b/src/models/TransactionLineModel.cs index 3e8b0c17..a1826601 100644 --- a/src/models/TransactionLineModel.cs +++ b/src/models/TransactionLineModel.cs @@ -42,10 +42,16 @@ public class TransactionLineModel public Int32? boundaryOverrideId { get; set; } /// - /// The customer usage type for this line item. Usage type often affects taxability rules. + /// DEPRECATED - The customer usage type for this line item. Usage type often affects taxability rules. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// The entity use code for this line item. Usage type often affects taxability rules. + /// + public String entityUseCode { get; set; } + /// /// A description of the item or service represented by this line. /// @@ -206,7 +212,11 @@ public class TransactionLineModel public String taxOverrideReason { get; set; } /// - /// True if tax was included in the purchase price of the item. + /// Indicates whether the `amount` for this line already includes tax. + /// + /// If this value is `true`, the final price of this line including tax will equal the value in `amount`. + /// + /// If this value is `null` or `false`, the final price will equal `amount` plus whatever taxes apply to this line. /// public Boolean? taxIncluded { get; set; } diff --git a/src/models/TransactionModel.cs b/src/models/TransactionModel.cs index e4ce5bb1..5abdb870 100644 --- a/src/models/TransactionModel.cs +++ b/src/models/TransactionModel.cs @@ -70,10 +70,16 @@ public class TransactionModel public String currencyCode { get; set; } /// - /// The customer usage type for this transaction. Customer usage types often affect exemption or taxability rules. + /// DEPRECATED - The customer usage type for this transaction. Customer usage types often affect exemption or taxability rules. + /// Please use entityUseCode instead. /// public String customerUsageType { get; set; } + /// + /// The entity use code for this transaction. Entity use codes often affect exemption or taxability rules. + /// + public String entityUseCode { get; set; } + /// /// CustomerVendorCode /// @@ -143,6 +149,11 @@ public class TransactionModel /// public Decimal? totalExempt { get; set; } + /// + /// The total amount of discounts applied to all lines within this transaction. + /// + public Decimal? totalDiscount { get; set; } + /// /// The total tax calculated for all lines in this transaction. /// @@ -216,6 +227,13 @@ public class TransactionModel /// /// If true, this seller was considered the importer of record of a product shipped internationally. + /// + /// If this transaction is not an international transaction, this field may be left blank. + /// + /// The "importer of record" is liable to pay customs and import duties for products shipped internationally. If + /// you specify that the seller is the importer of record, then estimates of customs and import duties will be added + /// as tax details to the transaction. Otherwise, the buyer is considered the importer of record, and customs + /// and import duties will not be added to the tax details for this transaction. /// public Boolean? isSellerImporterOfRecord { get; set; } @@ -264,11 +282,6 @@ public class TransactionModel /// public List locationTypes { get; set; } - /// - /// If this transaction has been adjusted, this list contains all the previous versions of the document. - /// - public List history { get; set; } - /// /// Contains a summary of tax on this transaction. /// diff --git a/src/models/ValidatedAddressInfo.cs b/src/models/ValidatedAddressInfo.cs index 5a470b7c..0bdf5fbd 100644 --- a/src/models/ValidatedAddressInfo.cs +++ b/src/models/ValidatedAddressInfo.cs @@ -23,12 +23,12 @@ public class ValidatedAddressInfo { /// /// Address type code. One of: - /// * F - Firm or company address - /// * G - General Delivery address - /// * H - High-rise or business complex - /// * P - PO Box address - /// * R - Rural route address - /// * S - Street or residential address + /// * Firm or company address + /// * General Delivery address + /// * High-rise or business complex + /// * PO Box address + /// * Rural route address + /// * Street or residential address /// public String addressType { get; set; } @@ -53,12 +53,27 @@ public class ValidatedAddressInfo public String city { get; set; } /// - /// State / Province / Region component of the address. + /// Name or ISO 3166 code identifying the region within the country. + /// + /// This field supports many different region identifiers: + /// * Two and three character ISO 3166 region codes + /// * Fully spelled out names of the region in ISO supported languages + /// * Common alternative spellings for many regions + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. /// public String region { get; set; } /// - /// Two character ISO 3166 Country Code. Call `ListCountries` for a list of ISO 3166 country codes. + /// Name or ISO 3166 code identifying the country. + /// + /// This field supports many different country identifiers: + /// * Two character ISO 3166 codes + /// * Three character ISO 3166 codes + /// * Fully spelled out names of the country in ISO supported languages + /// * Common alternative spellings for many countries + /// + /// For a full list of all supported codes and names, please see the Definitions API `ListCountries`. /// public String country { get; set; } diff --git a/src/models/VerifyMultiDocumentModel.cs b/src/models/VerifyMultiDocumentModel.cs new file mode 100644 index 00000000..c8a33aec --- /dev/null +++ b/src/models/VerifyMultiDocumentModel.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +/* + * AvaTax API Client Library + * + * (c) 2004-2017 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Ted Spence + * @author Zhenya Frolov + */ + +namespace Avalara.AvaTax.RestClient +{ + /// + /// Verify that a MultiDocument object matches the information in your accounting system. + /// + /// If all attributes of the MultiDocument object match the values in your request, the + /// MultiDocument object will be moved to the document status `Posted`. + /// + /// For more information on document status, see [DocumentStatus](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentStatus/). + /// + public class VerifyMultiDocumentModel + { + /// + /// Represents the unique code of this MultiDocument transaction. + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public String code { get; set; } + + /// + /// Represents the document type of this MultiDocument transaction. For more information about + /// document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/). + /// + /// A MultiDocument transaction is uniquely identified by its `accountId`, `code`, and `type`. + /// + public DocumentType type { get; set; } + + /// + /// Set this value if you wish to verify a match between `verifyTransactionDate` and + /// the `documentDate` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. + /// + public DateTime? verifyTransactionDate { get; set; } + + /// + /// Set this value if you wish to verify a match between `verifyTotalAmount` and + /// the `totalAmount` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. + /// + public Decimal? verifyTotalAmount { get; set; } + + /// + /// Set this value if you wish to verify a match between `verifyTotalTax` and + /// the `totalTax` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. + /// + public Decimal? verifyTotalTax { get; set; } + + + /// + /// Convert this object to a JSON string of itself + /// + /// A JSON string of this object + public override string ToString() + { + return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented }); + } + } +} diff --git a/src/models/VerifyTransactionModel.cs b/src/models/VerifyTransactionModel.cs index b941bc35..6b902033 100644 --- a/src/models/VerifyTransactionModel.cs +++ b/src/models/VerifyTransactionModel.cs @@ -18,27 +18,34 @@ namespace Avalara.AvaTax.RestClient { /// /// Verify this transaction by matching it to values in your accounting system. + /// + /// You may specify one or more of the following fields to verify: `date`, `totalAmount`, or `totalTax`. + /// This call will report an error if there is any difference between the data stored in AvaTax and + /// the data stored in your accounting system. /// public class VerifyTransactionModel { /// - /// Transaction Date - The date on the invoice, purchase order, etc. - /// - /// This is used to verify data consistency with the client application. + /// Set this value if you wish to verify a match between `verifyTransactionDate` and + /// the `documentDate` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. /// public DateTime? verifyTransactionDate { get; set; } /// - /// Total Amount - The total amount (not including tax) for the document. - /// - /// This is used to verify data consistency with the client application. + /// Set this value if you wish to verify a match between `verifyTotalAmount` and + /// the `totalAmount` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. /// public Decimal? verifyTotalAmount { get; set; } /// - /// Total Tax - The total tax for the document. - /// - /// This is used to verify data consistency with the client application. + /// Set this value if you wish to verify a match between `verifyTotalTax` and + /// the `totalTax` value on the transaction recorded in AvaTax. + /// + /// If you leave this field empty, we will skip verification for this field. /// public Decimal? verifyTotalTax { get; set; } From 8d70e019fccbb2d4a18cb2ffaac5355255e16c8d Mon Sep 17 00:00:00 2001 From: ted-spence-avalara Date: Wed, 27 Dec 2017 11:22:13 -0800 Subject: [PATCH 11/13] Ensure that error codes will not break SDK parsing in the future --- src/ErrorInfo.cs | 14 +++++++++++--- src/models/ErrorDetail.cs | 5 ++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/ErrorInfo.cs b/src/ErrorInfo.cs index 2e9f6fdb..03038ed7 100644 --- a/src/ErrorInfo.cs +++ b/src/ErrorInfo.cs @@ -10,9 +10,14 @@ namespace Avalara.AvaTax.RestClient public class ErrorInfo { /// - /// Type of error that occurred + /// Type of error that occurred. /// - public ErrorCodeId? code { get; set; } + /// + /// This value is captured as a string so that if the server adds new error codes it will still parse. + /// + /// You can compare this value to the ErrorCodeId enumeration. + /// + public String code { get; set; } /// /// Short one-line message to summaryize what went wrong @@ -22,7 +27,10 @@ public class ErrorInfo /// /// What object or service caused the error? /// - public ErrorTargetCode? target { get; set; } + /// + /// This value is captured as a string so that if the server adds new error targets it will still parse. + /// + public String target { get; set; } /// /// Array of detailed error messages diff --git a/src/models/ErrorDetail.cs b/src/models/ErrorDetail.cs index 048300a7..13289bf6 100644 --- a/src/models/ErrorDetail.cs +++ b/src/models/ErrorDetail.cs @@ -25,7 +25,10 @@ public class ErrorDetail /// /// Name of the error or message. /// - public ErrorCodeId? code { get; set; } + /// + /// This value is captured as a string so that if the server adds new error codes it will still parse. + /// + public String code { get; set; } /// /// Unique ID number referring to this error or message. From c35ddf3ff143ca50a32e277d274bbe78aae55649 Mon Sep 17 00:00:00 2001 From: ted-spence-avalara Date: Wed, 27 Dec 2017 12:24:05 -0800 Subject: [PATCH 12/13] Trying to update the dot net version to get travis to build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 67edfc3a..de68d1e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: csharp solution: Avalara.AvaTax.netstandard11.sln dist: trusty sudo: required -dotnet: 1.0.1 +dotnet: 2.0.4 mono: latest install: - sudo apt-get install -y gtk-sharp2 From 7c9d915cd6cd6c74314ca2a4412a31ffc40cddb1 Mon Sep 17 00:00:00 2001 From: ted-spence-avalara Date: Wed, 27 Dec 2017 12:44:01 -0800 Subject: [PATCH 13/13] Found a wiki that says Travis supports 1.1.5 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index de68d1e0..c94aaccc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: csharp solution: Avalara.AvaTax.netstandard11.sln dist: trusty sudo: required -dotnet: 2.0.4 +dotnet: 1.1.5 mono: latest install: - sudo apt-get install -y gtk-sharp2