From 5f40651ecc33aedacc704ccfa6ebfb9a84119d17 Mon Sep 17 00:00:00 2001 From: Greg Hester Date: Thu, 25 Jan 2018 09:03:29 -0800 Subject: [PATCH] Updated DotNet SDK to 18.1.2 --- GlobalAssemblyInfo.cs | 4 +- src/AvaTaxApi.cs | 1082 +++++++++++++++-- src/Avalara.AvaTax.net20.csproj | 5 + src/Avalara.AvaTax.net45.csproj | 5 + src/Avalara.AvaTax.nuspec | 4 +- src/enums/ErrorCodeId.cs | 42 +- src/enums/ServiceTypeId.cs | 5 + src/enums/TaxType.cs | 5 + src/models/AdjustMultiDocumentModel.cs | 3 - src/models/AuditMultiDocumentModel.cs | 3 - src/models/CommitMultiDocumentModel.cs | 3 - src/models/CompanyDistanceThresholdModel.cs | 114 ++ src/models/CompanyModel.cs | 10 + src/models/CreateMultiDocumentModel.cs | 13 +- src/models/CreateTransactionModel.cs | 10 +- src/models/ErrorDetail.cs | 5 +- src/models/FilingReturnModel.cs | 15 + src/models/FilingReturnModelBasic.cs | 15 + src/models/FormMasterModel.cs | 545 +++++++++ src/models/FundingConfigurationModel.cs | 3 - src/models/HsCodeModel.cs | 102 ++ src/models/IsoLocalizedName.cs | 3 - src/models/LineItemModel.cs | 59 +- src/models/MrsCompanyModel.cs | 8 +- src/models/MultiDocumentLineItemModel.cs | 62 +- src/models/MultiDocumentModel.cs | 3 - src/models/NewAccountRequestModel.cs | 8 + src/models/NexusModel.cs | 14 + src/models/PingResultModel.cs | 5 + src/models/PostalCodeModel.cs | 65 + src/models/ReconstructedMultiDocumentModel.cs | 3 - src/models/TaxRuleModel.cs | 26 + src/models/TransactionAddressModel.cs | 8 +- src/models/TransactionLineDetailModel.cs | 7 + src/models/TransactionLineModel.cs | 26 +- src/models/TransactionModel.cs | 3 + src/models/UomModel.cs | 84 ++ src/models/VerifyMultiDocumentModel.cs | 3 - tests/net20/TransactionTests.cs | 4 +- tests/net45/TransactionTests.cs | 4 +- tests/netstandard/TransactionTests.cs | 4 +- 41 files changed, 2237 insertions(+), 155 deletions(-) create mode 100644 src/models/CompanyDistanceThresholdModel.cs create mode 100644 src/models/FormMasterModel.cs create mode 100644 src/models/HsCodeModel.cs create mode 100644 src/models/PostalCodeModel.cs create mode 100644 src/models/UomModel.cs diff --git a/GlobalAssemblyInfo.cs b/GlobalAssemblyInfo.cs index 5fe5beb6..45905cab 100644 --- a/GlobalAssemblyInfo.cs +++ b/GlobalAssemblyInfo.cs @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("17.12.0.147")] -[assembly: AssemblyFileVersion("17.12.0.147")] +[assembly: AssemblyVersion("18.1.2.161")] +[assembly: AssemblyFileVersion("18.1.2.161")] diff --git a/src/AvaTaxApi.cs b/src/AvaTaxApi.cs index 39ea8184..d0f3aed7 100644 --- a/src/AvaTaxApi.cs +++ b/src/AvaTaxApi.cs @@ -18,7 +18,7 @@ * @author Greg Hester * @copyright 2004-2017 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 17.12.0-147 + * @version 18.1.2-161 * @link https://github.com/avadev/AvaTax-REST-V2-DotNet-SDK */ @@ -29,7 +29,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-147"; } } + public static string API_VERSION { get { return "18.1.2-161"; } } #region Methods @@ -366,6 +366,9 @@ public FetchResult QueryBatches(String filter, String include, Int32 /// The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time. /// Using CertExpress with this API will ensure that your certificates are automatically linked correctly into /// your company so that they can be used for tax exemptions. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that will record certificates /// The number of the customer where the request is sent to @@ -393,6 +396,9 @@ public List CreateCertExpressInvitation(Int32 /// The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time. /// Using CertExpress with this API will ensure that your certificates are automatically linked correctly into /// your company so that they can be used for tax exemptions. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that issued this invitation /// The number of the customer where the request is sent to @@ -423,6 +429,9 @@ public CertExpressInvitationModel GetCertExpressInvitation(Int32 companyId, Stri /// The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time. /// Using CertExpress with this API will ensure that your certificates are automatically linked correctly into /// your company so that they can be used for tax exemptions. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that issued this invitation /// OPTIONAL: A comma separated list of special fetch options. @@ -463,6 +472,9 @@ public FetchResult ListCertExpressInvitations(Int32 /// * A list of exposure zones indicating where the certificate is valid /// * A link to the customer that is allowed to use this certificate /// * Your tax transaction must contain the correct customer code + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The ID number of the company recording this certificate /// Certificates to be created @@ -486,6 +498,9 @@ public List CreateCertificates(Int32 companyId, List /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -511,6 +526,9 @@ public CertificateModel DeleteCertificate(Int32 companyId, Int32 id) /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -543,6 +561,9 @@ public FileResult DownloadCertificateImage(Int32 companyId, Int32 id, Int32? pag /// * Customers - Retrieves the list of customers linked to the certificate. /// * PoNumbers - Retrieves all PO numbers tied to the certificate. /// * Attributes - Retrieves all attributes applied to the certificate. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -574,6 +595,9 @@ public CertificateModel GetCertificate(Int32 companyId, Int32 id, String include /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -601,6 +625,9 @@ public FetchResult LinkAttributesToCertificate(Int32 /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -627,6 +654,9 @@ public FetchResult LinkCustomersToCertificate(Int32 companyId, In /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -652,6 +682,9 @@ public FetchResult ListAttributesForCertificate(Int32 /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -683,6 +716,9 @@ public FetchResult ListCustomersForCertificate(Int32 companyId, I /// * Customers - Retrieves the list of customers linked to the certificate. /// * PoNumbers - Retrieves all PO numbers tied to the certificate. /// * Attributes - Retrieves all attributes applied to the certificate. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The ID number of the company to search /// OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: @@ -720,6 +756,9 @@ public FetchResult QueryCertificates(Int32 companyId, String i /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -748,6 +787,9 @@ public FetchResult UnlinkAttributesFromCertificate(In /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -771,6 +813,9 @@ public FetchResult UnlinkCustomersFromCertificate(Int32 companyId /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -797,6 +842,9 @@ public CertificateModel UpdateCertificate(Int32 companyId, Int32 id, Certificate /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -937,6 +985,26 @@ public FundingConfigurationModel FundingConfigurationByCompany(Int32 companyId) } + /// + /// 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 + /// The currency of the funding. USD and CAD are the only valid currencies + public List FundingConfigurationsByCompanyAndCurrency(Int32 companyId, String currency) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/funding/configurations"); + path.ApplyField("companyId", companyId); + path.AddQuery("currency", currency); + return RestCall>("Get", path, null); + } + + /// /// Retrieve a single company /// @@ -1279,6 +1347,9 @@ public ContactModel UpdateContact(Int32 companyId, Int32 id, ContactModel model) /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The list of customer objects to be created @@ -1301,6 +1372,9 @@ public List CreateCustomers(Int32 companyId, List /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1328,6 +1402,9 @@ public CustomerModel DeleteCustomer(Int32 companyId, String customerCode) /// You can use the `$include` parameter to fetch the following additional objects for expansion: /// /// * Certificates - Fetch a list of certificates linked to this customer. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1353,6 +1430,9 @@ public CustomerModel GetCustomer(Int32 companyId, String customerCode, String in /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1377,6 +1457,9 @@ public FetchResult LinkCertificatesToCustomer(Int32 companyId, /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1417,6 +1500,9 @@ public FetchResult ListCertificatesForCustomer(Int32 companyId /// If a customer does not have a certificate on file and they wish to provide one, you should send the customer /// a CertExpress invitation link so that the customer can upload proof of their exemption certificate. Please /// see the `CreateCertExpressInvitation` API to create an invitation link for this customer. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1448,6 +1534,9 @@ public ExemptionStatusModel ListValidCertificatesForCustomer(Int32 companyId, St /// You can use the `$include` parameter to fetch the following additional objects for expansion: /// /// * Certificates - Fetch a list of certificates linked to this customer. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// OPTIONAL - You can specify the value `certificates` to fetch information about certificates linked to the customer. @@ -1479,6 +1568,9 @@ public FetchResult QueryCustomers(Int32 companyId, String include /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1503,6 +1595,9 @@ public FetchResult UnlinkCertificatesFromCustomer(Int32 compan /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -1516,6 +1611,32 @@ public CustomerModel UpdateCustomer(Int32 companyId, String customerCode, Custom } + /// + /// Lists all parents of an HS Code. + /// + /// + /// Retrieves the specified HS code and all of its parents, reflecting all sections, chapters, headings, and subheadings + /// + /// a list of HS Codes that are the parents and information branches of the HS Code for the given + /// destination country, if lower detail is available. + /// + /// This API will include information branches if applicable. These do not have HS Codes and cannot be referenced, + /// but can contain information relevant to deciding the correct HS Code. + /// + /// This API is intended to be useful to review the descriptive hierarchy of an HS Code, which can be particularly helpful + /// when HS Codes can have multiple levels of generic descriptions. + /// + /// The name or code of the destination country. + /// The partial or full HS Code for which you would like to view all of the parents. + public FetchResult GetCrossBorderCode(String country, String hsCode) + { + var path = new AvaTaxPath("/api/v2/definitions/crossborder/{country}/{hsCode}/hierarchy"); + path.ApplyField("country", country); + path.ApplyField("hsCode", hsCode); + return RestCall>("Get", path, null); + } + + /// /// Test whether a form supports online login verification /// @@ -1544,6 +1665,10 @@ public FetchResult GetLoginVerifierByForm(String form, St /// Retrieve the full list of the AvaFile Forms available /// /// + /// This API is deprecated. + /// + /// Please use the ListTaxForms API. + /// /// Returns the full list of Avalara-supported AvaFile Forms /// This API is intended to be useful to identify all the different AvaFile Forms /// @@ -1570,6 +1695,9 @@ public FetchResult ListAvaFileForms(String filter, Int32? top, /// /// A certificate may have multiple attributes that control its behavior. You may apply or remove attributes to a /// certificate at any time. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// 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. @@ -1594,6 +1722,9 @@ public FetchResult ListCertificateAttributes(String f /// /// An exemption reason defines why a certificate allows a customer to be exempt /// for purposes of tax calculation. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// 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. @@ -1618,6 +1749,9 @@ public FetchResult ListCertificateExemptReasons(String fil /// /// An exposure zone is a location where a certificate can be valid. Exposure zones may indicate a taxing /// authority or other legal entity to which a certificate may apply. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// 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. @@ -1734,6 +1868,9 @@ public FetchResult ListCountries(String filter, Int32? top, Int /// The CoverLetter model represents a message sent along with an invitation to use CertExpress to /// upload certificates. An invitation allows customers to use CertExpress to upload their exemption /// certificates directly; this cover letter explains why the invitation was sent. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience. /// /// 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. @@ -1750,6 +1887,48 @@ public FetchResult ListCoverLetters(String filter, Int32? top, } + /// + /// Lists the next level of HS Codes given a destination country and HS Code prefix. + /// + /// + /// Retrieves a list of HS Codes that are the children of the prefix for the given destination country, if + /// additional children are available. + /// + /// HS Code is interchangeable with "tariff code" and definitions are generally unique to a destination country. + /// An HS Code describes an item and its eligibility/rate for tariffs. HS Codes are organized by + /// Section/Chapter/Heading/Subheading/Classification. + /// + /// This API is intended to be useful to identify the correct HS Code to use for your item. + /// + /// The name or code of the destination country. + /// The Section or partial HS Code for which you would like to view the next level of HS Code detail, if more detail is available. + public FetchResult ListCrossBorderCodes(String country, String hsCode) + { + var path = new AvaTaxPath("/api/v2/definitions/crossborder/{country}/{hsCode}"); + path.ApplyField("country", country); + path.ApplyField("hsCode", hsCode); + return RestCall>("Get", path, null); + } + + + /// + /// List top level HS Code Sections. + /// + /// + /// Returns the full list of top level HS Code Sections. Sections are the broadest level of detail for + /// classifying tariff codes and the items to which they apply. HS Codes are organized + /// by Section/Chapter/Heading/Subheading/Classification. + /// + /// This API is intended to be useful to identify the top level Sections for + /// further LandedCost HS Code lookups. + /// + public FetchResult ListCrossBorderSections() + { + var path = new AvaTaxPath("/api/v2/definitions/crossborder/sections"); + return RestCall>("Get", path, null); + } + + /// /// Retrieve the full list of Avalara-supported entity use codes /// @@ -2356,6 +2535,27 @@ public FetchResult ListPermissions(String filter, Int32? top, Int32? ski } + /// + /// Retrieve the full list of Avalara-supported postal codes. + /// + /// + /// Retrieves the list of Avalara-supported postal codes. + /// + /// 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. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public FetchResult ListPostalCodes(String filter, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/definitions/postalcodes"); + path.AddQuery("$filter", filter); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return RestCall>("Get", path, null); + } + + /// /// Retrieve the full list of rate types for each country /// @@ -2613,6 +2813,28 @@ public TaxCodeTypesModel ListTaxCodeTypes(String filter, Int32? top, Int32? skip } + /// + /// Retrieve the full list of the Tax Forms available + /// + /// + /// Returns the full list of Avalara-supported Tax Forms + /// This API is intended to be useful to identify all the different Tax Forms + /// + /// 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. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public FetchResult ListTaxForms(String filter, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/definitions/taxforms"); + path.AddQuery("$filter", filter); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return RestCall>("Get", path, null); + } + + /// /// Retrieve the full list of tax sub types /// @@ -2657,6 +2879,175 @@ public FetchResult ListTaxTypeGroups(String filter, Int32? to } + /// + /// List all defined units of measurement + /// + /// + /// List all units of measurement systems defined by Avalara. + /// + /// A unit of measurement system is a method of measuring a quantity, such as distance, mass, or others. + /// + /// 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. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public FetchResult ListUnitOfMeasurement(String filter, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/definitions/unitofmeasurements"); + path.AddQuery("$filter", filter); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return RestCall>("Get", path, null); + } + + + /// + /// Create one or more DistanceThreshold objects + /// + /// + /// Create one or more DistanceThreshold objects for this company. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// The unique ID number of the company that owns this DistanceThreshold + /// The DistanceThreshold object or objects you wish to create. + public List CreateDistanceThreshold(Int32 companyId, List model) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds"); + path.ApplyField("companyId", companyId); + return RestCall>("Post", path, model); + } + + + /// + /// Delete a single DistanceThreshold object + /// + /// + /// Marks the DistanceThreshold object identified by this URL as deleted. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// The unique ID number of the company that owns this DistanceThreshold + /// The unique ID number of the DistanceThreshold object you wish to delete. + public List DeleteDistanceThreshold(Int32 companyId, Int64 id) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds/{id}"); + path.ApplyField("companyId", companyId); + path.ApplyField("id", id); + return RestCall>("Delete", path, null); + } + + + /// + /// Retrieve a single DistanceThreshold + /// + /// + /// Retrieves a single DistanceThreshold object defined by this URL. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// The ID of the company that owns this DistanceThreshold object + /// The unique ID number referring to this DistanceThreshold object + public CompanyDistanceThresholdModel GetDistanceThreshold(Int32 companyId, Int64 id) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds/{id}"); + path.ApplyField("companyId", companyId); + path.ApplyField("id", id); + return RestCall("Get", path, null); + } + + + /// + /// Retrieve all DistanceThresholds for this company. + /// + /// + /// Lists all DistanceThreshold objects that belong to this company. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// The ID of the company whose DistanceThreshold objects you wish to list. + /// 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/) . + /// A comma separated list of additional data to retrieve. + /// 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 ListDistanceThresholds(Int32 companyId, String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds"); + path.ApplyField("companyId", companyId); + 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); + } + + + /// + /// Retrieve all DistanceThreshold objects + /// + /// + /// Lists all DistanceThreshold objects that belong to this company. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// 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. + /// + /// 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/) . + /// A comma separated list of additional data to retrieve. + /// 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 QueryDistanceThresholds(String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/distancethresholds"); + 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); + } + + + /// + /// Update a DistanceThreshold object + /// + /// + /// Replace the existing DistanceThreshold object at this URL with an updated object. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// All data from the existing object will be replaced with data in the object you PUT. + /// To set a field's value to null, you may either set its value to null or omit that field from the object you post. + /// + /// The unique ID number of the company that owns this DistanceThreshold object. + /// The unique ID number of the DistanceThreshold object to replace. + /// The new DistanceThreshold object to store. + public CompanyDistanceThresholdModel UpdateDistanceThreshold(Int32 companyId, Int64 id, CompanyDistanceThresholdModel model) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds/{id}"); + path.ApplyField("companyId", companyId); + path.ApplyField("id", id); + return RestCall("Put", path, model); + } + + /// /// Approve existing Filing Request /// @@ -3888,6 +4279,12 @@ public FundingStatusModel FundingRequestStatus(Int32 id) /// /// /// Creates one or more new item objects attached to this company. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// The ID of the company that owns this item. /// The item you wish to create. @@ -3904,6 +4301,12 @@ public List CreateItems(Int32 companyId, List model) /// /// /// Marks the item object at this URL as deleted. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// The ID of the company that owns this item. /// The ID of the item you wish to delete. @@ -3921,7 +4324,12 @@ public List DeleteItem(Int32 companyId, Int64 id) /// /// /// Get the item object identified by this URL. - /// An 'Item' represents a product or service that your company offers for sale. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// The ID of the company that owns this item object /// The primary key of this item @@ -3940,10 +4348,18 @@ public ItemModel GetItem(Int32 companyId, Int64 id) /// /// List all items defined for the current company. /// - /// An 'Item' represents a product or service that your company offers for sale. + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// 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: + /// + /// * Attributes /// /// The ID of the company that defined these items /// 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/) . @@ -3969,10 +4385,19 @@ public FetchResult ListItemsByCompany(Int32 companyId, String filter, /// /// /// Get multiple item objects across all companies. - /// An 'Item' represents a product or service that your company offers for sale. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// 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: + /// + /// * Attributes /// /// 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/) . /// A comma separated list of additional data to retrieve. @@ -3995,7 +4420,14 @@ public FetchResult QueryItems(String filter, String include, Int32? t /// Update a single item /// /// - /// Replace the existing item object at this URL with an updated object. + /// Replace the existing `Item` object at this URL with an updated object. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. + /// /// All data from the existing object will be replaced with data in the object you PUT. /// To set a field's value to null, you may either set its value to null or omit that field from the object you post. /// @@ -6356,17 +6788,21 @@ public BulkLockTransactionResult BulkLockTransaction(BulkLockTransactionModel mo /// /// After this API call succeeds, the transaction will have a new URL matching its new `code`. /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// 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 company code of the company that recorded this transaction /// The transaction code to change + /// (Optional): The document type of the transaction to change document code. If not provided, the default is SalesInvoice. /// The code change request you wish to execute - public TransactionModel ChangeTransactionCode(String companyCode, String transactionCode, ChangeTransactionCodeModel model) + public TransactionModel ChangeTransactionCode(String companyCode, String transactionCode, DocumentType? documentType, ChangeTransactionCodeModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/changecode"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -6375,20 +6811,27 @@ public TransactionModel ChangeTransactionCode(String companyCode, String transac /// Commit a transaction for reporting /// /// - /// Marks a transaction by changing its status to 'Committed'. + /// Marks a transaction 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). + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// Any changes made to a committed transaction will generate a transaction history. /// /// The company code of the company that recorded this transaction /// The transaction code to commit + /// (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. /// The commit request you wish to execute - public TransactionModel CommitTransaction(String companyCode, String transactionCode, CommitTransactionModel model) + public TransactionModel CommitTransaction(String companyCode, String transactionCode, DocumentType? documentType, CommitTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/commit"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -6669,17 +7112,21 @@ public FetchResult ListTransactionsByCompany(String companyCod /// /// This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only. /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// 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 company code of the company that recorded this transaction /// The transaction code to lock + /// (Optional): The document type of the transaction to lock. If not provided, the default is SalesInvoice. /// The lock request you wish to execute - public TransactionModel LockTransaction(String companyCode, String transactionCode, LockTransactionModel model) + public TransactionModel LockTransaction(String companyCode, String transactionCode, DocumentType? documentType, LockTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/lock"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -6723,13 +7170,15 @@ public TransactionModel LockTransaction(String companyCode, String transactionCo /// The code of the company that made the original sale /// The transaction code of the original sale /// Specifies objects to include in the response after transaction is created + /// (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. /// Information about the refund to create - public TransactionModel RefundTransaction(String companyCode, String transactionCode, String include, RefundTransactionModel model) + public TransactionModel RefundTransaction(String companyCode, String transactionCode, String include, DocumentType? documentType, RefundTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/refund"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); path.AddQuery("$include", include); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -6738,16 +7187,27 @@ public TransactionModel RefundTransaction(String companyCode, String transaction /// Perform multiple actions on a transaction /// /// - /// Performs the same functions as /verify, /changecode, and /commit. You may specify one or many actions in each call to this endpoint. + /// Performs one or more actions against the current transaction uniquely identified by this URL. + /// + /// The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`. + /// + /// 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). + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// + /// This API is available for users who want to execute more than one action at a time. /// /// The company code of the company that recorded this transaction /// The transaction code to settle - /// The settle request containing the actions you wish to execute - public TransactionModel SettleTransaction(String companyCode, String transactionCode, SettleTransactionModel model) + /// (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. + /// The data from an external system to reconcile against AvaTax + public TransactionModel SettleTransaction(String companyCode, String transactionCode, DocumentType? documentType, SettleTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/settle"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -6757,18 +7217,24 @@ public TransactionModel SettleTransaction(String companyCode, String transaction /// /// /// Verifies that the 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. + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// 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 company code of the company that recorded this transaction /// The transaction code to settle - /// The settle request you wish to execute - public TransactionModel VerifyTransaction(String companyCode, String transactionCode, VerifyTransactionModel model) + /// (Optional): The document type of the transaction to verify. If not provided, the default is SalesInvoice. + /// The data from an external system to reconcile against AvaTax + public TransactionModel VerifyTransaction(String companyCode, String transactionCode, DocumentType? documentType, VerifyTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/verify"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -6778,19 +7244,26 @@ public TransactionModel VerifyTransaction(String companyCode, String 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'. + /// + /// When you void a transaction, that transaction's status is recorded as `DocVoided`. + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided. /// /// The company code of the company that recorded this transaction /// The transaction code to void + /// (Optional): The document type of the transaction to void. If not provided, the default is SalesInvoice. /// The void request you wish to execute - public TransactionModel VoidTransaction(String companyCode, String transactionCode, VoidTransactionModel model) + public TransactionModel VoidTransaction(String companyCode, String transactionCode, DocumentType? documentType, VoidTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/void"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return RestCall("Post", path, model); } @@ -7461,7 +7934,10 @@ public async Task> QueryBatchesAsync(String filter, Stri /// /// The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time. /// Using CertExpress with this API will ensure that your certificates are automatically linked correctly into - /// your company so that they can be used for tax exemptions.; + /// your company so that they can be used for tax exemptions. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that will record certificates /// The number of the customer where the request is sent to @@ -7488,7 +7964,10 @@ public async Task> CreateCertExpressInvit /// /// The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time. /// Using CertExpress with this API will ensure that your certificates are automatically linked correctly into - /// your company so that they can be used for tax exemptions.; + /// your company so that they can be used for tax exemptions. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that issued this invitation /// The number of the customer where the request is sent to @@ -7518,7 +7997,10 @@ public async Task GetCertExpressInvitationAsync(Int3 /// /// The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time. /// Using CertExpress with this API will ensure that your certificates are automatically linked correctly into - /// your company so that they can be used for tax exemptions.; + /// your company so that they can be used for tax exemptions. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that issued this invitation /// OPTIONAL: A comma separated list of special fetch options. @@ -7558,8 +8040,11 @@ public async Task> ListCertExpressInvita /// /// * A list of exposure zones indicating where the certificate is valid /// * A link to the customer that is allowed to use this certificate - /// * Your tax transaction must contain the correct customer code; - /// + /// * Your tax transaction must contain the correct customer code + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; + /// /// The ID number of the company recording this certificate /// Certificates to be created public async Task> CreateCertificatesAsync(Int32 companyId, List model) @@ -7581,7 +8066,10 @@ public async Task> CreateCertificatesAsync(Int32 companyI /// criteria you specify when you store the certificate. To view or manage your certificates directly, please /// log onto the administrative website for the product you purchased. /// - /// Revoked certificates can no longer be used.; + /// Revoked certificates can no longer be used. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7606,7 +8094,10 @@ public async Task DeleteCertificateAsync(Int32 companyId, Int3 /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7638,7 +8129,10 @@ public async Task DownloadCertificateImageAsync(Int32 companyId, Int /// /// * Customers - Retrieves the list of customers linked to the certificate. /// * PoNumbers - Retrieves all PO numbers tied to the certificate. - /// * Attributes - Retrieves all attributes applied to the certificate.; + /// * Attributes - Retrieves all attributes applied to the certificate. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7669,7 +8163,10 @@ public async Task GetCertificateAsync(Int32 companyId, Int32 i /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7696,7 +8193,10 @@ public async Task> LinkAttributesToCertif /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7722,7 +8222,10 @@ public async Task> LinkCustomersToCertificateAsync(In /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7747,7 +8250,10 @@ public async Task> ListAttributesForCerti /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7778,7 +8284,10 @@ public async Task> ListCustomersForCertificateAsync(I /// /// * Customers - Retrieves the list of customers linked to the certificate. /// * PoNumbers - Retrieves all PO numbers tied to the certificate. - /// * Attributes - Retrieves all attributes applied to the certificate.; + /// * Attributes - Retrieves all attributes applied to the certificate. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The ID number of the company to search /// OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: @@ -7815,7 +8324,10 @@ public async Task> QueryCertificatesAsync(Int32 co /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7843,7 +8355,10 @@ public async Task> UnlinkAttributesFromCe /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7866,7 +8381,10 @@ public async Task> UnlinkCustomersFromCertificateAsyn /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -7892,7 +8410,10 @@ public async Task UpdateCertificateAsync(Int32 companyId, Int3 /// A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document /// can contain information about a customer's eligibility for exemption from sales or use taxes based on /// criteria you specify when you store the certificate. To view or manage your certificates directly, please - /// log onto the administrative website for the product you purchased.; + /// log onto the administrative website for the product you purchased. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this certificate /// The unique ID number of this certificate @@ -8033,6 +8554,26 @@ public async Task FundingConfigurationByCompanyAsync( } + /// + /// 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 + /// The currency of the funding. USD and CAD are the only valid currencies + public async Task> FundingConfigurationsByCompanyAndCurrencyAsync(Int32 companyId, String currency) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/funding/configurations"); + path.ApplyField("companyId", companyId); + path.AddQuery("currency", currency); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + /// /// Retrieve a single company; /// @@ -8374,7 +8915,10 @@ public async Task UpdateContactAsync(Int32 companyId, Int32 id, Co /// company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, - /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.; + /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The list of customer objects to be created @@ -8396,7 +8940,10 @@ public async Task> CreateCustomersAsync(Int32 companyId, Lis /// company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, - /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.; + /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8423,7 +8970,10 @@ public async Task DeleteCustomerAsync(Int32 companyId, String cus /// /// You can use the `$include` parameter to fetch the following additional objects for expansion: /// - /// * Certificates - Fetch a list of certificates linked to this customer.; + /// * Certificates - Fetch a list of certificates linked to this customer. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8448,7 +8998,10 @@ public async Task GetCustomerAsync(Int32 companyId, String custom /// company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, - /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.; + /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8472,7 +9025,10 @@ public async Task> LinkCertificatesToCustomerAsync /// company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, - /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.; + /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8512,7 +9068,10 @@ public async Task> ListCertificatesForCustomerAsyn /// /// If a customer does not have a certificate on file and they wish to provide one, you should send the customer /// a CertExpress invitation link so that the customer can upload proof of their exemption certificate. Please - /// see the `CreateCertExpressInvitation` API to create an invitation link for this customer.; + /// see the `CreateCertExpressInvitation` API to create an invitation link for this customer. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8543,7 +9102,10 @@ public async Task ListValidCertificatesForCustomerAsync(In /// /// You can use the `$include` parameter to fetch the following additional objects for expansion: /// - /// * Certificates - Fetch a list of certificates linked to this customer.; + /// * Certificates - Fetch a list of certificates linked to this customer. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// OPTIONAL - You can specify the value `certificates` to fetch information about certificates linked to the customer. @@ -8574,7 +9136,10 @@ public async Task> QueryCustomersAsync(Int32 companyI /// company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, - /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.; + /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8598,7 +9163,10 @@ public async Task> UnlinkCertificatesFromCustomerA /// company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this /// record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and /// identify any certificates linked to this `customer` object. If any certificate applies to the transaction, - /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.; + /// AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// The unique ID number of the company that recorded this customer /// The unique code representing this customer @@ -8612,6 +9180,32 @@ public async Task UpdateCustomerAsync(Int32 companyId, String cus } + /// + /// Lists all parents of an HS Code.; + /// + /// + /// Retrieves the specified HS code and all of its parents, reflecting all sections, chapters, headings, and subheadings + /// + /// a list of HS Codes that are the parents and information branches of the HS Code for the given + /// destination country, if lower detail is available. + /// + /// This API will include information branches if applicable. These do not have HS Codes and cannot be referenced, + /// but can contain information relevant to deciding the correct HS Code. + /// + /// This API is intended to be useful to review the descriptive hierarchy of an HS Code, which can be particularly helpful + /// when HS Codes can have multiple levels of generic descriptions.; + /// + /// The name or code of the destination country. + /// The partial or full HS Code for which you would like to view all of the parents. + public async Task> GetCrossBorderCodeAsync(String country, String hsCode) + { + var path = new AvaTaxPath("/api/v2/definitions/crossborder/{country}/{hsCode}/hierarchy"); + path.ApplyField("country", country); + path.ApplyField("hsCode", hsCode); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + /// /// Test whether a form supports online login verification; /// @@ -8640,6 +9234,10 @@ public async Task> GetLoginVerifierByFormAsyn /// Retrieve the full list of the AvaFile Forms available; /// /// + /// This API is deprecated. + /// + /// Please use the ListTaxForms API. + /// /// Returns the full list of Avalara-supported AvaFile Forms /// This API is intended to be useful to identify all the different AvaFile Forms; /// @@ -8665,7 +9263,10 @@ public async Task> ListAvaFileFormsAsync(String fi /// List the certificate attributes defined by a company. /// /// A certificate may have multiple attributes that control its behavior. You may apply or remove attributes to a - /// certificate at any time.; + /// certificate at any time. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// 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. @@ -8689,7 +9290,10 @@ public async Task> ListCertificateAttribu /// List the certificate exempt reasons defined by a company. /// /// An exemption reason defines why a certificate allows a customer to be exempt - /// for purposes of tax calculation.; + /// for purposes of tax calculation. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// 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. @@ -8713,7 +9317,10 @@ public async Task> ListCertificateExemptReason /// List the certificate exposure zones defined by a company. /// /// An exposure zone is a location where a certificate can be valid. Exposure zones may indicate a taxing - /// authority or other legal entity to which a certificate may apply.; + /// authority or other legal entity to which a certificate may apply. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// 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. @@ -8829,7 +9436,10 @@ public async Task> ListCountriesAsync(String filter /// /// The CoverLetter model represents a message sent along with an invitation to use CertExpress to /// upload certificates. An invitation allows customers to use CertExpress to upload their exemption - /// certificates directly; this cover letter explains why the invitation was sent.; + /// certificates directly; this cover letter explains why the invitation was sent. + /// + /// You may experience up to a three minute delay on your very first call to the exemption related endpoints + /// (as your account gets provisioned). Thank you for your patience.; /// /// 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. @@ -8846,6 +9456,48 @@ public async Task> ListCoverLettersAsync(String fi } + /// + /// Lists the next level of HS Codes given a destination country and HS Code prefix.; + /// + /// + /// Retrieves a list of HS Codes that are the children of the prefix for the given destination country, if + /// additional children are available. + /// + /// HS Code is interchangeable with "tariff code" and definitions are generally unique to a destination country. + /// An HS Code describes an item and its eligibility/rate for tariffs. HS Codes are organized by + /// Section/Chapter/Heading/Subheading/Classification. + /// + /// This API is intended to be useful to identify the correct HS Code to use for your item.; + /// + /// The name or code of the destination country. + /// The Section or partial HS Code for which you would like to view the next level of HS Code detail, if more detail is available. + public async Task> ListCrossBorderCodesAsync(String country, String hsCode) + { + var path = new AvaTaxPath("/api/v2/definitions/crossborder/{country}/{hsCode}"); + path.ApplyField("country", country); + path.ApplyField("hsCode", hsCode); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + + /// + /// List top level HS Code Sections.; + /// + /// + /// Returns the full list of top level HS Code Sections. Sections are the broadest level of detail for + /// classifying tariff codes and the items to which they apply. HS Codes are organized + /// by Section/Chapter/Heading/Subheading/Classification. + /// + /// This API is intended to be useful to identify the top level Sections for + /// further LandedCost HS Code lookups.; + /// + public async Task> ListCrossBorderSectionsAsync() + { + var path = new AvaTaxPath("/api/v2/definitions/crossborder/sections"); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + /// /// Retrieve the full list of Avalara-supported entity use codes; /// @@ -9452,6 +10104,27 @@ public async Task> ListPermissionsAsync(String filter, Int32 } + /// + /// Retrieve the full list of Avalara-supported postal codes.; + /// + /// + /// Retrieves the list of Avalara-supported postal codes.; + /// + /// 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. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public async Task> ListPostalCodesAsync(String filter, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/definitions/postalcodes"); + path.AddQuery("$filter", filter); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + /// /// Retrieve the full list of rate types for each country; /// @@ -9709,6 +10382,28 @@ public async Task ListTaxCodeTypesAsync(String filter, Int32? } + /// + /// Retrieve the full list of the Tax Forms available; + /// + /// + /// Returns the full list of Avalara-supported Tax Forms + /// This API is intended to be useful to identify all the different Tax Forms; + /// + /// 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. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public async Task> ListTaxFormsAsync(String filter, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/definitions/taxforms"); + path.AddQuery("$filter", filter); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + /// /// Retrieve the full list of tax sub types; /// @@ -9753,6 +10448,175 @@ public async Task> ListTaxTypeGroupsAsync(String } + /// + /// List all defined units of measurement; + /// + /// + /// List all units of measurement systems defined by Avalara. + /// + /// A unit of measurement system is a method of measuring a quantity, such as distance, mass, or others.; + /// + /// 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. + /// A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + public async Task> ListUnitOfMeasurementAsync(String filter, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/definitions/unitofmeasurements"); + path.AddQuery("$filter", filter); + path.AddQuery("$top", top); + path.AddQuery("$skip", skip); + path.AddQuery("$orderBy", orderBy); + return await RestCallAsync>("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Create one or more DistanceThreshold objects; + /// + /// + /// Create one or more DistanceThreshold objects for this company. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes.; + /// + /// The unique ID number of the company that owns this DistanceThreshold + /// The DistanceThreshold object or objects you wish to create. + public async Task> CreateDistanceThresholdAsync(Int32 companyId, List model) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds"); + path.ApplyField("companyId", companyId); + return await RestCallAsync>("Post", path, model).ConfigureAwait(false); + } + + + /// + /// Delete a single DistanceThreshold object; + /// + /// + /// Marks the DistanceThreshold object identified by this URL as deleted. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes.; + /// + /// The unique ID number of the company that owns this DistanceThreshold + /// The unique ID number of the DistanceThreshold object you wish to delete. + public async Task> DeleteDistanceThresholdAsync(Int32 companyId, Int64 id) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds/{id}"); + path.ApplyField("companyId", companyId); + path.ApplyField("id", id); + return await RestCallAsync>("Delete", path, null).ConfigureAwait(false); + } + + + /// + /// Retrieve a single DistanceThreshold; + /// + /// + /// Retrieves a single DistanceThreshold object defined by this URL. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes.; + /// + /// The ID of the company that owns this DistanceThreshold object + /// The unique ID number referring to this DistanceThreshold object + public async Task GetDistanceThresholdAsync(Int32 companyId, Int64 id) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds/{id}"); + path.ApplyField("companyId", companyId); + path.ApplyField("id", id); + return await RestCallAsync("Get", path, null).ConfigureAwait(false); + } + + + /// + /// Retrieve all DistanceThresholds for this company.; + /// + /// + /// Lists all DistanceThreshold objects that belong to this company. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes.; + /// + /// The ID of the company whose DistanceThreshold objects you wish to list. + /// 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/) . + /// A comma separated list of additional data to retrieve. + /// 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> ListDistanceThresholdsAsync(Int32 companyId, String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds"); + path.ApplyField("companyId", companyId); + 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); + } + + + /// + /// Retrieve all DistanceThreshold objects; + /// + /// + /// Lists all DistanceThreshold objects that belong to this company. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// 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.; + /// + /// 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/) . + /// A comma separated list of additional data to retrieve. + /// 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> QueryDistanceThresholdsAsync(String filter, String include, Int32? top, Int32? skip, String orderBy) + { + var path = new AvaTaxPath("/api/v2/distancethresholds"); + 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); + } + + + /// + /// Update a DistanceThreshold object; + /// + /// + /// Replace the existing DistanceThreshold object at this URL with an updated object. + /// + /// A company-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// All data from the existing object will be replaced with data in the object you PUT. + /// To set a field's value to null, you may either set its value to null or omit that field from the object you post.; + /// + /// The unique ID number of the company that owns this DistanceThreshold object. + /// The unique ID number of the DistanceThreshold object to replace. + /// The new DistanceThreshold object to store. + public async Task UpdateDistanceThresholdAsync(Int32 companyId, Int64 id, CompanyDistanceThresholdModel model) + { + var path = new AvaTaxPath("/api/v2/companies/{companyId}/distancethresholds/{id}"); + path.ApplyField("companyId", companyId); + path.ApplyField("id", id); + return await RestCallAsync("Put", path, model).ConfigureAwait(false); + } + + /// /// Approve existing Filing Request; /// @@ -10983,7 +11847,13 @@ public async Task FundingRequestStatusAsync(Int32 id) /// Create a new item; /// /// - /// Creates one or more new item objects attached to this company.; + /// Creates one or more new item objects attached to this company. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software.; /// /// The ID of the company that owns this item. /// The item you wish to create. @@ -10999,7 +11869,13 @@ public async Task> CreateItemsAsync(Int32 companyId, List /// - /// Marks the item object at this URL as deleted.; + /// Marks the item object at this URL as deleted. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software.; /// /// The ID of the company that owns this item. /// The ID of the item you wish to delete. @@ -11017,7 +11893,12 @@ public async Task> DeleteItemAsync(Int32 companyId, Int64 id) /// /// /// Get the item object identified by this URL. - /// An 'Item' represents a product or service that your company offers for sale.; + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software.; /// /// The ID of the company that owns this item object /// The primary key of this item @@ -11036,10 +11917,18 @@ public async Task GetItemAsync(Int32 companyId, Int64 id) /// /// List all items defined for the current company. /// - /// An 'Item' represents a product or service that your company offers for sale. + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// 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.; + /// 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: + /// + /// * Attributes; /// /// The ID of the company that defined these items /// 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/) . @@ -11065,10 +11954,19 @@ public async Task> ListItemsByCompanyAsync(Int32 companyI /// /// /// Get multiple item objects across all companies. - /// An 'Item' represents a product or service that your company offers for sale. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. /// /// 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.; + /// 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: + /// + /// * Attributes; /// /// 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/) . /// A comma separated list of additional data to retrieve. @@ -11091,7 +11989,14 @@ public async Task> QueryItemsAsync(String filter, String /// Update a single item; /// /// - /// Replace the existing item object at this URL with an updated object. + /// Replace the existing `Item` object at this URL with an updated object. + /// + /// Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you + /// can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions, + /// and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters + /// from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance + /// team can manage your item catalog and adjust the tax behavior of items without having to modify your software. + /// /// All data from the existing object will be replaced with data in the object you PUT. /// To set a field's value to null, you may either set its value to null or omit that field from the object you post.; /// @@ -13452,17 +14357,21 @@ public async Task BulkLockTransactionAsync(BulkLockTr /// /// After this API call succeeds, the transaction will have a new URL matching its new `code`. /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// 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 company code of the company that recorded this transaction /// The transaction code to change + /// (Optional): The document type of the transaction to change document code. If not provided, the default is SalesInvoice. /// The code change request you wish to execute - public async Task ChangeTransactionCodeAsync(String companyCode, String transactionCode, ChangeTransactionCodeModel model) + public async Task ChangeTransactionCodeAsync(String companyCode, String transactionCode, DocumentType? documentType, ChangeTransactionCodeModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/changecode"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } @@ -13471,20 +14380,27 @@ public async Task ChangeTransactionCodeAsync(String companyCod /// Commit a transaction for reporting; /// /// - /// Marks a transaction by changing its status to 'Committed'. + /// Marks a transaction 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). + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// Any changes made to a committed transaction will generate a transaction history.; /// /// The company code of the company that recorded this transaction /// The transaction code to commit + /// (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. /// The commit request you wish to execute - public async Task CommitTransactionAsync(String companyCode, String transactionCode, CommitTransactionModel model) + public async Task CommitTransactionAsync(String companyCode, String transactionCode, DocumentType? documentType, CommitTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/commit"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } @@ -13765,17 +14681,21 @@ public async Task> ListTransactionsByCompanyAsync( /// /// This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only. /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// 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 company code of the company that recorded this transaction /// The transaction code to lock + /// (Optional): The document type of the transaction to lock. If not provided, the default is SalesInvoice. /// The lock request you wish to execute - public async Task LockTransactionAsync(String companyCode, String transactionCode, LockTransactionModel model) + public async Task LockTransactionAsync(String companyCode, String transactionCode, DocumentType? documentType, LockTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/lock"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } @@ -13819,13 +14739,15 @@ public async Task LockTransactionAsync(String companyCode, Str /// The code of the company that made the original sale /// The transaction code of the original sale /// Specifies objects to include in the response after transaction is created + /// (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. /// Information about the refund to create - public async Task RefundTransactionAsync(String companyCode, String transactionCode, String include, RefundTransactionModel model) + public async Task RefundTransactionAsync(String companyCode, String transactionCode, String include, DocumentType? documentType, RefundTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/refund"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); path.AddQuery("$include", include); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } @@ -13834,16 +14756,27 @@ public async Task RefundTransactionAsync(String companyCode, S /// Perform multiple actions on a transaction; /// /// - /// Performs the same functions as /verify, /changecode, and /commit. You may specify one or many actions in each call to this endpoint.; + /// Performs one or more actions against the current transaction uniquely identified by this URL. + /// + /// The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`. + /// + /// 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). + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// + /// This API is available for users who want to execute more than one action at a time.; /// /// The company code of the company that recorded this transaction /// The transaction code to settle - /// The settle request containing the actions you wish to execute - public async Task SettleTransactionAsync(String companyCode, String transactionCode, SettleTransactionModel model) + /// (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. + /// The data from an external system to reconcile against AvaTax + public async Task SettleTransactionAsync(String companyCode, String transactionCode, DocumentType? documentType, SettleTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/settle"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } @@ -13853,18 +14786,24 @@ public async Task SettleTransactionAsync(String companyCode, S /// /// /// Verifies that the 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. + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// 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 company code of the company that recorded this transaction /// The transaction code to settle - /// The settle request you wish to execute - public async Task VerifyTransactionAsync(String companyCode, String transactionCode, VerifyTransactionModel model) + /// (Optional): The document type of the transaction to verify. If not provided, the default is SalesInvoice. + /// The data from an external system to reconcile against AvaTax + public async Task VerifyTransactionAsync(String companyCode, String transactionCode, DocumentType? documentType, VerifyTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/verify"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } @@ -13874,19 +14813,26 @@ public async Task VerifyTransactionAsync(String companyCode, S /// /// /// 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'. + /// + /// When you void a transaction, that transaction's status is recorded as `DocVoided`. + /// + /// If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them. + /// /// Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.; /// /// The company code of the company that recorded this transaction /// The transaction code to void + /// (Optional): The document type of the transaction to void. If not provided, the default is SalesInvoice. /// The void request you wish to execute - public async Task VoidTransactionAsync(String companyCode, String transactionCode, VoidTransactionModel model) + public async Task VoidTransactionAsync(String companyCode, String transactionCode, DocumentType? documentType, VoidTransactionModel model) { var path = new AvaTaxPath("/api/v2/companies/{companyCode}/transactions/{transactionCode}/void"); path.ApplyField("companyCode", companyCode); path.ApplyField("transactionCode", transactionCode); + path.AddQuery("documentType", documentType); return await RestCallAsync("Post", path, model).ConfigureAwait(false); } diff --git a/src/Avalara.AvaTax.net20.csproj b/src/Avalara.AvaTax.net20.csproj index d9e681c1..3a946238 100644 --- a/src/Avalara.AvaTax.net20.csproj +++ b/src/Avalara.AvaTax.net20.csproj @@ -155,6 +155,7 @@ + @@ -196,11 +197,13 @@ + + @@ -247,6 +250,7 @@ + @@ -285,6 +289,7 @@ + diff --git a/src/Avalara.AvaTax.net45.csproj b/src/Avalara.AvaTax.net45.csproj index 0c5a8965..fd82820a 100644 --- a/src/Avalara.AvaTax.net45.csproj +++ b/src/Avalara.AvaTax.net45.csproj @@ -160,6 +160,7 @@ + @@ -201,11 +202,13 @@ + + @@ -252,6 +255,7 @@ + @@ -290,6 +294,7 @@ + diff --git a/src/Avalara.AvaTax.nuspec b/src/Avalara.AvaTax.nuspec index 6ab787ca..3f3e0339 100644 --- a/src/Avalara.AvaTax.nuspec +++ b/src/Avalara.AvaTax.nuspec @@ -2,10 +2,10 @@ Avalara.AvaTax - 17.12.0.147 + 18.1.2.161 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 + Ted Spence, Zhenya Frolov, Greg Hester en-US https://developer.avalara.com https://developer.avalara.com/public/images/favicon/A-Check-RGB.png diff --git a/src/enums/ErrorCodeId.cs b/src/enums/ErrorCodeId.cs index adcea99d..0fd9c0eb 100644 --- a/src/enums/ErrorCodeId.cs +++ b/src/enums/ErrorCodeId.cs @@ -615,6 +615,36 @@ public enum ErrorCodeId /// CompanyAccountAndParentAccountMismatch, + /// + /// + /// + InvalidFileContentType, + + /// + /// + /// + InvalidItemAttributeName, + + /// + /// + /// + EcmsDisabled, + + /// + /// + /// + UnknownConjunctionError, + + /// + /// + /// + NoLinesDiscounted, + + /// + /// + /// + FailedToDelete, + /// /// Batch errors /// @@ -838,7 +868,7 @@ public enum ErrorCodeId /// /// /// - NullRefundPercentageAndLines, + RefundLinesRequired, /// /// @@ -1000,6 +1030,11 @@ public enum ErrorCodeId /// InvalidCoverLetterTitle, + /// + /// + /// + AccountNotProvisioned, + /// /// Multi document error codes /// @@ -1090,5 +1125,10 @@ public enum ErrorCodeId /// WorksheetException, + /// + /// LandedCost Exception + /// + MissingSystemId, + } } diff --git a/src/enums/ServiceTypeId.cs b/src/enums/ServiceTypeId.cs index f7f2089d..c2e2254a 100644 --- a/src/enums/ServiceTypeId.cs +++ b/src/enums/ServiceTypeId.cs @@ -110,5 +110,10 @@ public enum ServiceTypeId /// AvaBottle, + /// + /// MRSComplianceManager + /// + MRSComplianceManager, + } } diff --git a/src/enums/TaxType.cs b/src/enums/TaxType.cs index 48885b6f..032c6fef 100644 --- a/src/enums/TaxType.cs +++ b/src/enums/TaxType.cs @@ -35,6 +35,11 @@ public enum TaxType /// EWaste, + /// + /// LandedCost tax type + /// + LandedCost, + /// /// Consumer Use Tax /// diff --git a/src/models/AdjustMultiDocumentModel.cs b/src/models/AdjustMultiDocumentModel.cs index df9eca42..c6038114 100644 --- a/src/models/AdjustMultiDocumentModel.cs +++ b/src/models/AdjustMultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/AuditMultiDocumentModel.cs b/src/models/AuditMultiDocumentModel.cs index 7490ee19..80efe380 100644 --- a/src/models/AuditMultiDocumentModel.cs +++ b/src/models/AuditMultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CommitMultiDocumentModel.cs b/src/models/CommitMultiDocumentModel.cs index 1100c46c..a078ea09 100644 --- a/src/models/CommitMultiDocumentModel.cs +++ b/src/models/CommitMultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/CompanyDistanceThresholdModel.cs b/src/models/CompanyDistanceThresholdModel.cs new file mode 100644 index 00000000..5d6674c8 --- /dev/null +++ b/src/models/CompanyDistanceThresholdModel.cs @@ -0,0 +1,114 @@ +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-distance-threshold model indicates the distance between a company + /// and the taxing borders of various countries. Distance thresholds are necessary + /// to correctly calculate some value-added taxes. + /// + /// Distance thresholds only apply to sales of goods in certain countries. A distance threshold + /// is applied for each ship-from/ship-to combination of countries. The threshold amount is defined by + /// the ship-to country. + /// + /// Generally, if you have exceeded a distance threshold for taxes between a pair of countries, your tax calculation + /// will be determined to be the rate in the destination country. If you have not exceeded the threshold, + /// your tax calculation will be determined to be the rate in the origin country. + /// + /// The amount of a threshold is not tracked or managed in AvaTax, but the decision of your tax compliance department + /// as to whether you have exceeded this threshold is maintained in this object. + /// + /// By default, you are considered to have exceeded tax thresholds. If you wish to change this default, you can create + /// a company-distance-threshold object to select the correct behavior for this origin/destination tax calculation process. + /// + public class CompanyDistanceThresholdModel + { + /// + /// A unique ID number representing this distance threshold object. + /// + public Int64? id { get; set; } + + /// + /// The ID number of the company that defined this distance threshold. + /// + public Int32? companyId { get; set; } + + /// + /// The origin country for this threshold. + /// + /// 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 originCountry { get; set; } + + /// + /// The destination country for this threshold. + /// + /// 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 destinationCountry { get; set; } + + /// + /// For distance threshold values that change over time, this is the earliest date for which this distance + /// threshold is valid. If null, this distance threshold is valid for all dates earlier than the `endDate` field. + /// + public DateTime? effDate { get; set; } + + /// + /// For distance threshold values that change over time, this is the latest date for which this distance + /// threshold is valid. If null, this distance threshold is valid for all dates later than the `effDate` field. + /// + public DateTime? endDate { get; set; } + + /// + /// True if your tax professional has determined that the value-added tax distance threshold is exceeded for this pair of countries. + /// + /// If you set this value to `false`, your value added taxes will be calculated using the origin country. Otherwise, value + /// added taxes will be calculated on the destination country. + /// + public Boolean? thresholdExceeded { get; set; } + + /// + /// Indicates the distance threshold type. + /// + /// This value can be either `Sale` or `Purchase`. + /// + public String type { 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/CompanyModel.cs b/src/models/CompanyModel.cs index 03ac94da..9bedd4d2 100644 --- a/src/models/CompanyModel.cs +++ b/src/models/CompanyModel.cs @@ -201,6 +201,16 @@ public class CompanyModel /// public List exemptCerts { get; set; } + /// + /// The unique identifier of the mini-one-stop-shop used for Value Added Tax (VAT) processing. + /// + public String mossId { get; set; } + + /// + /// The country code of the mini-one-stop-shop used for Value Added Tax (VAT) processing. + /// + public String mossCountry { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/CreateMultiDocumentModel.cs b/src/models/CreateMultiDocumentModel.cs index 74ee8659..7b5fca5f 100644 --- a/src/models/CreateMultiDocumentModel.cs +++ b/src/models/CreateMultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient @@ -213,7 +210,15 @@ public class CreateMultiDocumentModel public String businessIdentificationNo { get; set; } /// - /// Specifies if the Transaction has the seller as IsSellerImporterOfRecord. + /// Specifies if the transaction should have value-added and cross-border taxes calculated with the seller as the importer of record. + /// + /// Some taxes only apply if the seller is the importer of record for a product. In cases where companies are working together to + /// ship products, there may be mutual agreement as to which company is the entity designated as importer of record. The importer + /// of record will then be the company designated to pay taxes marked as being obligated to the importer of record. + /// + /// Set this value to `true` to consider your company as the importer of record and collect these taxes. + /// + /// This value may also be set at the Nexus level. See `NexusModel` for more information. /// public Boolean? isSellerImporterOfRecord { get; set; } diff --git a/src/models/CreateTransactionModel.cs b/src/models/CreateTransactionModel.cs index 525ee9d8..bfef75a8 100644 --- a/src/models/CreateTransactionModel.cs +++ b/src/models/CreateTransactionModel.cs @@ -190,7 +190,15 @@ public class CreateTransactionModel public String businessIdentificationNo { get; set; } /// - /// Specifies if the Transaction has the seller as IsSellerImporterOfRecord. + /// Specifies if the transaction should have value-added and cross-border taxes calculated with the seller as the importer of record. + /// + /// Some taxes only apply if the seller is the importer of record for a product. In cases where companies are working together to + /// ship products, there may be mutual agreement as to which company is the entity designated as importer of record. The importer + /// of record will then be the company designated to pay taxes marked as being obligated to the importer of record. + /// + /// Set this value to `true` to consider your company as the importer of record and collect these taxes. + /// + /// This value may also be set at the Nexus level. See `NexusModel` for more information. /// public Boolean? isSellerImporterOfRecord { get; set; } diff --git a/src/models/ErrorDetail.cs b/src/models/ErrorDetail.cs index 13289bf6..048300a7 100644 --- a/src/models/ErrorDetail.cs +++ b/src/models/ErrorDetail.cs @@ -25,10 +25,7 @@ public class ErrorDetail /// /// Name of the error or message. /// - /// - /// 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; } + public ErrorCodeId? code { get; set; } /// /// Unique ID number referring to this error or message. diff --git a/src/models/FilingReturnModel.cs b/src/models/FilingReturnModel.cs index fd6c64aa..6066dfa9 100644 --- a/src/models/FilingReturnModel.cs +++ b/src/models/FilingReturnModel.cs @@ -157,6 +157,21 @@ public class FilingReturnModel /// public Decimal? totalAdjustments { get; set; } + /// + /// The amount of sales excluded from the liability calculation + /// + public Decimal? excludedSalesAmount { get; set; } + + /// + /// The amount of non-taxable sales excluded from the liability calculation + /// + public Decimal? excludedNonTaxableAmount { get; set; } + + /// + /// The amount of tax excluded from the liability calculation + /// + public Decimal? excludedTaxAmount { get; set; } + /// /// The Adjustments for this return. /// diff --git a/src/models/FilingReturnModelBasic.cs b/src/models/FilingReturnModelBasic.cs index 80e78e8c..9227f790 100644 --- a/src/models/FilingReturnModelBasic.cs +++ b/src/models/FilingReturnModelBasic.cs @@ -166,6 +166,21 @@ public class FilingReturnModelBasic /// public Decimal? consumerUseTaxableAmount { get; set; } + /// + /// The amount of sales excluded from the liability calculation + /// + public Decimal? excludedSalesAmount { get; set; } + + /// + /// The amount of non-taxable sales excluded from the liability calculation + /// + public Decimal? excludedNonTaxableAmount { get; set; } + + /// + /// The amount of tax excluded from the liability calculation + /// + public Decimal? excludedTaxAmount { get; set; } + /// /// Accrual type of the return /// diff --git a/src/models/FormMasterModel.cs b/src/models/FormMasterModel.cs new file mode 100644 index 00000000..5903a07c --- /dev/null +++ b/src/models/FormMasterModel.cs @@ -0,0 +1,545 @@ +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 information about a tax form known to Avalara + /// + public class FormMasterModel + { + /// + /// Unique ID number of this form master object + /// + public Int32? id { get; set; } + + /// + /// The type of the form being submitted + /// + public Int32? formTypeId { get; set; } + + /// + /// Unique tax form code representing this tax form + /// + public String taxFormCode { get; set; } + + /// + /// Legacy return name as known in the AvaFileForm table + /// + public String legacyReturnName { get; set; } + + /// + /// Human readable form summary name + /// + public String taxFormName { get; set; } + + /// + /// Description of this tax form + /// + public String description { get; set; } + + /// + /// True if this form is available for use + /// + public Boolean? isEffective { get; set; } + + /// + /// ISO 3166 code of the country that issued this tax form + /// + public String country { get; set; } + + /// + /// The region within which this form was issued + /// + public String region { get; set; } + + /// + /// Tax authority that issued the form + /// + public String authorityName { get; set; } + + /// + /// DEPRECATED + /// + public String shortCode { get; set; } + + /// + /// Day of the month when the form is due + /// + public Int32? dueDay { get; set; } + + /// + /// Day of the month on which the form is considered delinquent. Almost always the same as DueDay + /// + public Int32? delinquentDay { get; set; } + + /// + /// Month of the year the state considers as the first fiscal month + /// + public Int32? fiscalYearStartMonth { get; set; } + + /// + /// Can form support multi frequencies + /// + public Boolean? hasMultiFrequencies { get; set; } + + /// + /// Does this tax authority require a power of attorney in order to speak to Avalara + /// + public Boolean? isPOARequired { get; set; } + + /// + /// True if this form requires that the customer register with the authority + /// + public Boolean? isRegistrationRequired { get; set; } + + /// + /// Unused + /// + public Boolean? hasMultiRegistrationMethods { get; set; } + + /// + /// Unused + /// + public Boolean? hasSchedules { get; set; } + + /// + /// Unused + /// + public Boolean? hasMultiFilingMethods { get; set; } + + /// + /// Unused + /// + public Boolean? hasMultiPayMethods { get; set; } + + /// + /// Unused + /// + public Boolean? isEFTRequired { get; set; } + + /// + /// Unused + /// + public Boolean? isFilePayMethodLinked { get; set; } + + /// + /// Unused + /// + public Int32? mailingReceivedRuleId { get; set; } + + /// + /// Unused + /// + public Int32? proofOfMailingId { get; set; } + + /// + /// True if you can report a negative amount in a single jurisdiction on the form + /// + public Boolean? isNegAmountAllowed { get; set; } + + /// + /// True if the form overall can go negative + /// + public Boolean? allowNegativeOverallTax { get; set; } + + /// + /// Unused + /// + public Boolean? isNettingRequired { get; set; } + + /// + /// Unused + /// + public Int32? roundingMethodId { get; set; } + + /// + /// Total amount of discounts that can be received by a vendor each year + /// + public Decimal? vendorDiscountAnnualMax { get; set; } + + /// + /// Unused + /// + public Boolean? versionsRequireAuthorityApproval { get; set; } + + /// + /// Type of outlet reporting for this form + /// + public Int32? outletReportingMethodId { get; set; } + + /// + /// Unused + /// + public Boolean? hasReportingCodes { get; set; } + + /// + /// Not sure if used + /// + public Boolean? hasPrepayments { get; set; } + + /// + /// Unused + /// + public Boolean? grossIncludesInterstateSales { get; set; } + + /// + /// Unused + /// + public String grossIncludesTax { get; set; } + + /// + /// Unused + /// + public Boolean? hasEfileFee { get; set; } + + /// + /// Unused + /// + public Boolean? hasEpayFee { get; set; } + + /// + /// Unused + /// + public Boolean? hasDependencies { get; set; } + + /// + /// Unused + /// + public String requiredEfileTrigger { get; set; } + + /// + /// Unused + /// + public String requiredEftTrigger { get; set; } + + /// + /// Unused + /// + public Boolean? vendorDiscountEfile { get; set; } + + /// + /// Unused + /// + public Boolean? vendorDiscountPaper { get; set; } + + /// + /// Unused + /// + public String peerReviewed { get; set; } + + /// + /// Unused + /// + public String peerReviewedId { get; set; } + + /// + /// Unused + /// + public String peerReviewedDate { get; set; } + + /// + /// ID of the Avalara user who created the form + /// + public Int32? createdUserId { get; set; } + + /// + /// Date when form was created + /// + public DateTime? createdDate { get; set; } + + /// + /// ID of the Avalara user who modified the form + /// + public Int32? modifiedUserId { get; set; } + + /// + /// Date when form was modified + /// + public DateTime? modifiedDate { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddressMailTo { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddress1 { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddress2 { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddressCity { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddressRegion { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddressPostalCode { get; set; } + + /// + /// Mailing address of the department of revenue + /// + public String dorAddressCountry { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddressMailTo { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddress1 { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddress2 { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddressCity { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddressRegion { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddressPostalCode { get; set; } + + /// + /// Mailing address to use when a zero dollar form is filed + /// + public String zeroAddressCountry { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddressMailTo { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddress1 { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddress2 { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddressCity { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddressRegion { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddressPostalCode { get; set; } + + /// + /// Mailing address to use when filing an amended return + /// + public String amendedAddressCountry { get; set; } + + /// + /// Unused + /// + public Boolean? onlineBackFiling { get; set; } + + /// + /// Unused + /// + public Boolean? onlineAmendedReturns { get; set; } + + /// + /// --Need Further Clarification + /// + public String prepaymentFrequency { get; set; } + + /// + /// Unused + /// + public Boolean? outletLocationIdentifiersRequired { get; set; } + + /// + /// --Need Further Clarification + /// + public String listingSortOrder { get; set; } + + /// + /// Link to the state department of revenue website, if available + /// + public String dorWebsite { get; set; } + + /// + /// --Need Further Clarification + /// + public Boolean? fileForAllOutlets { get; set; } + + /// + /// --Need Further Clarification + /// + public Boolean? paperFormsDoNotHaveDiscounts { get; set; } + + /// + /// Internal behavior + /// + public Boolean? stackAggregation { get; set; } + + /// + /// --Need Further Clarification + /// + public String roundingPrecision { get; set; } + + /// + /// --Need Further Clarification + /// + public String inconsistencyTolerance { get; set; } + + /// + /// Date when this form became effective + /// + public DateTime? effDate { get; set; } + + /// + /// Date when this form expired + /// + public DateTime? endDate { get; set; } + + /// + /// True if this form can be shown to customers + /// + public Boolean? visibleToCustomers { get; set; } + + /// + /// True if this form requires that you set up outlets in the state + /// + public Boolean? requiresOutletSetup { get; set; } + + /// + /// True if this state permits payment by ACH Credit + /// + public Boolean? achCreditAllowed { get; set; } + + /// + /// Jurisdiction level of the state + /// + public String reportLevel { get; set; } + + /// + /// True if this form is verified filed via email + /// + public Boolean? postOfficeValidated { get; set; } + + /// + /// Internal Avalara flag + /// + public String stackAggregationOption { get; set; } + + /// + /// Internal Avalara flag + /// + public String sstBehavior { get; set; } + + /// + /// Internal Avalara flag + /// + public String nonSstBehavior { get; set; } + + /// + /// Phone number of the department of revenue + /// + public String dorPhoneNumber { get; set; } + + /// + /// Unused + /// + public String averageCheckClearDays { get; set; } + + /// + /// Unused + /// + public Boolean? filterZeroRatedLineDetails { get; set; } + + /// + /// Unused + /// + public Boolean? allowsBulkFilingAccounts { get; set; } + + /// + /// Unused + /// + public String bulkAccountInstructionLink { get; set; } + + /// + /// Unused + /// + public String registrationIdFormat { get; set; } + + /// + /// Unused + /// + public String thresholdTrigger { get; set; } + + /// + /// Unused + /// + public String transactionSortingOption { get; set; } + + /// + /// Unused + /// + public Int32? contentReviewFrequencyId { get; set; } + + /// + /// Unused + /// + public String aliasForFormMasterId { 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/FundingConfigurationModel.cs b/src/models/FundingConfigurationModel.cs index 3b20230e..85dd7aee 100644 --- a/src/models/FundingConfigurationModel.cs +++ b/src/models/FundingConfigurationModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/HsCodeModel.cs b/src/models/HsCodeModel.cs new file mode 100644 index 00000000..f3c341c7 --- /dev/null +++ b/src/models/HsCodeModel.cs @@ -0,0 +1,102 @@ +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 +{ + /// + /// Describes an element in the harmonized tariff system. + /// + /// According to the [United States International Trade Commission](https://www.usitc.gov), the harmonized tariff schedule is defined as follows: + /// + /// The HTS is a U.S. nomenclature system used to classify traded goods based on their material composition, product name, and/or intended + /// function. The HTS is designed so that each article falls into only one category. It is divided into chapters, each of which has a 2-digit + /// number. Each product category within the various chapters is designated by 4, 6, 8, or 10 digits. The 4-digit categories are called + /// "headings." The 6-, 8- and 10-digit classifications are called "subheadings." + /// + /// Within AvaTax, the `HsCodeModel` object can refer to sections, chapters, headings, subheadings, or articles. Each object represents one + /// classification. Many of these objects have child objects underneath them; these child objects are more specific than their parent objects. + /// + public class HsCodeModel + { + /// + /// The harmonized tariff system code for this section and chapter. + /// + /// A full HS code contains more than six characters. Partial HS codes with two, four, or six characters may have child codes underneath them. + /// A child code is one that contains greater specificity than a parent code. It is recommended that when you identify a product you use + /// the most detailed code available to identify it. + /// + /// Top level sections do not have HS Codes. + /// + public String hsCode { get; set; } + + /// + /// A unique identifier for this harmonized tariff system code. + /// + /// To search for a list of child codes underneath a specific HS code, search for codes where the child's `parentHsCodeId` value matches the parent's `id` value. + /// + public Int64 id { get; set; } + + /// + /// The unique ID number of the parent HS code or HS code prefix. + /// + /// To search for a list of child codes underneath a specific HS code, search for codes where the child's `parentHsCodeId` value matches the parent's `id` value. + /// + public Int64? parentHsCodeId { get; set; } + + /// + /// A human readable description that identifies Code descriptive text for this Section, Chapter, Heading, or Subheading. + /// + public String description { get; set; } + + /// + /// The system to which this HS code belongs. + /// + public String system { get; set; } + + /// + /// The destination country identified with this HS Code. This value applies when certain products are classified in specific ways by + /// bilateral trade agreements. + /// + public String destinationCountry { get; set; } + + /// + /// For codes that have been expired or defined on specific dates, this value indicates the earliest + /// date for which this code is considered valid. + /// + /// If this value is null, this code can be used for any valid date earlier than its end date. + /// + public DateTime? effDate { get; set; } + + /// + /// For codes that have been expired or defined on specific dates, this value indicates the latest + /// date for which this code is considered valid. + /// + /// If this value is null, this code can be used for any valid date later than its effective date. + /// + public DateTime? endDate { 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/IsoLocalizedName.cs b/src/models/IsoLocalizedName.cs index 56bd4137..2a77e3e6 100644 --- a/src/models/IsoLocalizedName.cs +++ b/src/models/IsoLocalizedName.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/LineItemModel.cs b/src/models/LineItemModel.cs index 85043c39..2f739067 100644 --- a/src/models/LineItemModel.cs +++ b/src/models/LineItemModel.cs @@ -23,17 +23,23 @@ namespace Avalara.AvaTax.RestClient public class LineItemModel { /// - /// Line number within this document + /// The line number of this line within the document. This can be any text that is useful to you, such as numeric line numbers, alphabetic line numbers, or other text. /// public String number { get; set; } /// - /// Quantity of items in this line + /// Quantity of items in this line. This quantity value should always be a positive value representing the quantity of product that changed hands, even when handling returns or refunds. + /// + /// If not provided, or if set to zero, the quantity value is assumed to be one (1). /// - public Decimal quantity { get; set; } + public Decimal? quantity { get; set; } /// - /// Total amount for this line + /// Total amount for this line. The amount represents the net currency value that changed hands from the customer (represented by the `customerCode` field) to the company (represented by the `companyCode`) field. + /// + /// For sale transactions, this value must be positive. It indicates the amount of money paid by the customer to the company. + /// + /// For refund or return transactions, this value must be negative. /// public Decimal amount { get; set; } @@ -55,28 +61,32 @@ public class LineItemModel public String taxCode { get; set; } /// - /// DEPERECATED - Customer Usage Type - The client application customer or usage type. - /// Please use entityUseCode instead. + /// DEPRECATED - Please use `entityUseCode` instead. /// public String customerUsageType { get; set; } /// - /// Entity Use Code - The client application customer or usage type. + /// Entity Use Code - The client application customer or usage type. This field allows you to designate a type of usage that + /// may make this transaction considered exempt by reason of exempt usage. + /// + /// For a list of entity use codes, see the Definitions API `ListEntityUseCodes`. /// public String entityUseCode { get; set; } /// - /// Item Code (SKU) + /// Item Code (SKU). If you provide an `itemCode` field, the AvaTax API will look up the item you created with the `CreateItems` API call + /// and use all the information available about that item for this transaction. /// public String itemCode { get; set; } /// - /// Exemption number for this line + /// Exemption certificate number for this line. /// public String exemptionCode { get; set; } /// - /// True if the document discount should be applied to this line + /// True if the document discount should be applied to this line. If this value is false, or not provided, discounts will not be + /// applied to this line even if they are specified on the root `discount` element. /// public Boolean? discounted { get; set; } @@ -90,22 +100,30 @@ public class LineItemModel public Boolean? taxIncluded { get; set; } /// - /// Revenue Account + /// Revenue Account (Customer Defined Field). + /// + /// This field is available for you to use to provide whatever information your implementation requires. It does not affect tax calculation. /// public String revenueAccount { get; set; } /// - /// Reference 1 - Client specific reference field + /// Ref1 (Customer Defined Field) + /// + /// This field is available for you to use to provide whatever information your implementation requires. It does not affect tax calculation. /// public String ref1 { get; set; } /// - /// Reference 2 - Client specific reference field + /// Ref2 (Customer Defined Field) + /// + /// This field is available for you to use to provide whatever information your implementation requires. It does not affect tax calculation. /// public String ref2 { get; set; } /// - /// Item description. This is required for SST transactions if an unmapped ItemCode is used. + /// Item description. + /// + /// For Streamlined Sales Tax (SST) customers, this field is required if an unmapped `itemCode` is used. /// public String description { get; set; } @@ -120,16 +138,25 @@ public class LineItemModel public String businessIdentificationNo { get; set; } /// - /// Specifies a tax override for this line + /// 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. + /// + /// To get a full list of available parameters, please use the `ListParameters` API. /// public Dictionary parameters { get; set; } + /// + /// The Item code for Custom Duty / Global Import tax determination + /// Harmonized Tariff System code for this transaction. + /// + /// For a list of harmonized tariff codes, see the Definitions API for harmonized tariff codes. + /// + public String hsCode { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/MrsCompanyModel.cs b/src/models/MrsCompanyModel.cs index 3ae9e100..619ef7dd 100644 --- a/src/models/MrsCompanyModel.cs +++ b/src/models/MrsCompanyModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient @@ -50,6 +47,11 @@ public class MrsCompanyModel /// public String tin { get; set; } + /// + /// The company code for the company + /// + public String companyCode { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/MultiDocumentLineItemModel.cs b/src/models/MultiDocumentLineItemModel.cs index 1e86e7da..63bb34ae 100644 --- a/src/models/MultiDocumentLineItemModel.cs +++ b/src/models/MultiDocumentLineItemModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient @@ -40,17 +37,23 @@ public class MultiDocumentLineItemModel public String reportingLocationCode { get; set; } /// - /// Line number within this document + /// The line number of this line within the document. This can be any text that is useful to you, such as numeric line numbers, alphabetic line numbers, or other text. /// public String number { get; set; } /// - /// Quantity of items in this line + /// Quantity of items in this line. This quantity value should always be a positive value representing the quantity of product that changed hands, even when handling returns or refunds. + /// + /// If not provided, or if set to zero, the quantity value is assumed to be one (1). /// - public Decimal quantity { get; set; } + public Decimal? quantity { get; set; } /// - /// Total amount for this line + /// Total amount for this line. The amount represents the net currency value that changed hands from the customer (represented by the `customerCode` field) to the company (represented by the `companyCode`) field. + /// + /// For sale transactions, this value must be positive. It indicates the amount of money paid by the customer to the company. + /// + /// For refund or return transactions, this value must be negative. /// public Decimal amount { get; set; } @@ -72,28 +75,32 @@ public class MultiDocumentLineItemModel public String taxCode { get; set; } /// - /// DEPERECATED - Customer Usage Type - The client application customer or usage type. - /// Please use entityUseCode instead. + /// DEPRECATED - Please use `entityUseCode` instead. /// public String customerUsageType { get; set; } /// - /// Entity Use Code - The client application customer or usage type. + /// Entity Use Code - The client application customer or usage type. This field allows you to designate a type of usage that + /// may make this transaction considered exempt by reason of exempt usage. + /// + /// For a list of entity use codes, see the Definitions API `ListEntityUseCodes`. /// public String entityUseCode { get; set; } /// - /// Item Code (SKU) + /// Item Code (SKU). If you provide an `itemCode` field, the AvaTax API will look up the item you created with the `CreateItems` API call + /// and use all the information available about that item for this transaction. /// public String itemCode { get; set; } /// - /// Exemption number for this line + /// Exemption certificate number for this line. /// public String exemptionCode { get; set; } /// - /// True if the document discount should be applied to this line + /// True if the document discount should be applied to this line. If this value is false, or not provided, discounts will not be + /// applied to this line even if they are specified on the root `discount` element. /// public Boolean? discounted { get; set; } @@ -107,22 +114,30 @@ public class MultiDocumentLineItemModel public Boolean? taxIncluded { get; set; } /// - /// Revenue Account + /// Revenue Account (Customer Defined Field). + /// + /// This field is available for you to use to provide whatever information your implementation requires. It does not affect tax calculation. /// public String revenueAccount { get; set; } /// - /// Reference 1 - Client specific reference field + /// Ref1 (Customer Defined Field) + /// + /// This field is available for you to use to provide whatever information your implementation requires. It does not affect tax calculation. /// public String ref1 { get; set; } /// - /// Reference 2 - Client specific reference field + /// Ref2 (Customer Defined Field) + /// + /// This field is available for you to use to provide whatever information your implementation requires. It does not affect tax calculation. /// public String ref2 { get; set; } /// - /// Item description. This is required for SST transactions if an unmapped ItemCode is used. + /// Item description. + /// + /// For Streamlined Sales Tax (SST) customers, this field is required if an unmapped `itemCode` is used. /// public String description { get; set; } @@ -137,16 +152,25 @@ public class MultiDocumentLineItemModel public String businessIdentificationNo { get; set; } /// - /// Specifies a tax override for this line + /// 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. + /// + /// To get a full list of available parameters, please use the `ListParameters` API. /// public Dictionary parameters { get; set; } + /// + /// The Item code for Custom Duty / Global Import tax determination + /// Harmonized Tariff System code for this transaction. + /// + /// For a list of harmonized tariff codes, see the Definitions API for harmonized tariff codes. + /// + public String hsCode { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/MultiDocumentModel.cs b/src/models/MultiDocumentModel.cs index c17d56eb..09636b47 100644 --- a/src/models/MultiDocumentModel.cs +++ b/src/models/MultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/NewAccountRequestModel.cs b/src/models/NewAccountRequestModel.cs index 517ebfd1..8cb734ae 100644 --- a/src/models/NewAccountRequestModel.cs +++ b/src/models/NewAccountRequestModel.cs @@ -79,6 +79,14 @@ public class NewAccountRequestModel /// public String website { get; set; } + /// + /// Payment Method to be associated with the account. + /// + /// This is strictly to be used internally unless your Avalara business development manager specifically asks you to provide this value + /// while attempting to create an account. + /// + public String paymentMethodId { get; set; } + /// /// First name of the primary contact person for this account /// diff --git a/src/models/NexusModel.cs b/src/models/NexusModel.cs index ddde451c..dc4751a6 100644 --- a/src/models/NexusModel.cs +++ b/src/models/NexusModel.cs @@ -179,6 +179,20 @@ public class NexusModel /// public Int64? taxAuthorityId { get; set; } + /// + /// For nexus declarations at the country level, specifies whether this company is considered the importer of record in this nexus region. + /// + /// Some taxes only apply if the seller is the importer of record for a product. In cases where companies are working together to + /// ship products, there may be mutual agreement as to which company is the entity designated as importer of record. The importer + /// of record will then be the company designated to pay taxes marked as being obligated to the importer of record. + /// + /// Set this value to `true` to consider your company as the importer of record and collect these taxes. Leave this value as false + /// or null and taxes will be calculated as if your company is not the importer of record. + /// + /// This value may also be set during each transaction API call. See `CreateTransaction()` for more information. + /// + public Boolean? isSellerImporterOfRecord { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/PingResultModel.cs b/src/models/PingResultModel.cs index 67db1f7e..bafb4739 100644 --- a/src/models/PingResultModel.cs +++ b/src/models/PingResultModel.cs @@ -52,6 +52,11 @@ public class PingResultModel /// public Int32? authenticatedAccountId { get; set; } + /// + /// The connected Salesforce account. + /// + public String crmid { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/PostalCodeModel.cs b/src/models/PostalCodeModel.cs new file mode 100644 index 00000000..d44a555d --- /dev/null +++ b/src/models/PostalCodeModel.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 +{ + /// + /// Represents a PostalCode and its associated data like: country, region, effective dates, etc. + /// + public class PostalCodeModel + { + /// + /// Country this PostalCode locates in + /// + public String country { get; set; } + + /// + /// The Region/State/Province this PostalCode locates in + /// + public String region { get; set; } + + /// + /// An Avalara assigned TaxRegion Id associated to the PostalCode + /// + public Int32? taxRegionId { get; set; } + + /// + /// The date when the PostalCode becomes effective + /// + public DateTime? effDate { get; set; } + + /// + /// The date when the PostalCode becomes expired + /// + public DateTime? endDate { get; set; } + + /// + /// The postalCode + /// + public String postalCode { 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/ReconstructedMultiDocumentModel.cs b/src/models/ReconstructedMultiDocumentModel.cs index 718f0d44..7f589efd 100644 --- a/src/models/ReconstructedMultiDocumentModel.cs +++ b/src/models/ReconstructedMultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/src/models/TaxRuleModel.cs b/src/models/TaxRuleModel.cs index be053924..c04ba9ed 100644 --- a/src/models/TaxRuleModel.cs +++ b/src/models/TaxRuleModel.cs @@ -170,6 +170,7 @@ public class TaxRuleModel /// * Common alternative spellings for many regions /// /// For a full list of all supported codes and names, please see the Definitions API `ListRegions`. + /// NOTE: Region is not required for non-US countries because the user may be either creating a Country-level or Region-level rule. /// public String region { get; set; } @@ -218,6 +219,31 @@ public class TaxRuleModel /// public Int32? rateTypeTaxTypeMappingId { get; set; } + /// + /// Indicates the expression to use to determine whether this tax rule generates a non-passthrough tax. + /// + /// Non-passthrough taxes are taxes that cannot be charged to the customer. + /// + public String nonPassthroughExpression { get; set; } + + /// + /// The currency code to use for this rule. + /// + public String currencyCode { get; set; } + + /// + /// For rules that only apply to one tax code program, this value indicates what program should be used for implementing this rule. + /// + public Int32? preferredProgramId { get; set; } + + /// + /// For tax rules that are calculated using units of measurement, this indicates the unit of measurement type + /// used to calculate the amounts for this rule. + /// + /// For a list of units of measurement, please call `ListUnitsOfMeasurement()`. + /// + public Int32? uomId { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/TransactionAddressModel.cs b/src/models/TransactionAddressModel.cs index c3080529..8171c673 100644 --- a/src/models/TransactionAddressModel.cs +++ b/src/models/TransactionAddressModel.cs @@ -58,7 +58,7 @@ public class TransactionAddressModel public String city { get; set; } /// - /// The region, state, or province for the address. + /// The ISO 3166 region code. E.g., the second part of ISO 3166-2. /// public String region { get; set; } @@ -68,7 +68,7 @@ public class TransactionAddressModel public String postalCode { get; set; } /// - /// The country for the address. + /// The ISO 3166 country code /// public String country { get; set; } @@ -78,12 +78,12 @@ public class TransactionAddressModel public Int32? taxRegionId { get; set; } /// - /// Latitude for this address (CALC - 13394) + /// Latitude for this address /// public String latitude { get; set; } /// - /// Longitude for this address (CALC - 13394) + /// Longitude for this address /// public String longitude { get; set; } diff --git a/src/models/TransactionLineDetailModel.cs b/src/models/TransactionLineDetailModel.cs index a8824f6a..90382b5c 100644 --- a/src/models/TransactionLineDetailModel.cs +++ b/src/models/TransactionLineDetailModel.cs @@ -219,6 +219,13 @@ public class TransactionLineDetailModel /// public String unitOfBasis { get; set; } + /// + /// True if this value is a non-passthrough tax. + /// + /// A non-passthrough tax is a tax that may not be charged to a customer; it must be paid directly by the company. + /// + public Boolean? isNonPassThru { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/TransactionLineModel.cs b/src/models/TransactionLineModel.cs index 09e4ed6a..9f59badd 100644 --- a/src/models/TransactionLineModel.cs +++ b/src/models/TransactionLineModel.cs @@ -222,10 +222,23 @@ public class TransactionLineModel public Boolean? taxIncluded { get; set; } /// - /// Optional: A list of tax details for this line item. To fetch this list, add the query string "?$include=Details" to your URL. + /// Optional: A list of tax details for this line item. + /// + /// Tax details represent taxes being charged by various tax authorities. Taxes that appear in the `details` collection are intended to be + /// displayed to the customer and charged as a 'tax' on the invoice. + /// + /// To fetch this list, add the query string `?$include=Details` to your URL. /// public List details { get; set; } + /// + /// Optional: A list of non-passthrough tax details for this line item. + /// + /// Tax details represent taxes being charged by various tax authorities. Taxes that appear in the `nonPassthroughDetails` collection are + /// taxes that must be paid directly by the company and not shown to the customer. + /// + public List nonPassthroughDetails { get; set; } + /// /// Optional: A list of location types for this line item. To fetch this list, add the query string "?$include=LineLocationTypes" to your URL. /// @@ -236,6 +249,17 @@ public class TransactionLineModel /// public Dictionary parameters { get; set; } + /// + /// The cross-border harmonized system code (HSCode) used to calculate tariffs and duties for this line item. + /// For a full list of HS codes, see `ListCrossBorderCodes()`. + /// + public String hsCode { get; set; } + + /// + /// Indicates the cost of insurance and freight for this line. + /// + public Decimal? costInsuranceFreight { get; set; } + /// /// Convert this object to a JSON string of itself diff --git a/src/models/TransactionModel.cs b/src/models/TransactionModel.cs index aeaaa326..54aef85d 100644 --- a/src/models/TransactionModel.cs +++ b/src/models/TransactionModel.cs @@ -227,6 +227,9 @@ public class TransactionModel public Decimal? exchangeRate { get; set; } /// + /// By default, the value is null, when the value is null, the value can be set at nexus level and used. + /// If the value is not null, it will override the value at nexus level. + /// /// 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. diff --git a/src/models/UomModel.cs b/src/models/UomModel.cs new file mode 100644 index 00000000..2c2d05ed --- /dev/null +++ b/src/models/UomModel.cs @@ -0,0 +1,84 @@ +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 +{ + /// + /// The "Unit of Measurement" model captures information about a type of measurement. Types of measurement refer to + /// different scales for the same dimension. For example, measurements of type "Distance" may include units of measurement + /// such as meters, feet, inches, and miles. + /// + public class UomModel + { + /// + /// The unique ID number of this unit of measurement. + /// + public Int32? id { get; set; } + + /// + /// The code that refers to this unit of measurement. + /// + public String code { get; set; } + + /// + /// A short description of this unit of measurement. + /// + public String shortDesc { get; set; } + + /// + /// A longer description of this unit of measurement. + /// + public String description { get; set; } + + /// + /// The ID number of the measurement type, such as "Distance" or "Mass". + /// + public Int32? measurementTypeId { get; set; } + + /// + /// The code describing the measurement type. + /// + public String measurementTypeCode { get; set; } + + /// + /// For a particular measurement type, this is the ID number of the unit of measurement object corresponding to the + /// International System of Units (abbreviated SI) unit of measurement standard. This pointer allows you to select + /// the SI unit of measurement for a particular measurement type. + /// + public String siUOM { get; set; } + + /// + /// A description of the measurement type system. + /// + public String measurementTypeDescription { get; set; } + + /// + /// True if this measurement is an International System of Units (abbreviated SI) defined standard. + /// + public Boolean? isSiUom { 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/VerifyMultiDocumentModel.cs b/src/models/VerifyMultiDocumentModel.cs index 0dca3da7..90a5cc04 100644 --- a/src/models/VerifyMultiDocumentModel.cs +++ b/src/models/VerifyMultiDocumentModel.cs @@ -12,10 +12,7 @@ * * @author Ted Spence * @author Zhenya Frolov -<<<<<<< HEAD -======= * @author Greg Hester ->>>>>>> 5772f82e9b5d7d2aa37973d9dec53f2633b41978 */ namespace Avalara.AvaTax.RestClient diff --git a/tests/net20/TransactionTests.cs b/tests/net20/TransactionTests.cs index 6edc131b..a3ebcbcb 100644 --- a/tests/net20/TransactionTests.cs +++ b/tests/net20/TransactionTests.cs @@ -130,14 +130,14 @@ public void TransactionWorkflow() Assert.True(transaction.lines[2].ref1.Contains("Reference!"), "Line3 should have had a Ref1."); // Now commit that transaction - var commitResult = Client.CommitTransaction(TestCompany.companyCode, transaction.code, new CommitTransactionModel { commit = true }); + var commitResult = Client.CommitTransaction(TestCompany.companyCode, transaction.code, null, new CommitTransactionModel { commit = true }); // Ensure that this transaction was committed Assert.NotNull(commitResult, "Should have been able to call CommitTransaction"); Assert.True(commitResult.status == DocumentStatus.Committed, "Transaction should have been committed"); // Now void the transaction - var voidResult = Client.VoidTransaction(TestCompany.companyCode, transaction.code, new VoidTransactionModel + var voidResult = Client.VoidTransaction(TestCompany.companyCode, transaction.code, null, new VoidTransactionModel { code = VoidReasonCode.DocVoided }); diff --git a/tests/net45/TransactionTests.cs b/tests/net45/TransactionTests.cs index d4e2ba39..f76b38d6 100644 --- a/tests/net45/TransactionTests.cs +++ b/tests/net45/TransactionTests.cs @@ -130,14 +130,14 @@ public void TransactionWorkflow() Assert.True(transaction.lines[2].ref1.Contains("Reference!"), "Line3 should have had a Ref1."); // Now commit that transaction - var commitResult = Client.CommitTransaction(TestCompany.companyCode, transaction.code, new CommitTransactionModel() { commit = true }); + var commitResult = Client.CommitTransaction(TestCompany.companyCode, transaction.code, null, new CommitTransactionModel() { commit = true }); // Ensure that this transaction was committed Assert.NotNull(commitResult, "Should have been able to call CommitTransaction"); Assert.True(commitResult.status == DocumentStatus.Committed, "Transaction should have been committed"); // Now void the transaction - var voidResult = Client.VoidTransaction(TestCompany.companyCode, transaction.code, new VoidTransactionModel() + var voidResult = Client.VoidTransaction(TestCompany.companyCode, transaction.code, null, new VoidTransactionModel() { code = VoidReasonCode.DocVoided }); diff --git a/tests/netstandard/TransactionTests.cs b/tests/netstandard/TransactionTests.cs index ecf29134..c6d437e1 100644 --- a/tests/netstandard/TransactionTests.cs +++ b/tests/netstandard/TransactionTests.cs @@ -137,14 +137,14 @@ public void TransactionWorkflow() Assert.True(transaction.lines[2].ref1.Contains("Reference!"), "Line3 should have had a Ref1."); // Now commit that transaction - var commitResult = Client.CommitTransaction(TestCompany.companyCode, transaction.code, new CommitTransactionModel() { commit = true }); + var commitResult = Client.CommitTransaction(TestCompany.companyCode, transaction.code, null, new CommitTransactionModel() { commit = true }); // Ensure that this transaction was committed Assert.NotNull(commitResult, "Should have been able to call CommitTransaction"); Assert.True(commitResult.status == DocumentStatus.Committed, "Transaction should have been committed"); // Now void the transaction - var voidResult = Client.VoidTransaction(TestCompany.companyCode, transaction.code, new VoidTransactionModel() + var voidResult = Client.VoidTransaction(TestCompany.companyCode, transaction.code, null, new VoidTransactionModel() { code = VoidReasonCode.DocVoided });