diff --git a/src/Client.php b/src/Client.php index affe7fe..515c40a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -168,13 +168,13 @@ protected function restCall($apiUrl, $verb, $guzzleParams) } $guzzleParams['headers'] = [ 'Accept' => 'application/json', - 'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 19.2.0; {$this->machineName}" + 'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 19.3.0; {$this->machineName}" ]; } else { $guzzleParams['headers'] = [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '.$this->auth[0], - 'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 19.2.0; {$this->machineName}" + 'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 19.3.0; {$this->machineName}" ]; } diff --git a/src/Constants.php b/src/Constants.php index f7eca55..5ddddde 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -26,28 +26,6 @@ class TransactionAddressType } -/** - * - */ -class AdvancedRuleScriptType -{ - const C_REQUESTRULE = 0; - const C_RESPONSERULE = 1; - -} - - -/** - * - */ -class AdvancedRuleCrashBehavior -{ - const C_FAILONERROR = 0; - const C_PROCEEDWITHORIGINAL = 1; - -} - - /** * Casing to use for validation result */ @@ -337,6 +315,66 @@ class PointOfSalePartnerId } +/** + * Defines how a stack rate is determined for a specific country and region. + */ +class StackAggregationOption +{ + + /** + * No aggregation. + * The component rate is used for the stack rate. + */ + const C_NOSTACKAGGREGATION = 0; + + /** + * Rates are aggregated across all jurisdiction types. + */ + const C_FULLSTACKAGGREGATION = 1; + + /** + * State and county rates are aggregated. + */ + const C_AGGREGATESTATEANDCOUNTY = 2; + + /** + * City and county rates are aggregated. + */ + const C_AGGREGATECITYANDCOUNTY = 3; + +} + + +/** + * + */ +class SendSalesOutputFileFormat +{ + const C_STANDARD = 1; + const C_DMA = 2; + +} + + +/** + * + */ +class SendSalesFileType +{ + + /** + * File is in Comma Separated Values format + */ + const C_CSV = 0; + + /** + * File is in Javascript Object Notation format + */ + const C_JSON = 1; + +} + + /** * Represents the type of service or subscription given to a user */ @@ -488,6 +526,26 @@ class ServiceTypeId */ const C_SENDSALESRATEFILE = 28; + /** + * AvaMeals + */ + const C_AVAMEALS = 29; + + /** + * AvaAlcohol + */ + const C_AVAALCOHOL = 30; + + /** + * Accounting Firm ARA Service Type + */ + const C_ARA = 31; + + /** + * Accounting Firm ManagedARA Service Type + */ + const C_MANAGEDARA = 32; + } @@ -523,6 +581,30 @@ class AccountStatusId } +/** + * Status of an Avalara account + */ +class AccountTypeId +{ + + /** + * Regular AvaTax account. + */ + const C_REGULAR = 1; + + /** + * Firm account. + */ + const C_FIRM = 2; + + /** + * Client account created by firm. + */ + const C_FIRMCLIENT = 3; + +} + + /** * Permission level of a user */ @@ -644,6 +726,16 @@ class SecurityRoleId */ const C_SSTADMIN = 22; + /** + * FirmUser + */ + const C_FIRMUSER = 23; + + /** + * FirmAdmin + */ + const C_FIRMADMIN = 24; + } @@ -714,6 +806,8 @@ class ErrorCodeId const C_CANNOTCHANGEPASSWORD = 24; const C_DATEFORMATERROR = 26; const C_NODEFAULTCOMPANY = 27; + const C_ACCOUNTTYPENOTSUPPORTED = 28; + const C_INVALIDFIRMCLIENTOFFER = 29; const C_AUTHENTICATIONEXCEPTION = 30; const C_AUTHORIZATIONEXCEPTION = 31; const C_VALIDATIONEXCEPTION = 32; @@ -733,8 +827,10 @@ class ErrorCodeId const C_OPENCLAUSEEXCEPTION = 46; const C_JSONFORMATERROR = 47; const C_INVALIDDECIMALVALUE = 48; + const C_LINKAGESTATUSUPDATENOTSUPPORTED = 49; const C_UNHANDLEDEXCEPTION = 50; const C_INACTIVEACCOUNT = 51; + const C_LINKAGENOTALLOWED = 52; const C_REPORTINGCOMPANYMUSTHAVECONTACTSERROR = 60; const C_COMPANYPROFILENOTSET = 61; const C_CANNOTASSIGNUSERTOCOMPANY = 62; @@ -893,6 +989,7 @@ class ErrorCodeId const C_AVALARAIDENTITYAPIERROR = 608; const C_INVALIDIPADDRESS = 609; const C_OFFERCODEALREADYAPPLIED = 610; + const C_ACCOUNTALREADYEXISTS = 611; /** * Refund API error codes @@ -1012,11 +1109,9 @@ class ErrorCodeId /** * Advanced rule errors */ - const C_ADVANCEDRULEBADSCRIPT = 1600; - const C_ADVANCEDRULEBADCSVTABLE = 1601; const C_ADVANCEDRULEREQUESTRULEERROR = 1602; const C_ADVANCEDRULERESPONSERULEERROR = 1603; - const C_ADVANCEDRULENOTAPPROVED = 1604; + const C_ADVANCEDRULEERROR = 1605; /** * Miscellaneous @@ -1193,296 +1288,345 @@ class JurisdictionType /** - * A list of possible AvaFile Form Types. + * Choice of rounding level for a transaction */ -class FormTypeId +class RoundingLevelId { /** - * Denotes the form type is Sales and Use Tax + * Round tax on each line separately */ - const C_SALESANDUSE = 0; + const C_LINE = 0; /** - * Denotes the form type is Sales Tax only + * Round tax at the document level */ - const C_SALES = 1; + const C_DOCUMENT = 1; - /** - * Denotes the form type is Sellers Use Tax only - */ - const C_SELLERSUSE = 2; +} + + +/** + * TaxDependencyLevelId + */ +class TaxDependencyLevelId +{ /** - * Denotes the form type is Lodging Tax only + * Document */ - const C_LODGING = 3; + const C_DOCUMENT = 0; /** - * Denotes the form type is Sales and Lodging Tax + * State */ - const C_SALESANDLODGING = 4; + const C_STATE = 1; /** - * Denotes the form type is Consumer Use Tax only + * TaxRegion */ - const C_CONSUMERUSE = 5; + const C_TAXREGION = 2; /** - * Denotes the form type is Resort and Rental Tax + * Address */ - const C_RESORTANDRENTAL = 6; + const C_ADDRESS = 3; + +} + + +/** + * Indicates whether this address refers to a person or an business + */ +class AddressTypeId +{ /** - * Denotes the form type is Tourist and Rental Tax + * A business location, for example a store, warehouse, or office. */ - const C_TOURISTANDRENTAL = 7; + const C_LOCATION = 1; /** - * Denotes the form type is Prepayment + * A person's address who performs sales tasks for the company remotely from an office. */ - const C_PREPAYMENT = 8; + const C_SALESPERSON = 2; /** - * Denotes the form type is Prepayment Allowance + * This location is a marketplace vendor that handles transactions on behalf of the company. + * When you select `Marketplace` as the address type for a location, you must then choose either + * `SellerRemitsTax` or `MarketplaceRemitsTax` to indicate which business entity is responsible + * for collecting and remitting tax for this location. */ - const C_PREPAYMENTALLOWED = 9; + const C_MARKETPLACE = 3; } /** - * A list of possible AvaFile filing option types. + * The type of address represented by this object */ -class FilingOptionTypeId +class AddressCategoryId { /** - * Denotes the tax return is being filed on paper. + * Address refers to a storefront location */ - const C_PAPER = 0; + const C_STOREFRONT = 1; /** - * Denotes the form can be efiled optionally. + * Address refers to a main office of this company */ - const C_OPTIONALEFILE = 1; + const C_MAINOFFICE = 2; /** - * Denotes the form is being filed via efile. + * Address refers to a warehouse or other non-public location */ - const C_MANDATORYEFILE = 2; - -} + const C_WAREHOUSE = 3; + /** + * Address refers to a location for a single salesperson + */ + const C_SALESPERSON = 4; -/** - * A list of possible Due Date Types - */ -class DueDateTypeId -{ + /** + * Address is a type not reflected in the other lists + */ + const C_OTHER = 5; /** - * Denotes form is due on the due day + * The marketplace vendor does not collect and remit tax for transactions tied to this + * location. Use this option if you are using a marketplace vendor to handle your transactions + * and your company is responsible for collecting and remitting all taxes for transactions tied + * to this location. */ - const C_BYDAY = 0; + const C_SELLERREMITSTAX = 6; /** - * Denotes form is due by last day of the month + * The marketplace vendor collects and remits tax on your behalf for all transactions tied + * to this location. Use this option if your marketplace vendor already pays sales and use + * taxes on your behalf. When this option is selected, all transactions tied to this location + * will be treated as already filed, and will be listed on each sales tax return as amounts + * already paid. */ - const C_BYLASTDAY = 1; + const C_MARKETPLACEREMITSTAX = 7; /** - * Denotes form is due by second to last day of the month + * Address refers to the mailing address of your company which is not a physical location. */ - const C_BYSECONDLASTDAY = 2; + const C_NONPHYSICAL = 8; } /** - * Indicates the rounding behavior of a form + * Types of jurisdiction referenced in a transaction */ -class RoundingTypeId +class JurisTypeId { /** - * There is no rounding on the return + * State */ - const C_NONE = 0; + const C_STA = 1; /** - * Round to the nearest whole number + * County */ - const C_NEAREST = 1; + const C_CTY = 2; /** - * Always round up + * City */ - const C_UP = 2; + const C_CIT = 3; /** - * Always round down + * Special */ - const C_DOWN = 3; + const C_STJ = 4; + + /** + * Country + */ + const C_CNT = 5; } /** - * Indicates the behavior of a tax form for a company with multiple places of business. - * - * Some tax authorities require that a separate form must be filed for each place of business. + * Describes the different types of statuses which describe an entity (company). */ -class OutletTypeId +class NexusTypeId { /** - * File a single return per cycle for your entire business. + * Indicates no nexus */ const C_NONE = 0; /** - * You may file separate forms for each outlet; contact the tax authority for more details about location based reporting requirements. + * Indicates the entity is voluntarily collecting tax (default) */ - const C_SCHEDULE = 1; + const C_SALESORSELLERSUSETAX = 1; /** - * You may file separate forms for each outlet; contact the tax authority for more details about location based reporting requirements. + * Indicates the entity is required to collect tax in the state */ - const C_DUPLICATE = 2; + const C_SALESTAX = 2; /** - * File a single return, but you must have a line item for each place of business. + * Indicates the entity is registered as a Volunteer in an SST state. + * Only your SST administrator may set this option. */ - const C_CONSOLIDATED = 3; + const C_SSTVOLUNTEER = 3; -} + /** + * Indicates the entity is registered as a Non-Volunteer in an SST state. + * Only your SST administrator may set this option. + */ + const C_SSTNONVOLUNTEER = 4; + +} /** - * The type of data contained in this batch + * Sourcing */ -class BatchType +class Sourcing { - const C_AVACERTUPDATE = 0; - const C_AVACERTUPDATEALL = 1; - const C_BATCHMAINTENANCE = 2; - const C_COMPANYLOCATIONIMPORT = 3; - const C_DOCUMENTIMPORT = 4; - const C_EXEMPTCERTIMPORT = 5; - const C_ITEMIMPORT = 6; - const C_SALESAUDITEXPORT = 7; - const C_SSTPTESTDECKIMPORT = 8; - const C_TAXRULEIMPORT = 9; /** - * This batch type represents tax transaction data being uploaded to AvaTax. Each line in the batch represents a single transaction - * or a line in a multi-line transaction. For reference, see [Batched Transactions in REST v2](http://developer.avalara.com/blog/2016/10/24/batch-transaction-upload-in-rest-v2) + * Mixed sourcing, for states that do both origin and destination calculation */ - const C_TRANSACTIONIMPORT = 10; - const C_UPCBULKIMPORT = 11; - const C_UPCVALIDATIONIMPORT = 12; + const C_MIXED = 42; + + /** + * Destination + */ + const C_DESTINATION = 68; + + /** + * Origin + */ + const C_ORIGIN = 79; } /** - * The status of a batch file + * Describes nexus type id */ -class BatchStatus +class LocalNexusTypeId { /** - * Batch file has been received and is in the queue to be processed. + * Only the specific nexus objects declared for this company are declared. */ - const C_WAITING = 0; + const C_SELECTED = 0; /** - * Batch file experienced system errors and cannot be processed. + * Customer declares nexus in all state administered taxing authorities. + * + * This value only takes effect if you set `hasLocalNexus` = true. */ - const C_SYSTEMERRORS = 1; + const C_STATEADMINISTERED = 1; /** - * Batch file is cancelled + * Customer declares nexus in all local taxing authorities. + * + * This value only takes effect if you set `hasLocalNexus` = true. */ - const C_CANCELLED = 2; + const C_ALL = 2; + +} + + +/** + * This data type is only used when an object must "Match" tax types. By specifying options here, + * you can indicate which tax types will match for the purposes of this object. + * For example, if you specify BothSalesAndUseTax, this value matches with both sales and seller's use tax. + */ +class MatchingTaxType +{ /** - * Batch file has been completely processed. + * Match medical excise type */ - const C_COMPLETED = 3; + const C_EXCISE = 5; /** - * Batch file is currently being created. + * Match Lodging tax type */ - const C_CREATING = 4; + const C_LODGING = 6; /** - * Batch file has been deleted. + * Match bottle tax type */ - const C_DELETED = 5; + const C_BOTTLE = 7; /** - * Batch file was processed with some errors. + * Match RentToOwn tax type */ - const C_ERRORS = 6; + const C_RENTTOOWN = 8; /** - * Batch processing was paused. + * Match all tax types */ - const C_PAUSED = 7; + const C_ALL = 65; /** - * Batch is currently being processed. + * Match both Sales and Use Tax only */ - const C_PROCESSING = 8; - -} + const C_BOTHSALESANDUSETAX = 66; + /** + * Match Consumer Use Tax only + */ + const C_CONSUMERUSETAX = 67; -/** - * The way of delivering request - */ -class CertificateRequestDeliveryMethod -{ + /** + * Match both Consumer Use and Seller's Use Tax types + */ + const C_CONSUMERSUSEANDSELLERSUSETAX = 68; /** - * The invitation will be sent via email to the recipient's email address. + * Match both Consumer Use and Sales Tax types */ - const C_EMAIL = 1; + const C_CONSUMERUSEANDSALESTAX = 69; /** - * The invitation will be sent via facsimile to the recipient's facsimile phone number. - * - * Facsimile transmission make take time to process and deliver via phone lines. + * Match Fee tax types only */ - const C_FAX = 2; + const C_FEE = 70; /** - * The request will be processed and turned into a web link (URL) which the user can click on to visit the CertExpress site and immediately - * begin entering data about their certificates. + * Match VAT Input Tax only */ - const C_DOWNLOAD = 3; + const C_VATINPUTTAX = 73; -} + /** + * Match VAT Nonrecoverable Input Tax only + */ + const C_VATNONRECOVERABLEINPUTTAX = 78; + /** + * Match VAT Output Tax only + */ + const C_VATOUTPUTTAX = 79; -/** - * Indicates the status of a CertExpress invitation link. - */ -class CertExpressInvitationStatus -{ + /** + * Match Rental tax types only + */ + const C_RENTAL = 82; /** - * The CertExpress website is currently building a landing page for the customer. Please - * wait about 10 seconds and fetch this request again to see when it will be ready. + * Match Sales Tax only */ - const C_INPROGRESS = 0; + const C_SALESTAX = 83; /** - * Indicates that the CertExpress invitation has been completed and is ready to use. + * Match Seller's Use Tax only */ - const C_READY = 1; + const C_USETAX = 85; } @@ -1490,514 +1634,465 @@ class CertExpressInvitationStatus /** * */ -class CertCaptureProvisionStatus +class RateType { - - /** - * Account and company are provisioned - */ - const C_PROVISIONED = 0; - - /** - * Provision job is being queued - * This could also be an indication that some companies under an account has been provisioned, while others - * under the same account has not. - */ - const C_INPROGRESS = 1; - const C_NOTPROVISIONED = 2; + const C_REDUCEDA = 65; + const C_REDUCEDB = 66; + const C_FOOD = 70; + const C_GENERAL = 71; + const C_INCREASEDSTANDARD = 73; + const C_LINENRENTAL = 76; + const C_MEDICAL = 77; + const C_PARKING = 80; + const C_SUPERREDUCED = 81; + const C_REDUCEDR = 82; + const C_STANDARD = 83; + const C_SERVICES = 88; + const C_ZERO = 90; } /** - * Choice of rounding level for a transaction + * Specifies the type of custom tax rule you have created. */ -class RoundingLevelId +class TaxRuleTypeId { /** - * Round tax on each line separately + * Reserved for Avalara internal usage. */ - const C_LINE = 0; + const C_RATERULE = 0; /** - * Round tax at the document level + * Specifies a rule that changes the rate of tax for a specified set of criteria. + * + * This rule can apply to one specific type of product (identified by `TaxCode`) or all products (identified by a null `TaxCode`). */ - const C_DOCUMENT = 1; - -} - - -/** - * TaxDependencyLevelId - */ -class TaxDependencyLevelId -{ + const C_RATEOVERRIDERULE = 1; /** - * Document + * Specifies a rule that changes the tax base of a specific product. + * + * This rule can apply to one specific type of product (identified by `TaxCode`) or all products (identified by a null `TaxCode`). */ - const C_DOCUMENT = 0; + const C_BASERULE = 2; /** - * State + * Indicates that a particular product is exempt from tax due to an exempt usage reason. + * + * Amounts exempted by this rule are stored in the `exemptAmount` field on the transaction. */ - const C_STATE = 1; + const C_EXEMPTENTITYRULE = 3; /** - * TaxRegion + * Specifies a rule that changes whether a product is taxable or not. + * + * This rule must be applied to a specific type of product. If you attempt to create a product taxability rule while + * leaving the `TaxCode` and `TaxCodeId` fields empty, you will get an error. + * + * A `value` field of `1` means that this tax code is taxable; `0` means it is nontaxable. + * + * Amounts that are considered not taxable according to this rule are stored in the `nonTaxableAmount` + * column in a transaction. + * + * This type of rule can also determine the rate type for a product or to apply a cap or threshold. */ - const C_TAXREGION = 2; + const C_PRODUCTTAXABILITYRULE = 4; /** - * Address + * Reserved for Avalara internal usage. */ - const C_ADDRESS = 3; + const C_NEXUSRULE = 5; } /** - * Indicates whether this address refers to a person or an business + * Exempt Cert type */ -class AddressTypeId +class ExemptCertTypeId { /** - * A business location, for example a store, warehouse, or office. - */ - const C_LOCATION = 1; - - /** - * A person's address who performs sales tasks for the company remotely from an office. + * Blanked certificate */ - const C_SALESPERSON = 2; + const C_BLANKET = 0; /** - * This location is a marketplace vendor that handles transactions on behalf of the company. - * When you select `Marketplace` as the address type for a location, you must then choose either - * `SellerRemitsTax` or `MarketplaceRemitsTax` to indicate which business entity is responsible - * for collecting and remitting tax for this location. + * Single use */ - const C_MARKETPLACE = 3; + const C_SINGLEUSE = 1; } /** - * The type of address represented by this object + * Status for this exempt certificate */ -class AddressCategoryId +class ExemptCertStatusId { /** - * Address refers to a storefront location - */ - const C_STOREFRONT = 1; - - /** - * Address refers to a main office of this company - */ - const C_MAINOFFICE = 2; - - /** - * Address refers to a warehouse or other non-public location - */ - const C_WAREHOUSE = 3; - - /** - * Address refers to a location for a single salesperson - */ - const C_SALESPERSON = 4; - - /** - * Address is a type not reflected in the other lists + * Inactive certificate */ - const C_OTHER = 5; + const C_INACTIVE = 0; /** - * The marketplace vendor does not collect and remit tax for transactions tied to this - * location. Use this option if you are using a marketplace vendor to handle your transactions - * and your company is responsible for collecting and remitting all taxes for transactions tied - * to this location. + * Active certificate */ - const C_SELLERREMITSTAX = 6; + const C_ACTIVE = 1; /** - * The marketplace vendor collects and remits tax on your behalf for all transactions tied - * to this location. Use this option if your marketplace vendor already pays sales and use - * taxes on your behalf. When this option is selected, all transactions tied to this location - * will be treated as already filed, and will be listed on each sales tax return as amounts - * already paid. + * Expired certificate */ - const C_MARKETPLACEREMITSTAX = 7; + const C_EXPIRED = 2; /** - * Address refers to the mailing address of your company which is not a physical location. + * Revoked certificate */ - const C_NONPHYSICAL = 8; + const C_REVOKED = 3; } /** - * Types of jurisdiction referenced in a transaction + * Exempt certificate review status */ -class JurisTypeId +class ExemptCertReviewStatusId { /** - * State - */ - const C_STA = 1; - - /** - * County - */ - const C_CTY = 2; - - /** - * City + * Review pending */ - const C_CIT = 3; + const C_PENDING = 0; /** - * Special + * Certificate was accepted */ - const C_STJ = 4; + const C_ACCEPTED = 1; /** - * Country + * Certificate was rejected */ - const C_CNT = 5; + const C_REJECTED = 2; } /** - * Describes the different types of statuses which describe an entity (company). + * A list of possible AvaFile Form Types. */ -class NexusTypeId +class FormTypeId { /** - * Indicates no nexus + * Denotes the form type is Sales and Use Tax */ - const C_NONE = 0; + const C_SALESANDUSE = 0; /** - * Indicates the entity is voluntarily collecting tax (default) + * Denotes the form type is Sales Tax only */ - const C_SALESORSELLERSUSETAX = 1; + const C_SALES = 1; /** - * Indicates the entity is required to collect tax in the state + * Denotes the form type is Sellers Use Tax only */ - const C_SALESTAX = 2; + const C_SELLERSUSE = 2; /** - * Indicates the entity is registered as a Volunteer in an SST state. - * Only your SST administrator may set this option. + * Denotes the form type is Lodging Tax only */ - const C_SSTVOLUNTEER = 3; + const C_LODGING = 3; /** - * Indicates the entity is registered as a Non-Volunteer in an SST state. - * Only your SST administrator may set this option. + * Denotes the form type is Sales and Lodging Tax */ - const C_SSTNONVOLUNTEER = 4; - -} + const C_SALESANDLODGING = 4; + /** + * Denotes the form type is Consumer Use Tax only + */ + const C_CONSUMERUSE = 5; -/** - * Sourcing - */ -class Sourcing -{ + /** + * Denotes the form type is Resort and Rental Tax + */ + const C_RESORTANDRENTAL = 6; /** - * Mixed sourcing, for states that do both origin and destination calculation + * Denotes the form type is Tourist and Rental Tax */ - const C_MIXED = 42; + const C_TOURISTANDRENTAL = 7; /** - * Destination + * Denotes the form type is Prepayment */ - const C_DESTINATION = 68; + const C_PREPAYMENT = 8; /** - * Origin + * Denotes the form type is Prepayment Allowance */ - const C_ORIGIN = 79; + const C_PREPAYMENTALLOWED = 9; } /** - * Describes nexus type id + * A list of possible AvaFile filing option types. */ -class LocalNexusTypeId +class FilingOptionTypeId { /** - * Only the specific nexus objects declared for this company are declared. + * Denotes the tax return is being filed on paper. */ - const C_SELECTED = 0; + const C_PAPER = 0; /** - * Customer declares nexus in all state administered taxing authorities. - * - * This value only takes effect if you set `hasLocalNexus` = true. + * Denotes the form can be efiled optionally. */ - const C_STATEADMINISTERED = 1; + const C_OPTIONALEFILE = 1; /** - * Customer declares nexus in all local taxing authorities. - * - * This value only takes effect if you set `hasLocalNexus` = true. + * Denotes the form is being filed via efile. */ - const C_ALL = 2; + const C_MANDATORYEFILE = 2; } /** - * This data type is only used when an object must "Match" tax types. By specifying options here, - * you can indicate which tax types will match for the purposes of this object. - * For example, if you specify BothSalesAndUseTax, this value matches with both sales and seller's use tax. + * A list of possible Due Date Types */ -class MatchingTaxType -{ - - /** - * Match medical excise type - */ - const C_EXCISE = 5; - - /** - * Match Lodging tax type - */ - const C_LODGING = 6; - - /** - * Match bottle tax type - */ - const C_BOTTLE = 7; +class DueDateTypeId +{ /** - * Match RentToOwn tax type + * Denotes form is due on the due day */ - const C_RENTTOOWN = 8; + const C_BYDAY = 0; /** - * Match all tax types + * Denotes form is due by last day of the month */ - const C_ALL = 65; + const C_BYLASTDAY = 1; /** - * Match both Sales and Use Tax only + * Denotes form is due by second to last day of the month */ - const C_BOTHSALESANDUSETAX = 66; + const C_BYSECONDLASTDAY = 2; - /** - * Match Consumer Use Tax only - */ - const C_CONSUMERUSETAX = 67; +} - /** - * Match both Consumer Use and Seller's Use Tax types - */ - const C_CONSUMERSUSEANDSELLERSUSETAX = 68; + +/** + * Indicates the rounding behavior of a form + */ +class RoundingTypeId +{ /** - * Match both Consumer Use and Sales Tax types + * There is no rounding on the return */ - const C_CONSUMERUSEANDSALESTAX = 69; + const C_NONE = 0; /** - * Match Fee tax types only + * Round to the nearest whole number */ - const C_FEE = 70; + const C_NEAREST = 1; /** - * Match VAT Input Tax only + * Always round up */ - const C_VATINPUTTAX = 73; + const C_UP = 2; /** - * Match VAT Nonrecoverable Input Tax only + * Always round down */ - const C_VATNONRECOVERABLEINPUTTAX = 78; + const C_DOWN = 3; + +} + + +/** + * Indicates the behavior of a tax form for a company with multiple places of business. + * + * Some tax authorities require that a separate form must be filed for each place of business. + */ +class OutletTypeId +{ /** - * Match VAT Output Tax only + * File a single return per cycle for your entire business. */ - const C_VATOUTPUTTAX = 79; + const C_NONE = 0; /** - * Match Rental tax types only + * You may file separate forms for each outlet; contact the tax authority for more details about location based reporting requirements. */ - const C_RENTAL = 82; + const C_SCHEDULE = 1; /** - * Match Sales Tax only + * You may file separate forms for each outlet; contact the tax authority for more details about location based reporting requirements. */ - const C_SALESTAX = 83; + const C_DUPLICATE = 2; /** - * Match Seller's Use Tax only + * File a single return, but you must have a line item for each place of business. */ - const C_USETAX = 85; + const C_CONSOLIDATED = 3; } /** - * + * The type of data contained in this batch */ -class RateType +class BatchType { - const C_REDUCEDA = 65; - const C_REDUCEDB = 66; - const C_FOOD = 70; - const C_GENERAL = 71; - const C_INCREASEDSTANDARD = 73; - const C_LINENRENTAL = 76; - const C_MEDICAL = 77; - const C_PARKING = 80; - const C_SUPERREDUCED = 81; - const C_REDUCEDR = 82; - const C_STANDARD = 83; - const C_SERVICES = 88; - const C_ZERO = 90; + const C_AVACERTUPDATE = 0; + const C_AVACERTUPDATEALL = 1; + const C_BATCHMAINTENANCE = 2; + const C_COMPANYLOCATIONIMPORT = 3; + const C_DOCUMENTIMPORT = 4; + const C_EXEMPTCERTIMPORT = 5; + const C_ITEMIMPORT = 6; + const C_SALESAUDITEXPORT = 7; + const C_SSTPTESTDECKIMPORT = 8; + const C_TAXRULEIMPORT = 9; + + /** + * This batch type represents tax transaction data being uploaded to AvaTax. Each line in the batch represents a single transaction + * or a line in a multi-line transaction. For reference, see [Batched Transactions in REST v2](http://developer.avalara.com/blog/2016/10/24/batch-transaction-upload-in-rest-v2) + */ + const C_TRANSACTIONIMPORT = 10; + const C_UPCBULKIMPORT = 11; + const C_UPCVALIDATIONIMPORT = 12; } /** - * Specifies the type of custom tax rule you have created. + * The status of a batch file */ -class TaxRuleTypeId +class BatchStatus { /** - * Reserved for Avalara internal usage. + * Batch file has been received and is in the queue to be processed. */ - const C_RATERULE = 0; + const C_WAITING = 0; /** - * Specifies a rule that changes the rate of tax for a specified set of criteria. - * - * This rule can apply to one specific type of product (identified by `TaxCode`) or all products (identified by a null `TaxCode`). + * Batch file experienced system errors and cannot be processed. */ - const C_RATEOVERRIDERULE = 1; + const C_SYSTEMERRORS = 1; /** - * Specifies a rule that changes the tax base of a specific product. - * - * This rule can apply to one specific type of product (identified by `TaxCode`) or all products (identified by a null `TaxCode`). + * Batch file is cancelled */ - const C_BASERULE = 2; + const C_CANCELLED = 2; /** - * Indicates that a particular product is exempt from tax due to an exempt usage reason. - * - * Amounts exempted by this rule are stored in the `exemptAmount` field on the transaction. + * Batch file has been completely processed. */ - const C_EXEMPTENTITYRULE = 3; + const C_COMPLETED = 3; /** - * Specifies a rule that changes whether a product is taxable or not. - * - * This rule must be applied to a specific type of product. If you attempt to create a product taxability rule while - * leaving the `TaxCode` and `TaxCodeId` fields empty, you will get an error. - * - * A `value` field of `1` means that this tax code is taxable; `0` means it is nontaxable. - * - * Amounts that are considered not taxable according to this rule are stored in the `nonTaxableAmount` - * column in a transaction. - * - * This type of rule can also determine the rate type for a product or to apply a cap or threshold. + * Batch file is currently being created. */ - const C_PRODUCTTAXABILITYRULE = 4; + const C_CREATING = 4; /** - * Reserved for Avalara internal usage. + * Batch file has been deleted. */ - const C_NEXUSRULE = 5; - -} - + const C_DELETED = 5; -/** - * Exempt Cert type - */ -class ExemptCertTypeId -{ + /** + * Batch file was processed with some errors. + */ + const C_ERRORS = 6; /** - * Blanked certificate + * Batch processing was paused. */ - const C_BLANKET = 0; + const C_PAUSED = 7; /** - * Single use + * Batch is currently being processed. */ - const C_SINGLEUSE = 1; + const C_PROCESSING = 8; } /** - * Status for this exempt certificate + * The way of delivering request */ -class ExemptCertStatusId +class CertificateRequestDeliveryMethod { /** - * Inactive certificate - */ - const C_INACTIVE = 0; - - /** - * Active certificate + * The invitation will be sent via email to the recipient's email address. */ - const C_ACTIVE = 1; + const C_EMAIL = 1; /** - * Expired certificate + * The invitation will be sent via facsimile to the recipient's facsimile phone number. + * + * Facsimile transmission make take time to process and deliver via phone lines. */ - const C_EXPIRED = 2; + const C_FAX = 2; /** - * Revoked certificate + * The request will be processed and turned into a web link (URL) which the user can click on to visit the CertExpress site and immediately + * begin entering data about their certificates. */ - const C_REVOKED = 3; + const C_DOWNLOAD = 3; } /** - * Exempt certificate review status + * Indicates the status of a CertExpress invitation link. */ -class ExemptCertReviewStatusId +class CertExpressInvitationStatus { /** - * Review pending + * The CertExpress website is currently building a landing page for the customer. Please + * wait about 10 seconds and fetch this request again to see when it will be ready. */ - const C_PENDING = 0; + const C_INPROGRESS = 0; /** - * Certificate was accepted + * Indicates that the CertExpress invitation has been completed and is ready to use. */ - const C_ACCEPTED = 1; + const C_READY = 1; + +} + + +/** + * + */ +class CertCaptureProvisionStatus +{ /** - * Certificate was rejected + * Account and company are provisioned */ - const C_REJECTED = 2; + const C_PROVISIONED = 0; + + /** + * Provision job is being queued + * This could also be an indication that some companies under an account has been provisioned, while others + * under the same account has not. + */ + const C_INPROGRESS = 1; + const C_NOTPROVISIONED = 2; } @@ -2574,6 +2669,35 @@ class PaymentType } +/** + * Account Linkage status + */ +class FirmClientLinkageStatus +{ + + /** + * Requested + */ + const C_REQUESTED = 1; + + /** + * Approved + */ + const C_APPROVED = 2; + + /** + * Rejected + */ + const C_REJECTED = 3; + + /** + * Revoked + */ + const C_REVOKED = 4; + +} + + /** * What object experienced the error? */ @@ -2780,6 +2904,16 @@ class NoticeCustomerType */ const C_TRUSTFILE = 5; + /** + * PWC + */ + const C_PWC = 6; + + /** + * Hudson Group + */ + const C_HUDSONGROUP = 7; + } @@ -3032,6 +3166,11 @@ class CompanyAccessLevel */ const C_ALLCOMPANIES = 3; + /** + * Permission to access all companies in all accounts managed by a firm account. + */ + const C_FIRMMANAGEDACCOUNTS = 4; + } diff --git a/src/Methods.php b/src/Methods.php index 9c66c05..f283f44 100644 --- a/src/Methods.php +++ b/src/Methods.php @@ -24,15 +24,15 @@ class AvaTaxClient extends AvaTaxClientBase * Reset this account's license key * * Resets the existing license key for this account to a new key. - * + * * To reset your account, you must specify the ID of the account you wish to reset and confirm the action. - * + * * This API is only available to account administrators for the account in question, and may only be called after * an account has been activated by reading and accepting Avalara's terms and conditions. To activate your account * please log onto the AvaTax website or call the `ActivateAccount` API. - * + * * Resetting a license key cannot be undone. Any previous license keys will immediately cease to work when a new key is created. - * + * * When you call this API, all account administrators for this account will receive an email with the newly updated license key. * The email will specify which user reset the license key and it will contain the new key to use to update your connectors. * @@ -55,13 +55,13 @@ public function accountResetLicenseKey($id, $model) * Activate an account by accepting terms and conditions * * Activate the account specified by the unique accountId number. - * - * This activation request can only be called by account administrators. You must indicate + * + * This activation request can only be called by account administrators. You must indicate * that you have read and accepted Avalara's terms and conditions to call this API. - * + * * Once you have activated your account, use the `AccountResetLicenseKey` API to generate * a license key for your account. - * + * * If you have not read or accepted the terms and conditions, this API call will return the * unchanged account model. * @@ -84,15 +84,15 @@ public function activateAccount($id, $model) * Retrieve audit history for an account. * * Retrieve audit trace history for an account. - * + * * Your audit trace history contains a record of all API calls made against the AvaTax REST API. You can use this API to investigate * problems and see exactly what information was sent back and forth between your code and AvaTax. - * + * * When specifying a start and end datetime, please include a valid timezone indicator, such as the "Z" present in the examples for the start and end query parameters. * You can learn more about valid time zone designators at https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators. - * + * * This API enforces limits to the amount of data retrieved. These limits are subject to change. - * + * * * You may request data from a maximum of a one-hour time period. * * The amount of data and number of API calls returned by this API are limited and may be adjusted at any time. * * Old records may be migrated out of immediately available storage. To request older data, please contact your account manager. @@ -121,7 +121,7 @@ public function auditAccount($id, $start, $end, $top=null, $skip=null) * * Get the account object identified by this URL. * You may use the '$include' parameter to fetch additional nested data: - * + * * * Subscriptions * * Users * @@ -144,15 +144,15 @@ public function getAccount($id, $include=null) * Get configuration settings for this account * * Retrieve a list of all configuration settings tied to this account. - * + * * Configuration settings provide you with the ability to control features of your account and of your * tax software. The category names `TaxServiceConfig` and `AddressServiceConfig` are reserved for * Avalara internal software configuration values; to store your own account-level settings, please * create a new category name that begins with `X-`, for example, `X-MyCustomCategory`. - * + * * Account settings are permanent settings that cannot be deleted. You can set the value of an * account setting to null if desired. - * + * * Avalara-based account settings for `TaxServiceConfig` and `AddressServiceConfig` affect your account's * tax calculation and address resolution, and should only be changed with care. * @@ -174,9 +174,9 @@ public function getAccountConfiguration($id) * Retrieve all accounts * * List all account objects that can be seen by the current user. - * + * * This API lists all accounts you are allowed to see. In general, most users will only be able to see their own account. - * + * * 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: @@ -208,15 +208,15 @@ public function queryAccounts($include=null, $filter=null, $top=null, $skip=null * Change configuration settings for this account * * Update configuration settings tied to this account. - * + * * Configuration settings provide you with the ability to control features of your account and of your * tax software. The category names `TaxServiceConfig` and `AddressServiceConfig` are reserved for * Avalara internal software configuration values; to store your own account-level settings, please * create a new category name that begins with `X-`, for example, `X-MyCustomCategory`. - * + * * Account settings are permanent settings that cannot be deleted. You can set the value of an * account setting to null if desired. - * + * * Avalara-based account settings for `TaxServiceConfig` and `AddressServiceConfig` affect your account's * tax calculation and address resolution, and should only be changed with care. * @@ -290,250 +290,6 @@ public function resolveAddressPost($model) return $this->restCall($path, 'POST', $guzzleParams); } - /** - * Approve an advanced rule script to run. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @return AdvancedRuleScriptModel - */ - public function approveAdvancedRuleScript($accountId, $scriptType) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/approve"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'POST', $guzzleParams); - } - - /** - * Create an advanced rule. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that will own the Advanced Rule. - * @param string $scriptType The script transform type, Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @param string $crashBehavior The behavior the script should take if it crashes: Fail or Proceed. (See AdvancedRuleCrashBehavior::* for a list of allowable values) - * @param object $file The JavaScript file containing the advanced rule. - * @return string - */ - public function createAdvancedRuleScript($accountId, $scriptType, $crashBehavior, $file) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}"; - $guzzleParams = [ - 'query' => ['crashBehavior' => $crashBehavior], - 'body' => null - ]; - return $this->restCall($path, 'POST', $guzzleParams); - } - - /** - * Create a lookup table for an advanced rule - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $csvTableName The name to assign the CSV lookup table. - * @param object $file A CSV file containing lookup data for an advanced rule. - * @return string - */ - public function createAdvancedRuleTable($accountId, $csvTableName, $file) - { - $path = "/api/v2/accounts/{$accountId}/advancedruletables/{$csvTableName}"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'POST', $guzzleParams); - } - - /** - * Delete an account's active advanced rule - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @return ErrorDetail[] - */ - public function deleteAdvancedRuleScript($accountId, $scriptType) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'DELETE', $guzzleParams); - } - - /** - * Delete a lookup table for an advanced rule. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $csvTableName The name of the CSV lookup table to delete. - * @return ErrorDetail[] - */ - public function deleteAdvancedRuleTable($accountId, $csvTableName) - { - $path = "/api/v2/accounts/{$accountId}/advancedruletables/{$csvTableName}"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'DELETE', $guzzleParams); - } - - /** - * Disable an advanced rule so that it cannot be run. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. /// - * - * - * @param int $accountId - * @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @return AdvancedRuleScriptModel - */ - public function disableAdvancedRuleScript($accountId, $scriptType) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/disable"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'POST', $guzzleParams); - } - - /** - * Enable an approved advanced rule so that it can be run. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId - * @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @return AdvancedRuleScriptModel - */ - public function enableAdvancedRuleScript($accountId, $scriptType) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/enable"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'POST', $guzzleParams); - } - - /** - * Get an account's advanced rule script. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @return AdvancedRuleScriptModel - */ - public function getAdvancedRuleScript($accountId, $scriptType) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'GET', $guzzleParams); - } - - /** - * Get an advanced rule lookup table for an account - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $csvTableName The name of the CSV lookup table to get. - * @return AdvancedRuleTableModel - */ - public function getAdvancedRuleTable($accountId, $csvTableName) - { - $path = "/api/v2/accounts/{$accountId}/advancedruletables/{$csvTableName}"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'GET', $guzzleParams); - } - - /** - * Get all advanced rule lookup tables for an account - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @return AdvancedRuleTableModel - */ - public function getAdvancedRuleTables($accountId) - { - $path = "/api/v2/accounts/{$accountId}/advancedruletables"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'GET', $guzzleParams); - } - - /** - * Unapprove an advanced rule script so that it cannot be run. - * - * This API is available by invite only and implementation support is required. - * Please contact your Customer Account Manager if you are interested in using - * Advanced Rules in your AvaTax integration. - * - * - * @param int $accountId The ID of the account that owns the Advanced Rule. - * @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values) - * @return AdvancedRuleScriptModel - */ - public function unapproveAdvancedRuleScript($accountId, $scriptType) - { - $path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/unapprove"; - $guzzleParams = [ - 'query' => [], - 'body' => null - ]; - return $this->restCall($path, 'POST', $guzzleParams); - } - /** * Create a new AvaFileForm * @@ -1457,17 +1213,17 @@ public function uploadCertificateImage($companyId, $id, $file) * Change the filing status of this company * * Changes the current filing status of this company. - * + * * For customers using Avalara's Managed Returns Service, each company within their account can request * for Avalara to file tax returns on their behalf. Avalara compliance team members will review all * requested filing calendars prior to beginning filing tax returns on behalf of this company. - * + * * The following changes may be requested through this API: - * + * * * If a company is in `NotYetFiling` status, the customer may request this be changed to `FilingRequested`. * * Avalara compliance team members may change a company from `FilingRequested` to `FirstFiling`. * * Avalara compliance team members may change a company from `FirstFiling` to `Active`. - * + * * All other status changes must be requested through the Avalara customer support team. * * @@ -1497,7 +1253,7 @@ public function changeFilingStatus($id, $model) * * Declare nexus in all taxing jurisdictions for that main office address * * Activate the company * - * This API only provides a limited subset of functionality compared to the 'Create Company' API call. + * This API only provides a limited subset of functionality compared to the 'Create Company' API call. * If you need additional features or options not present in this 'Quick Setup' API call, please use the full 'Create Company' call instead. * Please allow 1 minute before making transactions using the company. * @@ -1540,8 +1296,8 @@ public function createCompanies($model) * Request managed returns funding setup for a company * * This API is available by invitation only. - * Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are - * required to setup their funding configuration before Avalara can begin filing tax returns on their + * Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are + * required to setup their funding configuration before Avalara can begin filing tax returns on their * behalf. * Funding configuration for each company is set up by submitting a funding setup request, which can * be sent either via email or via an embedded HTML widget. @@ -1635,7 +1391,7 @@ public function fundingConfigurationsByCompanyAndCurrency($companyId, $currency) * Get the company object identified by this URL. * A 'company' represents a single corporation or individual that is registered to handle transactional taxes. * 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: - * + * * * Contacts * * Items * * Locations @@ -1647,7 +1403,7 @@ public function fundingConfigurationsByCompanyAndCurrency($companyId, $currency) * * * @param int $id The ID of the company to retrieve. - * @param string $include OPTIONAL: A comma separated list of special fetch options. * Child objects - Specify one or more of the following to retrieve objects related to each company: "Contacts", "FilingCalendars", "Items", "Locations", "Nexus", "TaxCodes", or "TaxRules". * Deleted objects - Specify "FetchDeleted" to retrieve information about previously deleted objects. + * @param string $include OPTIONAL: A comma separated list of special fetch options. * Child objects - Specify one or more of the following to retrieve objects related to each company: "Contacts", "FilingCalendars", "Items", "Locations", "Nexus", "TaxCodes", or "TaxRules". * Deleted objects - Specify "FetchDeleted" to retrieve information about previously deleted objects. * @return CompanyModel */ public function getCompany($id, $include=null) @@ -1664,15 +1420,15 @@ public function getCompany($id, $include=null) * Get configuration settings for this company * * Retrieve a list of all configuration settings tied to this company. - * + * * Configuration settings provide you with the ability to control features of your account and of your * tax software. The category name `AvaCertServiceConfig` is reserved for * Avalara internal software configuration values; to store your own company-level settings, please * create a new category name that begins with `X-`, for example, `X-MyCustomCategory`. - * + * * Company settings are permanent settings that cannot be deleted. You can set the value of a * company setting to null if desired and if the particular setting supports it. - * + * * Avalara-based company settings for `AvaCertServiceConfig` affect your company's exemption certificate * processing, and should be changed with care. * @@ -1694,13 +1450,13 @@ public function getCompanyConfiguration($id) * Get this company's filing status * * Retrieve the current filing status of this company. - * + * * For customers using Avalara's Managed Returns Service, each company within their account can request * for Avalara to file tax returns on their behalf. Avalara compliance team members will review all * requested filing calendars prior to beginning filing tax returns on behalf of this company. - * + * * A company's filing status can be one of the following values: - * + * * * `NoReporting` - This company is not configured to report tax returns; instead, it reports through a parent company. * * `NotYetFiling` - This company has not yet begun filing tax returns through Avalara's Managed Returns Service. * * `FilingRequested` - The company has requested to begin filing tax returns, but Avalara's compliance team has not yet begun filing. @@ -1747,7 +1503,7 @@ public function listFundingRequestsByCompany($id) * Retrieve a list of MRS Companies with account * * This API is available by invitation only. - * + * * Get a list of companies with an active MRS service. * * @@ -1767,9 +1523,9 @@ public function listMrsCompanies() * Retrieve all companies * * Get multiple company objects. - * + * * A `company` represents a single corporation or individual that is registered to handle transactional 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. * 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: @@ -1805,15 +1561,15 @@ public function queryCompanies($include=null, $filter=null, $top=null, $skip=nul * Change configuration settings for this company * * Update configuration settings tied to this company. - * + * * Configuration settings provide you with the ability to control features of your account and of your * tax software. The category names `AvaCertServiceConfig` is reserved for * Avalara internal software configuration values; to store your own company-level settings, please * create a new category name that begins with `X-`, for example, `X-MyCustomCategory`. - * + * * Company settings are permanent settings that cannot be deleted. You can set the value of a * company setting to null if desired and if the particular setting supports it. - * + * * Avalara-based company settings for `AvaCertServiceConfig` affect your company's exemption certificate * processing, and should be changed with care. * @@ -1838,7 +1594,7 @@ public function setCompanyConfiguration($id, $model) * Replace the existing company object at this URL with an updated object. * * A `CompanyModel` represents a single corporation or individual that is registered to handle transactional taxes. - * All data from the existing object will be replaced with data in the object you PUT. + * All data from the existing object will be replaced with data in the object you PUT. * * When calling `UpdateCompany`, you are permitted to update the company itself. Updates to the nested objects * such as contacts, locations, or settings are not permitted. To update the nested objects @@ -1860,6 +1616,188 @@ public function updateCompany($id, $model) return $this->restCall($path, 'PUT', $guzzleParams); } + /** + * Retrieve a single tax rate. + * + * This API is available by invitation only. + * + * + * @param int $id The ID of the tax rate to retrieve. + * @return ComplianceTaxRateModel + */ + public function getTaxRate($id) + { + $path = "/api/v2/compliance/taxrates/{$id}"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve a single tax region. + * + * This API is available by invitation only. + * + * + * @param int $id The ID of the tax region to retrieve. + * @return TaxRegionModel + */ + public function getTaxRegion($id) + { + $path = "/api/v2/compliance/taxregions/{$id}"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve jurisdictions and rates in a combined format. + * + * This API is available by invitation only. + * + * + * @param string $effectiveDate Used to limit the jurisdictions returned. + * @param string $endDate Used to limit the jurisdictions returned. + * @param string $filter 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/). + * @param string $include A comma separated list of objects to fetch underneath this jurisdiction. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + * @return ComplianceJurisdictionRateModel + */ + public function queryJurisdictionRates($effectiveDate, $endDate, $filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + { + $path = "/api/v2/compliance/jurisdictionrates"; + $guzzleParams = [ + 'query' => ['effectiveDate' => $effectiveDate, 'endDate' => $endDate, '$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve all unique jurisdictions. + * + * This API is available by invitation only. + * + * 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: + * + * * TaxRates + * + * + * @param string $country The two-character ISO-3166 code for the country. + * @param string $region The two or three character region code for the region. + * @param string $effectiveDate Used to limit the jurisdictions or rates returned. + * @param string $endDate Used to limit the jurisdictions or rates returned. + * @param string $aggregationOption Aggregation method used if rates are returned using the '$include' parameter. (See StackAggregationOption::* for a list of allowable values) + * @param string $include A comma separated list of objects to fetch underneath this tax rate. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @return ComplianceJurisdictionModel + */ + public function queryJurisdictions($country, $region, $effectiveDate, $endDate, $aggregationOption, $include=null, $top=null, $skip=null) + { + $path = "/api/v2/compliance/jurisdictions/{$country}/{$region}"; + $guzzleParams = [ + 'query' => ['effectiveDate' => $effectiveDate, 'endDate' => $endDate, 'aggregationOption' => $aggregationOption, '$include' => $include, '$top' => $top, '$skip' => $skip], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve all tax rates. + * + * This API is available by invitation only. + * + * + * @param string $filter 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/). + * @param string $include A comma separated list of objects to fetch underneath this tax rate. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + * @return ComplianceTaxRateModel + */ + public function queryTaxRates($filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + { + $path = "/api/v2/compliance/taxrates"; + $guzzleParams = [ + 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve all tax region jurisdictions. + * + * This API is available by invitation only. + * + * + * @param string $filter 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/). + * @param string $include A comma separated list of objects to fetch underneath this tax region jurisdiction. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + * @return TaxRegionJurisdictionModel + */ + public function queryTaxRegionJurisdictions($filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + { + $path = "/api/v2/compliance/taxregionjurisdictions"; + $guzzleParams = [ + 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve all tax regions. + * + * This API is available by invitation only. + * + * + * @param string $filter 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/). + * @param string $include A comma separated list of objects to fetch underneath this tax region. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + * @return TaxRegionModel + */ + public function queryTaxRegions($filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + { + $path = "/api/v2/compliance/taxregions"; + $guzzleParams = [ + 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * API to modify the reference fields at the document and the line level. + * + * + * + * + * @param int $companyId + * @param TransactionReferenceFieldModel[] $model + * @return FetchResult + */ + public function tagTransaction($companyId, $model) + { + $path = "/api/v2/companies/{$companyId}/transactions/tag"; + $guzzleParams = [ + 'query' => [], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'PUT', $guzzleParams); + } + /** * Create a new contact * @@ -3963,41 +3901,173 @@ public function deleteDistanceThreshold($companyId, $id) * to correctly calculate some value-added taxes. * * - * @param int $companyId The ID of the company that owns this DistanceThreshold object - * @param int $id The unique ID number referring to this DistanceThreshold object - * @return CompanyDistanceThresholdModel + * @param int $companyId The ID of the company that owns this DistanceThreshold object + * @param int $id The unique ID number referring to this DistanceThreshold object + * @return CompanyDistanceThresholdModel + */ + public function getDistanceThreshold($companyId, $id) + { + $path = "/api/v2/companies/{$companyId}/distancethresholds/{$id}"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * 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. + * + * + * @param int $companyId The ID of the company whose DistanceThreshold objects you wish to list. + * @param string $filter 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/). + * @param string $include A comma separated list of additional data to retrieve. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + * @return FetchResult + */ + public function listDistanceThresholds($companyId, $filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + { + $path = "/api/v2/companies/{$companyId}/distancethresholds"; + $guzzleParams = [ + 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Retrieve all DistanceThreshold objects + * + * Lists all DistanceThreshold objects that belong to this account. + * + * 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. + * + * + * @param string $filter 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/). + * @param string $include A comma separated list of additional data to retrieve. + * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + * @return FetchResult + */ + public function queryDistanceThresholds($filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + { + $path = "/api/v2/distancethresholds"; + $guzzleParams = [ + 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * 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. + * + * + * @param int $companyId The unique ID number of the company that owns this DistanceThreshold object. + * @param int $id The unique ID number of the DistanceThreshold object to replace. + * @param CompanyDistanceThresholdModel $model The new DistanceThreshold object to store. + * @return CompanyDistanceThresholdModel + */ + public function updateDistanceThreshold($companyId, $id, $model) + { + $path = "/api/v2/companies/{$companyId}/distancethresholds/{$id}"; + $guzzleParams = [ + 'query' => [], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'PUT', $guzzleParams); + } + + /** + * Bridge API for integration of validated certificates + * + * This API is for use by invitation only. + * + * + * @param EcmsModel[] $model Either a single exempt certificate or an array of certificates to create + * @return EcmsModel[] + */ + public function certCaptureBridge($model) + { + $path = "/api/v2/certcapturebridge"; + $guzzleParams = [ + 'query' => [], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'POST', $guzzleParams); + } + + /** + * Get an ECMS identified by company id and ECMS id + * + * Get an ECMS identified by company id and ECMS id. + * An ECMS data represents a documentation based on which companies can claim tax exemption + * You may attach nested data objects such as exempt cert detail, and those objects will be created with certificate. + * 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: + * + * * Details + * + * + * @param int $companyId company to retrieve exempt certificate for + * @param int $ecmsId exempt certificate Id + * @param string $include + * @return EcmsModel */ - public function getDistanceThreshold($companyId, $id) + public function getECMSById($companyId, $ecmsId, $include=null) { - $path = "/api/v2/companies/{$companyId}/distancethresholds/{$id}"; + $path = "/api/v2/companies/{$companyId}/ecms/{$ecmsId}"; $guzzleParams = [ - 'query' => [], + 'query' => ['$include' => $include], 'body' => null ]; return $this->restCall($path, 'GET', $guzzleParams); } /** - * Retrieve all DistanceThresholds for this company. + * Get list of ECMS data 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. + * Get list of ECMS data for this company + * An ECMS data represents a documentation based on which companies can claim tax exemption + * You may attach nested data objects such as ECMS detail, and those objects will be created with certificate. + * 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: + * + * * Details * * - * @param int $companyId The ID of the company whose DistanceThreshold objects you wish to list. + * @param int $companyId which company to retrieve certificates from * @param string $filter 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/). - * @param string $include A comma separated list of additional data to retrieve. + * @param string $include * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - * @return FetchResult + * @return EcmsModel[] */ - public function listDistanceThresholds($companyId, $filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + public function listECMSByCompany($companyId, $filter=null, $include=null, $top=null, $skip=null, $orderBy=null) { - $path = "/api/v2/companies/{$companyId}/distancethresholds"; + $path = "/api/v2/companies/{$companyId}/ecms"; $guzzleParams = [ 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], 'body' => null @@ -4006,28 +4076,28 @@ public function listDistanceThresholds($companyId, $filter=null, $include=null, } /** - * Retrieve all DistanceThreshold objects + * Get all exempt certificates * - * Lists all DistanceThreshold objects that belong to this account. - * - * 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. - * + * Get all ECMS currently available in database. + * An ECMS data represents a documentation based on which companies can claim tax exemption + * You may attach nested data objects such as ECMS detail, and those objects will be created with certificate. * 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: + * + * * Details * * * @param string $filter 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/). - * @param string $include A comma separated list of additional data to retrieve. + * @param string $include * @param int $top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. * @param int $skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. * @param string $orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - * @return FetchResult + * @return EcmsModel[] */ - public function queryDistanceThresholds($filter=null, $include=null, $top=null, $skip=null, $orderBy=null) + public function queryECMS($filter=null, $include=null, $top=null, $skip=null, $orderBy=null) { - $path = "/api/v2/distancethresholds"; + $path = "/api/v2/ecms"; $guzzleParams = [ 'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], 'body' => null @@ -4035,34 +4105,6 @@ public function queryDistanceThresholds($filter=null, $include=null, $top=null, return $this->restCall($path, 'GET', $guzzleParams); } - /** - * 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. - * - * - * @param int $companyId The unique ID number of the company that owns this DistanceThreshold object. - * @param int $id The unique ID number of the DistanceThreshold object to replace. - * @param CompanyDistanceThresholdModel $model The new DistanceThreshold object to store. - * @return CompanyDistanceThresholdModel - */ - public function updateDistanceThreshold($companyId, $id, $model) - { - $path = "/api/v2/companies/{$companyId}/distancethresholds/{$id}"; - $guzzleParams = [ - 'query' => [], - 'body' => json_encode($model) - ]; - return $this->restCall($path, 'PUT', $guzzleParams); - } - /** * Approve existing Filing Request * @@ -4399,6 +4441,8 @@ public function loginVerificationStatus($jobId) * Retrieve all filing calendars * * This API is available by invitation only. + * + * This API is deprecated - please use POST `/api/v2/filingrequests/query` API. * * * @param string $filter 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/).
*Not filterable:* formCountry, formRegion, taxFormCode, taxAuthorityId, taxAuthorityName, taxAuthorityType, settings @@ -4419,10 +4463,37 @@ public function queryFilingCalendars($filter=null, $top=null, $skip=null, $order return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Retrieve all filing calendars + * + * This API is available by invitation only. + * + * This API is intended to replace the GET `/api/v2/filingcalendars` API. The fetch request object is posted on the body of the request instead of the URI, so it's not limited by a set number of characters. + * The documentation of the GET API shows how filtering, sorting and pagination works. + * + * + * @param string $returnCountry If specified, fetches only filing calendars that apply to tax filings in this specific country. Uses ISO 3166 country codes. + * @param string $returnRegion If specified, fetches only filing calendars that apply to tax filings in this specific region. Uses ISO 3166 region codes. + * @param QueryRequestModel $model Query object to filter, sort and paginate the filing calendars. + * @return FetchResult + */ + public function queryFilingCalendarsPost($returnCountry, $returnRegion, $model) + { + $path = "/api/v2/filingcalendars/query"; + $guzzleParams = [ + 'query' => ['returnCountry' => $returnCountry, 'returnRegion' => $returnRegion], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'POST', $guzzleParams); + } + /** * Retrieve all filing requests * * This API is available by invitation only. + * + * This API is deprecated - please use POST `/api/v2/filingrequests/query` API. + * * A "filing request" represents a request to change an existing filing calendar. Filing requests * are reviewed and validated by Avalara Compliance before being implemented. * @@ -4447,6 +4518,29 @@ public function queryFilingRequests($filingCalendarId, $filter=null, $top=null, return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Retrieve all filing requests + * + * This API is available by invitation only. + * + * This API is intended to replace the GET `/api/v2/filingrequests` API. The fetch request object is posted on the body of the request instead of the URI, so it's not limited by a set number of characters. + * The documentation of the GET API shows how filtering, sorting and pagination works. + * + * + * @param int $filingCalendarId Specific filing calendar id for the request + * @param QueryRequestModel $model Query object to filter, sort and paginate the filing calendars. + * @return FetchResult + */ + public function queryFilingRequestsPost($filingCalendarId, $model) + { + $path = "/api/v2/filingrequests/query"; + $guzzleParams = [ + 'query' => ['filingCalendarId' => $filingCalendarId], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'POST', $guzzleParams); + } + /** * Create a new filing request to edit a filing calendar * @@ -4480,7 +4574,7 @@ public function requestFilingCalendarUpdate($companyId, $id, $model) * This API is available by invitation only. * * - * @param int $companyId The unique ID of the company that owns the filing request object + * @param int $companyId The unique ID of the company that owns the filing calendar object * @param int $id The unique ID of the filing calendar object * @param FilingCalendarModel $model The filing calendar model you are wishing to update with. * @return FilingCalendarModel @@ -4809,6 +4903,26 @@ public function filingsCheckupReports($companyId, $year, $month) return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Retrieve a list of filings for the specified accrual return. + * + * + * + * + * @param int $companyId The ID of the company that owns these batches + * @param int $filingReturnId The ID of the accrual return + * @return FetchResult + */ + public function getAccrualFillings($companyId, $filingReturnId) + { + $path = "/api/v2/companies/{$companyId}/filings/accrual/{$filingReturnId}"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + /** * Retrieve a single attachment for a filing * @@ -5215,10 +5329,10 @@ public function updateReturnPayment($companyId, $id, $model) * FREE API - Request a free trial of AvaTax * * Call this API to obtain a free AvaTax account. - * - * This API is free to use. No authentication credentials are required to call this API. You must read and - * accept [Avalara's terms and conditions](https://www1.avalara.com/us/en/legal/terms.html) for the account to be - * created. + * + * This API is free to use. No authentication credentials are required to call this API. You must read and + * accept [Avalara's terms and conditions](https://www1.avalara.com/us/en/legal/terms.html) for the account to be + * created. * * If all conditions are met, this API will grant a free trial version of AvaTax. For a list of functionality * available in the free trial and its limitations, please see the [AvaTax Developer Website Free Trial page](https://developer.avalara.com/avatax/signup/). @@ -5338,14 +5452,14 @@ public function taxRatesByPostalCode($country, $postalCode) * Request the javascript for a funding setup widget * * This API is available by invitation only. - * Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are - * required to setup their funding configuration before Avalara can begin filing tax returns on their + * Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are + * required to setup their funding configuration before Avalara can begin filing tax returns on their * behalf. * Funding configuration for each company is set up by submitting a funding setup request, which can * be sent either via email or via an embedded HTML widget. * When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members * before approval. - * This API returns back the actual javascript code to insert into your application to render the + * This API returns back the actual javascript code to insert into your application to render the * JavaScript funding setup widget inline. * Use the 'methodReturn.javaScript' return value to insert this widget into your HTML page. * This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider. @@ -5368,8 +5482,8 @@ public function activateFundingRequest($id) * Retrieve status about a funding setup request * * This API is available by invitation only. - * Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are - * required to setup their funding configuration before Avalara can begin filing tax returns on their + * Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are + * required to setup their funding configuration before Avalara can begin filing tax returns on their * behalf. * Funding configuration for each company is set up by submitting a funding setup request, which can * be sent either via email or via an embedded HTML widget. @@ -5773,6 +5887,37 @@ public function queryItems($filter=null, $include=null, $top=null, $skip=null, $ return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Sync items from a product catalog + * + * Syncs a list of items with AvaTax without waiting for them to be created. It is ideal for syncing large product catalogs + * with AvaTax. + * + * Any invalid or duplicate items will be ignored. To diagnose why an item is not created, use the normal create transaction API to receive validation information. + * + * This API is currently limited to 1000 items per call (the limit is subject to change). + * + * 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. + * + * + * @param int $companyId The ID of the company that owns this item. + * @param SyncItemsRequestModel $model The request object. + * @return SyncItemsResponseModel + */ + public function syncItems($companyId, $model) + { + $path = "/api/v2/companies/{$companyId}/items/sync"; + $guzzleParams = [ + 'query' => [], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'POST', $guzzleParams); + } + /** * Update a single item * @@ -6743,6 +6888,33 @@ public function listNexusByCompany($companyId, $filter=null, $include=null, $top return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Summarize nexus by NexusTaxTypeGroup for this company + * + * Provides a summary of nexus information useful for quickly displaying key information. + * + * The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional + * taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your + * accountant or lawyer prior to declaring nexus. + * + * This API produces only basic information about your company's nexus declarations. For example, it will show + * the number of nexus declarations of each tax type. To request more information about your company's nexus + * declarations, please use `QueryNexus` or `ListNexusByCompany`. + * + * + * @param int $companyId The ID of the company that owns these nexus objects + * @return NexusSummaryModel + */ + public function nexusSummary($companyId) + { + $path = "/api/v2/companies/{$companyId}/nexus/summary"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + /** * Retrieve all nexus * @@ -7196,7 +7368,7 @@ public function getNoticeRootCauses($id, $companyId) * List all tax notice objects assigned to this company. * A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara * Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - * + * * 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. * @@ -7223,10 +7395,13 @@ public function listNoticesByCompany($companyId, $filter=null, $include=null, $t * Retrieve all notices. * * This API is available by invitation only. + * + * This API is deprecated - please use POST `/api/v2/notices/query` API. + * * Get multiple notice objects across all companies. * A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara * Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - * + * * 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. * @@ -7248,11 +7423,33 @@ public function queryNotices($filter=null, $include=null, $top=null, $skip=null, return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Retrieve all notices. + * + * This API is available by invitation only. + * + * This API is intended to replace the GET `/api/v2/notices` API. The fetch request object is posted on the body of the request instead of the URI, so it's not limited by a set number of characters. + * The documentation of the GET API shows how filtering, sorting and pagination works. + * + * + * @param QueryRequestModel $model Query object to filter, sort and paginate the filing calendars. + * @return FetchResult + */ + public function queryNoticesPost($model) + { + $path = "/api/v2/notices/query"; + $guzzleParams = [ + 'query' => [], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'POST', $guzzleParams); + } + /** * Update a single notice finance detail. * * This API is available by invitation only. - * All data from the existing object will be replaced with data in the object you PUT. + * 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. * * @@ -7279,7 +7476,7 @@ public function updateFinanceDetails($companyId, $noticeid, $financeDetailsId, $ * Replace the existing notice object at this URL with an updated object. * A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara * Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - * All data from the existing object will be replaced with data in the object you PUT. + * 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. * * @@ -7302,7 +7499,7 @@ public function updateNotice($companyId, $id, $model) * Update a single notice comment. * * This API is available by invitation only. - * All data from the existing object will be replaced with data in the object you PUT. + * 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. * * @@ -7331,7 +7528,7 @@ public function updateNoticeComments($companyId, $noticeid, $commentDetailsId, $ * * @param int $companyId The ID of the company for this attachment. * @param ResourceFileUploadRequestModel $model The ResourceFileId of the attachment to download. - * @return object + * @return ResourceFileUploadResultModel */ public function uploadAttachment($companyId, $model) { @@ -7435,14 +7632,14 @@ public function listNotifications($filter=null, $top=null, $skip=null, $orderBy= * Request a new Avalara account * * This API is for use by partner onboarding services customers only. - * + * * Avalara invites select partners to refer new customers to the AvaTax service using the onboarding features * of AvaTax. These partners can create accounts for new customers using this API. - * + * * Calling this API creates an account with the specified product subscriptions, but does not configure billing. * The customer will receive information from Avalara about how to configure billing for their account. * You should call this API when a customer has requested to begin using Avalara services. - * + * * If the newly created account owner wishes, they can confirm that they have read and agree to the Avalara * terms and conditions. If they do so, they can receive a license key as part of this API and their * API will be created in `Active` status. If the customer has not yet read and accepted these terms and @@ -7489,8 +7686,8 @@ public function requestNewEntitlement($id, $offer) * * # For Registrar Use Only * This API is for use by Avalara Registrar administrative users only. - * - * Create a single new account object. + * + * Create a single new account object. * When creating an account object you may attach subscriptions and users as part of the 'Create' call. * * @@ -7565,7 +7762,7 @@ public function createSubscriptions($accountId, $model) * * # For Registrar Use Only * This API is for use by Avalara Registrar administrative users only. - * + * * Delete an account. * Deleting an account will delete all companies and all account level users attached to this account. * @@ -7665,7 +7862,7 @@ public function resetPassword($userId, $unmigrateFromAi, $model) * * # For Registrar Use Only * This API is for use by Avalara Registrar administrative users only. - * + * * Replace an existing account object with an updated account object. * * @@ -8398,6 +8595,29 @@ public function buildTaxContentFileForLocation($companyId, $id, $date, $format, return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Retrieve send-sale tax content for this company. + * + * This API is available by invitation only. + * + * + * @param string $date The date for which we are fetching tax content. + * @param string $taxCode The tax code for which we are fetching tax content. + * @param int $companyId The unique ID number of the company which is fetching tax content. + * @param string $format Requests a specific data format for this content file. (See SendSalesOutputFileFormat::* for a list of allowable values) + * @param string $type Requests a specific encoding for this content file. (See SendSalesFileType::* for a list of allowable values) + * @return object + */ + public function downloadSendSalesRateFile($date, $taxCode, $companyId, $format, $type) + { + $path = "/api/v2/sendsalescontent/download/{$companyId}/{$taxCode}/{$date}"; + $guzzleParams = [ + 'query' => ['format' => $format, 'type' => $type], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + /** * Download a file listing tax rates by postal code * @@ -8457,6 +8677,54 @@ public function downloadTaxRatesByZipCode($date, $region) return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Export the tax profile of this company to a backup file + * + * Exports the tax profile of a company to a file, containing all information that affects tax calculation for this company. + * + * A tax profile is a series of decisions and configuration choices that affect your company's tax calculation. These decisions + * include your nexus declarations, your item catalog, your custom tax rules, and so on. + * + * This API can be used to export a complete zip file containing your company's current tax profile, and you can then restore this + * profile to a different company or compare it over time to see if your profile has been changed. + * + * + * @param int $companyId The unique ID number of the company whose profile you wish to retrieve. + * @return object + */ + public function exportTaxProfile($companyId) + { + $path = "/api/v2/companies/{$companyId}/taxprofile"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + + /** + * Import a tax profile. + * + * Imports a tax profile to a new company, along with the option to import account settings. + * + * + * @param int $accountId The account id of the account to which the tax profile will be imported. + * @param string $newCompanyCode The companyCode to use for the imported company. + * @param boolean $replaceAccountSettings Replace the current account settings with the ones in the tax profile. + * @param boolean $bypassNexusValidation Enable invalid nexus to be imported. + * @param object $taxProfile The taxProfile + * @return object + */ + public function importTaxProfile($accountId, $newCompanyCode, $replaceAccountSettings, $bypassNexusValidation, $taxProfile) + { + $path = "/api/v2/taxprofile"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'POST', $guzzleParams); + } + /** * Create a new tax rule * @@ -9646,6 +9914,28 @@ public function getUserEntitlements($id, $accountId) return $this->restCall($path, 'GET', $guzzleParams); } + /** + * Get information about a username. + * + * You may call this API prior to creating a user, to check if a particular username is available for use. Using this API, you can + * present a friendly experience prior to attempting to create a new user object. + * + * Please ensure that the query string is url encoded if you wish to check information for a user that contains url-sensitive characters. + * + * + * @param string $username The username to search. + * @return UsernameModel + */ + public function getUsername($username) + { + $path = "/api/v2/usernames"; + $guzzleParams = [ + 'query' => ['username' => $username], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams); + } + /** * Retrieve users for this account * diff --git a/src/Models.php b/src/Models.php index ed0171a..335c2f9 100644 --- a/src/Models.php +++ b/src/Models.php @@ -50,6 +50,11 @@ class AccountModel */ public $accountStatusId; + /** + * @var string The type of this account. (See AccountTypeId::* for a list of allowable values) + */ + public $accountTypeId; + /** * @var string The date when this record was created. */ @@ -279,7 +284,7 @@ class NewAccountRequestModel { /** - * @var string The offer code provided to you by your Avalara business development contact. This code controls what services and rates the customer will be provisioned with upon creation. If you do not know your offer code, please contact your Avalara business development representative. + * @var string The offer code provided to you by your Avalara business development contact. This code controls what services and rates the customer will be provisioned with upon creation. If you do not know your offer code, please contact your Avalara business development representative. */ public $offer; @@ -299,12 +304,12 @@ class NewAccountRequestModel public $leadSource; /** - * @var string The date on which the account should take effect. If null, defaults to today. You should leave this value `null` unless specifically requested by your Avalara business development manager. + * @var string The date on which the account should take effect. If null, defaults to today. You should leave this value `null` unless specifically requested by your Avalara business development manager. */ public $effectiveDate; /** - * @var string The date on which the account should expire. You should leave this value `null` unless specifically requested by your Avalara business development manager. + * @var string The date on which the account should expire. You should leave this value `null` unless specifically requested by your Avalara business development manager. */ public $endDate; @@ -319,7 +324,7 @@ class NewAccountRequestModel public $website; /** - * @var string 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. + * @var string 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 $paymentMethodId; @@ -349,12 +354,12 @@ class NewAccountRequestModel public $email; /** - * @var string If instructed by your Avalara business development manager, set this value to a temporary password to permit the user to continue their onboarding process. If this value is null, a temporary password is generated by the system and emailed to the user. The user will then be asked to choose a permanent password when they first log on to the AvaTax website. + * @var string If instructed by your Avalara business development manager, set this value to a temporary password to permit the user to continue their onboarding process. If this value is null, a temporary password is generated by the system and emailed to the user. The user will then be asked to choose a permanent password when they first log on to the AvaTax website. */ public $userPassword; /** - * @var string This option controls what type of a welcome email is sent when the account is created. * `Normal` - A standard welcome email will be sent. * `Suppressed` - No email will be sent. * `Custom` - If your Avalara business development representative provides you with a customized welcome email for your customers, please select this option. + * @var string This option controls what type of a welcome email is sent when the account is created. * `Normal` - A standard welcome email will be sent. * `Suppressed` - No email will be sent. * `Custom` - If your Avalara business development representative provides you with a customized welcome email for your customers, please select this option. */ public $welcomeEmail; @@ -364,7 +369,7 @@ class NewAccountRequestModel public $companyAddress; /** - * @var string Company code to be assigned to the company created for this account. If no company code is provided, this will be defaulted to "DEFAULT" company code. + * @var string Company code to be assigned to the company created for this account. If no company code is provided, this will be defaulted to "DEFAULT" company code. */ public $companyCode; @@ -374,12 +379,12 @@ class NewAccountRequestModel public $properties; /** - * @var boolean Set this to true if and only if the owner of the newly created account accepts Avalara's terms and conditions for your account. Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. + * @var boolean Set this to true if and only if the owner of the newly created account accepts Avalara's terms and conditions for your account. Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. */ public $acceptAvalaraTermsAndConditions; /** - * @var boolean Set this to true if and only if the owner of the newly created account has fully read Avalara's terms and conditions for your account. Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. + * @var boolean Set this to true if and only if the owner of the newly created account has fully read Avalara's terms and conditions for your account. Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. */ public $haveReadAvalaraTermsAndConditions; @@ -388,6 +393,16 @@ class NewAccountRequestModel */ public $marketingContext; + /** + * @var string Type of the account to be created. Regular, Firm or FirmClient + */ + public $accountType; + + /** + * @var string United States Taxpayer ID number, usually your Employer Identification Number if you are a business or your Social Security Number if you are an individual. This value is required if you subscribe to Avalara Managed Returns or the SST Certified Service Provider services, but it is optional if you do not subscribe to either of those services. + */ + public $taxPayerIdNumber; + } /** @@ -1157,239 +1172,221 @@ class AvaTaxMessage } /** - * Represents an advanced rule script + * Model for Advanced Rules when full details are requested */ -class AdvancedRuleScriptModel +class AdvancedRuleFullDetailsModel { /** - * @var int The unique ID of the script + * @var string The code script for the rule */ - public $id; + public $script; /** - * @var int Account ID + * @var string Script run for validating customer data */ - public $accountId; + public $customerDataValidatorScript; /** - * @var string How to proceed if the rule crashes (See AdvancedRuleCrashBehavior::* for a list of allowable values) + * @var boolean Has the rule been approved */ - public $crashBehavior; + public $isApproved; /** - * @var string The type of script - request or response (See AdvancedRuleScriptType::* for a list of allowable values) + * @var string Creator of the rule */ - public $scriptType; + public $createdBy; /** - * @var string The JavaScript rule + * @var string When the rule was created */ - public $script; + public $createdOn; /** - * @var boolean The rule has been approved + * @var string Last updater of the rule */ - public $isApproved; + public $modifiedBy; /** - * @var boolean The rule has been disabled + * @var string When the rule was last updated */ - public $isDisabled; - -} - -/** - * Represents an advanced rule table - */ -class AdvancedRuleTableModel -{ + public $modifiedOn; /** - * @var int The unique ID of the table + * @var string Approver of the rule */ - public $id; + public $approvedBy; /** - * @var int Account ID + * @var boolean Is this a system rule as opposed to customer-facing */ - public $accountId; + public $isSystemRule; /** - * @var string The name of the table + * @var boolean Is the rule displayed in the CUP UI */ - public $csvTableName; + public $isVisibleInCUP; /** - * @var string The CSV data + * @var boolean Is this a rule created for testing */ - public $csvTable; - -} - -/** - * Represents information about a tax form known to Avalara - */ -class AvaFileFormModel -{ + public $isTest; /** - * @var int Unique Id of the form + * @var string The JSON schema for customer data if it is required for the rule */ - public $id; + public $customerDataSchema; /** - * @var string Name of the file being returned + * @var int The version of the rule */ - public $returnName; + public $version; /** - * @var string Name of the submitted form + * @var string Unique identifier for a rule */ - public $formName; + public $ruleId; /** - * @var string A description of the submitted form + * @var string Rule name */ - public $description; + public $name; /** - * @var string The date this form starts to take effect + * @var string Description of the rule */ - public $effDate; + public $description; - /** - * @var string The date the form finishes to take effect - */ - public $endDate; +} - /** - * @var string State/Province/Region where the form is submitted for - */ - public $region; +/** + * Model for retrieving customer data schema + */ +class AdvancedRuleCustomerDataSchemaModel +{ /** - * @var string The country this form is submitted for + * @var string Unique identifier for the rule */ - public $country; + public $ruleId; /** - * @var string The type of the form being submitted (See FormTypeId::* for a list of allowable values) + * @var string Customer data schema */ - public $formTypeId; + public $customerDataSchema; + +} + +/** + * A company or business entity. + */ +class CompanyModel +{ /** - * @var string The type of Filing option (See FilingOptionTypeId::* for a list of allowable values) + * @var int The unique ID number of this company. */ - public $filingOptionTypeId; + public $id; /** - * @var string The type of the due date (See DueDateTypeId::* for a list of allowable values) + * @var int The unique ID number of the account this company belongs to. */ - public $dueDateTypeId; + public $accountId; /** - * @var int Due date + * @var int If this company is fully owned by another company, this is the unique identity of the parent company. */ - public $dueDay; + public $parentCompanyId; /** - * @var string The type of E-file due date. (See DueDateTypeId::* for a list of allowable values) + * @var string If this company files Streamlined Sales Tax, this is the PID of this company as defined by the Streamlined Sales Tax governing board. */ - public $efileDueDateTypeId; + public $sstPid; /** - * @var int The date by when the E-filing should be submitted + * @var string A unique code that references this company within your account. */ - public $efileDueDay; + public $companyCode; /** - * @var string The time of day by when the E-filing should be submitted + * @var string The name of this company, as shown to customers. */ - public $efileDueTime; + public $name; /** - * @var boolean Whether the customer has discount + * @var boolean This flag is true if this company is the default company for this account. Only one company may be set as the default. */ - public $hasVendorDiscount; + public $isDefault; /** - * @var string The way system does the rounding (See RoundingTypeId::* for a list of allowable values) + * @var int If set, this is the unique ID number of the default location for this company. */ - public $roundingTypeId; + public $defaultLocationId; /** - * @var string The outlet type of the form (See OutletTypeId::* for a list of allowable values) + * @var boolean This flag indicates whether tax activity can occur for this company. Set this flag to true to permit the company to process transactions. */ - public $outletTypeId; - -} - -/** - * Represents a batch of uploaded documents. - */ -class BatchModel -{ + public $isActive; /** - * @var int The unique ID number of this batch. + * @var string For United States companies, this field contains your Taxpayer Identification Number. This is a nine digit number that is usually called an EIN for an Employer Identification Number if this company is a corporation, or SSN for a Social Security Number if this company is a person. This value is required if you subscribe to Avalara Managed Returns or the SST Certified Service Provider services, but it is optional if you do not subscribe to either of those services. */ - public $id; + public $taxpayerIdNumber; /** - * @var string The user-friendly readable name for this batch. + * @var boolean Set this flag to true to give this company its own unique tax profile. If this flag is true, this company will have its own Nexus, TaxRule, TaxCode, and Item definitions. If this flag is false, this company will inherit all profile values from its parent. */ - public $name; + public $hasProfile; /** - * @var int The Account ID number of the account that owns this batch. + * @var boolean Set this flag to true if this company must file its own tax returns. For users who have Returns enabled, this flag turns on monthly Worksheet generation for the company. */ - public $accountId; + public $isReportingEntity; /** - * @var int The Company ID number of the company that owns this batch. + * @var string If this company participates in Streamlined Sales Tax, this is the date when the company joined the SST program. */ - public $companyId; + public $sstEffectiveDate; /** - * @var string The type of this batch. (See BatchType::* for a list of allowable values) + * @var string The two character ISO-3166 country code of the default country for this company. */ - public $type; + public $defaultCountry; /** - * @var string This batch's current processing status (See BatchStatus::* for a list of allowable values) + * @var string This is the three character ISO-4217 currency code of the default currency used by this company. */ - public $status; + public $baseCurrencyCode; /** - * @var string Any optional flags provided for this batch + * @var string Indicates whether this company prefers to round amounts at the document level or line level. (See RoundingLevelId::* for a list of allowable values) */ - public $options; + public $roundingLevelId; /** - * @var string The agent used to create this batch + * @var boolean Set this value to true to receive warnings in API calls via SOAP. */ - public $batchAgent; + public $warningsEnabled; /** - * @var string The date/time when this batch started processing + * @var boolean Set this flag to true to indicate that this company is a test company. If you have Returns enabled, Test companies will not file tax returns and can be used for validation purposes. */ - public $startedDate; + public $isTest; /** - * @var int The number of records in this batch; determined by the server + * @var string Used to apply tax detail dependency at a jurisdiction level. (See TaxDependencyLevelId::* for a list of allowable values) */ - public $recordCount; + public $taxDependencyLevelId; /** - * @var int The current record being processed + * @var boolean Set this value to true to indicate that you are still working to finish configuring this company. While this value is true, no tax reporting will occur and the company will not be usable for transactions. */ - public $currentRecord; + public $inProgress; /** - * @var string The date/time when this batch was completely processed + * @var string Business Identification No */ - public $completedDate; + public $businessIdentificationNo; /** * @var string The date when this record was created. @@ -1412,816 +1409,860 @@ class BatchModel public $modifiedUserId; /** - * @var BatchFileModel[] The list of files contained in this batch. + * @var ContactModel[] Optional: A list of contacts defined for this company. To fetch this list, add the query string `?$include=Contacts` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $files; - -} + public $contacts; -/** - * Represents one file in a batch upload. - */ -class BatchFileModel -{ + /** + * @var ItemModel[] Optional: A list of items defined for this company. To fetch this list, add the query string `?$include=Items` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + */ + public $items; /** - * @var int The unique ID number assigned to this batch file. + * @var LocationModel[] Optional: A list of locations defined for this company. To fetch this list, add the query string `?$include=Locations` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $id; + public $locations; /** - * @var int The unique ID number of the batch that this file belongs to. + * @var NexusModel[] Optional: A list of nexus defined for this company. To fetch this list, add the query string `?$include=Nexus` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $batchId; + public $nexus; /** - * @var string Logical Name of file (e.g. "Input" or "Error"). + * @var SettingModel[] Optional: A list of settings defined for this company. To fetch this list, add the query string `?$include=Settings` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $name; + public $settings; /** - * @var string Content of the batch file. (This value is encoded as a Base64 string) + * @var TaxCodeModel[] Optional: A list of tax codes defined for this company. To fetch this list, add the query string `?$include=TaxCodes` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $content; + public $taxCodes; /** - * @var int Size of content, in bytes. + * @var TaxRuleModel[] Optional: A list of tax rules defined for this company. To fetch this list, add the query string `?$include=TaxRules` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $contentLength; + public $taxRules; /** - * @var string Content mime type (e.g. text/csv). This is used for HTTP downloading. + * @var UPCModel[] Optional: A list of UPCs defined for this company. To fetch this list, add the query string `?$include=UPCs` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. */ - public $contentType; + public $upcs; /** - * @var string File extension (e.g. CSV). + * @var EcmsModel[] DEPRECATED - Please use the `ListCertificates` API. */ - public $fileExtension; + public $exemptCerts; /** - * @var string Path to the file - name/S3 key + * @var string The unique identifier of the mini-one-stop-shop used for Value Added Tax (VAT) processing. */ - public $filePath; + public $mossId; /** - * @var int Number of errors that occurred when processing this file. + * @var string The country code of the mini-one-stop-shop used for Value Added Tax (VAT) processing. */ - public $errorCount; + public $mossCountry; } /** - * Represents an invitation for a customer to use CertExpress to self-report their own certificates. - * This invitation is delivered by your choice of method, or you can present a hyperlink to the user - * directly in your connector. Your customer will be redirected to https://app.certexpress.com/ where - * they can follow a step-by-step guide to enter information about their exemption certificates. The - * certificates entered will be recorded and automatically linked to their customer record. + * A contact person for a company. */ -class CreateCertExpressInvitationModel +class ContactModel { /** - * @var string If the value of `deliveryMethod` is set to `Email`, please specify the email address of the recipient for the request. + * @var int The unique ID number of this contact. */ - public $recipient; + public $id; /** - * @var string If this invitation is sent via email or download, please specify the cover letter to use when building this invitation. For a list of cover letters, please call `ListCoverLetters`. + * @var int The unique ID number of the company to which this contact belongs. */ - public $coverLetterTitle; + public $companyId; /** - * @var int[] You may optionally specify a list of exposure zones to request in this CertExpress invitation. If you list more than one exposure zone, the customer will be prompted to provide an exemption certificate for each one. If you do not provide a list of exposure zones, the customer will be prompted to select an exposure zone. For a list of available exposure zones, please call `ListCertificateExposureZones`. + * @var string A unique code for this contact. */ - public $exposureZones; + public $contactCode; /** - * @var int[] You may optionally specify a list of exemption reasons to pre-populate in this CertExpress invitation. If you list exemption reasons, the customer will have part of their form already filled in when they visit the CertExpress website. For a list of available exemption reasons, please call `ListCertificateExemptReasons`. + * @var string The first or given name of this contact. */ - public $exemptReasons; + public $firstName; /** - * @var string Specify the type of invitation. CertExpress invitations can be delivered via email, web link, or facsimile. * If you specify `Email`, the invitation will be delivered via email. Please ask the customer to ensure that * If you specify `Fax`, the invitation will be sent via fax to the customer's fax number on file. * If you specify `Download`, the invitation will be prepared as a web link that you can display to the customer. (See CertificateRequestDeliveryMethod::* for a list of allowable values) + * @var string The middle name of this contact. */ - public $deliveryMethod; - -} - -/** - * Represent what is the current status of certificate request - */ -class CertExpressInvitationStatusModel -{ + public $middleName; /** - * @var string The status of the CertExpress invitation for this customer. If this status says (See CertExpressInvitationStatus::* for a list of allowable values) + * @var string The last or family name of this contact. */ - public $status; + public $lastName; /** - * @var CertExpressInvitationModel The CertExpress invitation for the customer. If you specified an email address in the invitation request, this invitation will be sent via email. Otherwise, you are expected to direct the customer using a hyperlink directly in your application. + * @var string Professional title of this contact. */ - public $invitation; - -} + public $title; -/** - * Represents an invitation for a customer to use CertExpress to self-report their own certificates. - * This invitation is delivered by your choice of method, or you can present a hyperlink to the user - * directly in your connector. Your customer will be redirected to https://app.certexpress.com/ where - * they can follow a step-by-step guide to enter information about their exemption certificates. The - * certificates entered will be recorded and automatically linked to their customer record. - */ -class CertExpressInvitationModel -{ + /** + * @var string The first line of the postal mailing address of this contact. + */ + public $line1; /** - * @var int A unique ID number representing this CertExpress invitation. + * @var string The second line of the postal mailing address of this contact. */ - public $id; + public $line2; /** - * @var int The unique ID number of the AvaTax company that sent this invitation. + * @var string The third line of the postal mailing address of this contact. */ - public $companyId; + public $line3; /** - * @var string The email address to which this invitation was sent. If this invitation was presented as a weblink, this value will be null. + * @var string The city of the postal mailing address of this contact. */ - public $recipient; + public $city; /** - * @var string The unique code of the customer that received this invitation. Note: This field is case sensitive. To have exemption certificates apply, this value should be the same as the one passed to create a customer. + * @var string Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. */ - public $customerCode; + public $region; /** - * @var CustomerModel The customer who received this invitation. + * @var string The postal code or zip code of the postal mailing address of this contact. */ - public $customer; + public $postalCode; /** - * @var CoverLetterModel The attached cover letter object to this request. + * @var string Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. */ - public $coverLetter; + public $country; /** - * @var string The status of the emails associated with this invitation. If this invitation was sent via email, this value will change to `Sent` when the email message has been sent. + * @var string The email address of this contact. */ - public $emailStatus; + public $email; /** - * @var boolean True if this invitation contained a cover letter only. + * @var string The main phone number for this contact. */ - public $coverLettersOnly; + public $phone; /** - * @var int[] When an invitation is sent, it contains a list of exposure zones for which the customer is invited to upload their exemption certificates. This list contains the ID numbers of the exposure zones identified. For a list of exposure zones, please call `ListCertificateExposureZones`. + * @var string The mobile phone number for this contact. */ - public $exposureZones; + public $mobile; /** - * @var int[] The list of exemption reasons identified by this CertExpress invitation. For a list of reason codes, please call `ListCertificateExemptReasons`. + * @var string The facsimile phone number for this contact. */ - public $exemptReasons; + public $fax; /** - * @var string Indicates the method that was used to deliver this CertExpress invitation. (See CertificateRequestDeliveryMethod::* for a list of allowable values) + * @var string The date when this record was created. */ - public $deliveryMethod; + public $createdDate; /** - * @var string The custom message delivered with this invitation. + * @var int The User ID of the user who created this record. */ - public $message; + public $createdUserId; /** - * @var string The date of the invitation. + * @var string The date/time when this record was last modified. */ - public $date; + public $modifiedDate; /** - * @var string The web link (URL) that a customer can click on or visit to begin using this CertExpress invitation. This value is only usable if the status of this invitation is `Ready` and the request was created with type `Download`. NOTE: This link usually takes a few minutes to be available. + * @var int The user ID of the user who last modified this record. */ - public $requestLink; + public $modifiedUserId; } /** - * Represents a customer to whom you sell products and/or services. + * Represents an item in your company's product catalog. */ -class CustomerModel +class ItemModel { /** - * @var int Unique ID number of this customer. + * @var int The unique ID number of this item. */ public $id; /** - * @var int The unique ID number of the AvaTax company that recorded this customer. + * @var int The unique ID number of the company that owns this item. */ public $companyId; /** - * @var string The unique code identifying this customer. Must be unique within your company. This code should be used in the `customerCode` field of any call that creates or adjusts a transaction in order to ensure that all exemptions that apply to this customer are correctly considered. Note: This field is case sensitive. + * @var string A unique code representing this item. */ - public $customerCode; + public $itemCode; /** - * @var string A customer-configurable alternate ID number for this customer. You may set this value to match any other system that would like to reference this customer record. + * @var int DEPRECATED - For identifying an `Item` with `Avalara TaxCode`, please call the [CreateItemClassification API] with your ItemCode and the Avalara TaxCode. The unique ID number of the tax code that is applied when selling this item. When creating or updating an item, you can either specify the Tax Code ID number or the Tax Code string; you do not need to specify both values. */ - public $alternateId; + public $taxCodeId; /** - * @var string A friendly name identifying this customer. + * @var string DEPRECATED - For identifying an `Item` with `Avalara TaxCode`, please call the [CreateItemClassification API] with your ItemCode and the Avalara TaxCode. The unique code string of the Tax Code that is applied when selling this item. When creating or updating an item, you can either specify the Tax Code ID number or the Tax Code string; you do not need to specify both values. */ - public $name; + public $taxCode; /** - * @var string Indicates the "Attn:" component of the address for this customer, if this customer requires mailings to be shipped to the attention of a specific person or department name. + * @var string A friendly description of this item in your product catalog. */ - public $attnName; + public $description; /** - * @var string First line of the street address of this customer. + * @var string A way to group similar items. */ - public $line1; + public $itemGroup; /** - * @var string Second line of the street address of this customer. + * @var string The date when this record was created. */ - public $line2; + public $createdDate; /** - * @var string City component of the street address of this customer. + * @var int The User ID of the user who created this record. */ - public $city; + public $createdUserId; /** - * @var string Postal Code / Zip Code component of the address of this customer. + * @var string The date/time when this record was last modified. */ - public $postalCode; + public $modifiedDate; /** - * @var string The main phone number for this customer. + * @var int The user ID of the user who last modified this record. */ - public $phoneNumber; + public $modifiedUserId; /** - * @var string The fax phone number for this customer, if any. + * @var ClassificationModel[] List of classifications that belong to this item. A single classification consits of a productCode and a systemCode for a particular item. */ - public $faxNumber; + public $classifications; /** - * @var string The main email address for this customer. + * @var ItemParameterModel[] List of item parameters. */ - public $emailAddress; + public $parameters; + +} + +/** + * A location where this company does business. + * Some jurisdictions may require you to list all locations where your company does business. + */ +class LocationModel +{ /** - * @var string The name of the main contact person for this customer. + * @var int The unique ID number of this location. */ - public $contactName; + public $id; /** - * @var string Date when this customer last executed a transaction. + * @var int The unique ID number of the company that operates at this location. */ - public $lastTransaction; + public $companyId; /** - * @var string The date when this record was created. + * @var string A code that identifies this location. Must be unique within your company. */ - public $createdDate; + public $locationCode; /** - * @var string The date/time when this record was last modified. + * @var string A friendly name for this location. */ - public $modifiedDate; + public $description; /** - * @var string Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + * @var string Indicates whether this location is a physical place of business or a temporary salesperson location. (See AddressTypeId::* for a list of allowable values) */ - public $country; + public $addressTypeId; /** - * @var string Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. + * @var string Indicates the type of place of business represented by this location. (See AddressCategoryId::* for a list of allowable values) */ - public $region; + public $addressCategoryId; /** - * @var boolean True if this customer record is specifically used for bill-to purposes. + * @var string The first line of the physical address of this location. */ - public $isBill; + public $line1; /** - * @var boolean True if this customer record is specifically used for ship-to purposes. + * @var string The second line of the physical address of this location. */ - public $isShip; + public $line2; /** - * @var string For customers in the United States, this field is the federal taxpayer ID number. For businesses, this is a Federal Employer Identification Number. For individuals, this will be a Social Security Number. + * @var string The third line of the physical address of this location. */ - public $taxpayerIdNumber; + public $line3; /** - * @var CertificateModel[] A list of exemption certficates that apply to this customer. You can fetch this data by specifying `$include=certificates` when calling a customer fetch API. + * @var string The city of the physical address of this location. */ - public $certificates; + public $city; /** - * @var CustomFieldModel[] A list of custom fields defined on this customer. For more information about custom fields, see the [Avalara Help Center article about custom fields](https://help.avalara.com/0021_Avalara_CertCapture/All_About_CertCapture/Edit_or_Remove_Details_about_Customers). + * @var string The county name of the physical address of this location. Not required. */ - public $customFields; + public $county; /** - * @var ExposureZoneModel[] A list of exposure zones where you do business with this customer. To keep track of certificates that are needed for each customer, set this value to a list of all exposure zones where you sell products to this customer. You can find a list of exposure zones by calling `ListExposureZones`. This field is often called "Ship-To States" or "Ship-To Zones", since it generally refers to locations where you ship products when this customer makes a purchase. This field is useful for audit purposes since it helps you ensure you have the necessary certificates for each customer. + * @var string Name or ISO 3166 code identifying the region within the country of the physical address of this location. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. */ - public $exposureZones; + public $region; /** - * @var CustomerModel[] A list of ship-to customer records that are connected to this bill-to customer. Customer records represent businesses or individuals who can provide exemption certificates. Some customers may have certificates that are linked to their shipping address or their billing address. To group these customer records together, you may link multiple bill-to and ship-to addresses together to represent a single entity that has multiple different addresses of different kinds. + * @var string The postal code or zip code of the physical address of this location. */ - public $shipTos; + public $postalCode; -} + /** + * @var string Name or ISO 3166 code identifying the country of the physical address of this location. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + */ + public $country; -/** - * 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. - */ -class CoverLetterModel -{ + /** + * @var boolean Set this flag to true to indicate that this is the default location for this company. + */ + public $isDefault; /** - * @var int A unique ID number representing a cover letter sent with a CertExpress invitation. + * @var boolean Set this flag to true to indicate that this location has been registered with a tax authority. */ - public $id; + public $isRegistered; /** - * @var int The unique ID number of the AvaTax company that received this certificate. + * @var string If this location has a different business name from its legal entity name, specify the "Doing Business As" name for this location. */ - public $companyId; + public $dbaName; /** - * @var string The title used when sending the cover letter. + * @var string A friendly name for this location. */ - public $title; + public $outletName; /** - * @var string The subject message used when sending the cover letter via email. + * @var string The date when this location was opened for business, or null if not known. */ - public $subject; + public $effectiveDate; /** - * @var string A full description of the cover letter's contents and message. + * @var string If this place of business has closed, the date when this location closed business. */ - public $description; + public $endDate; /** - * @var string The date when this record was created. + * @var string The most recent date when a transaction was processed for this location. Set by AvaTax. */ - public $createdDate; + public $lastTransactionDate; /** - * @var string The date/time when this record was last modified. + * @var string The date when this location was registered with a tax authority. Not required. */ - public $modifiedDate; + public $registeredDate; /** - * @var boolean Is this cover letter active + * @var string The date when this record was created. */ - public $active; + public $createdDate; /** - * @var int How many pages this cover letter encompasses + * @var int The User ID of the user who created this record. */ - public $pageCount; + public $createdUserId; /** - * @var string The file name of the cover letter template + * @var string The date/time when this record was last modified. */ - public $templateFilename; + public $modifiedDate; /** - * @var int The version number of the template + * @var int The user ID of the user who last modified this record. */ - public $version; + public $modifiedUserId; + + /** + * @var LocationSettingModel[] Extra information required by certain jurisdictions for filing. For a list of settings recognized by Avalara, query the endpoint "/api/v2/definitions/locationquestions". To determine the list of settings required for this location, query the endpoint "/api/v2/companies/(id)/locations/(id)/validate". + */ + public $settings; } /** - * 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. - */ -class CertificateModel + * Represents a declaration of nexus within a particular taxing jurisdiction. + * + * To create a nexus declaration for your company, you must first call the Definitions API `ListNexus` to obtain a + * list of Avalara-defined nexus. Once you have determined which nexus you wish to declare, you should customize + * only the user-selectable fields in this object. + * + * The user selectable fields for the nexus object are `companyId`, `effectiveDate`, `endDate`, `localNexusTypeId`, + * `taxId`, `nexusTypeId`, `hasPermanentEstablishment`, and `isSellerImporterOfRecord`. + * + * When calling `CreateNexus` or `UpdateNexus`, all values in your nexus object except for the user-selectable fields + * must match an Avalara-defined system nexus object. You can retrieve a list of Avalara-defined system nexus objects + * by calling `ListNexus`. If any data does not match, AvaTax may not recognize your nexus declaration. + */ +class NexusModel { /** - * @var int Unique ID number of this certificate. + * @var int The unique ID number of this declaration of nexus. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. */ public $id; /** - * @var int The unique ID number of the AvaTax company that recorded this certificate. + * @var int The unique ID number of the company that declared nexus. This field is user-selectable and should be provided when creating or updating a nexus object. */ public $companyId; /** - * @var string The date when this certificate was signed. + * @var string Name or ISO 3166 code identifying the country in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $signedDate; + public $country; /** - * @var string Expiration date when this certificate will no longer be valid. + * @var string Name or ISO 3166 code identifying the region within the country. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $expirationDate; + public $region; /** - * @var string File name for the image of this certificate. When creating a certificate, if you do not upload a PDF or JPG image, you must specify the filename of the certificate as it is tracked in your repository. To create a certificate, you must provide one of the following fields: either a `filename`, a `pdf` file, or an array of JPG `pages`. The API will return an error if you omit these fields or if you attempt to put values in more than one of them. + * @var string (DEPRECATED) The jurisdiction type of the jurisdiction in which this company declared nexus. NOTE: Use jurisdictionTypeId instead. (See JurisTypeId::* for a list of allowable values) */ - public $filename; + public $jurisTypeId; /** - * @var boolean True if this certificate is marked as valid. A valid certificate can be considered for exemption purposes. When a certificate is marked invalid, it will no longer be considered when calculating exemption for a customer. + * @var string The type of the jurisdiction in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. (See JurisdictionType::* for a list of allowable values) */ - public $valid; + public $jurisdictionTypeId; /** - * @var boolean This value is true if the certificate has gone through the certificate validation process. For more information on the certificate validation process, please see the Avalara Help Center. + * @var string The code identifying the jurisdiction in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $verified; + public $jurisCode; /** - * @var float If this certificate provides exemption from transactional taxes, what percentage of the transaction is considered exempt? For a fully exempt certificate, this percentage should be 100. + * @var string The common name of the jurisdiction in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $exemptPercentage; + public $jurisName; /** - * @var boolean This value is true if this certificate is a single (or standalone) certificate. This value is set during the audit stage of the certificate validation process. + * @var string The date when this nexus began. If not known, set to null. This field is user-selectable and should be provided when creating or updating a nexus object. */ - public $isSingleCertificate; + public $effectiveDate; /** - * @var ExemptionReasonModel The exemption reason that CertCapture audit/internal logic identifies for created certificate. + * @var string If this nexus will end or has ended on a specific date, set this to the date when this nexus ends. This field is user-selectable and should be provided when creating or updating a nexus object. */ - public $validatedExemptionReason; + public $endDate; /** - * @var ExemptionReasonModel The exemption reason associated with this certificate. For example, the reason code for exemption for purposes of resale is `RESALE`. For a list of exemption reasons, call `ListCertificateExemptReasons`. + * @var string The short name of the jurisdiction. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $exemptionReason; + public $shortName; /** - * @var string The status of the certificate + * @var string The signature code of the boundary region as defined by Avalara. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $status; + public $signatureCode; /** - * @var string The date/time when this record was created. + * @var string The state assigned number of this jurisdiction. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $createdDate; + public $stateAssignedNo; /** - * @var string The date/time when this record was last modified. + * @var string The type of nexus that this company is declaring. If you are voluntarily declaring nexus in a jurisdiction, you should select `SalesOrSellersUseTax` for your nexus type option. This option allows you to calculate tax correctly whether you are selling in-state or shipping from an out-of-state location. If you are legally obligated to declare nexus due to physical presence or other sufficient nexus, you should select `SalesTax`. This indicates that, as a legal requirement, your company must always collect and remit full sales tax in this jurisdiction. If you are participating in the Streamlined Sales Tax program, your SST administrator will select nexus settings for you in all SST jurisdictions. Do not select any SST options by yourself. This field is user-selectable and should be provided when creating or updating a nexus object. (See NexusTypeId::* for a list of allowable values) */ - public $modifiedDate; + public $nexusTypeId; /** - * @var int Number of pages contained within this certificate. + * @var string Indicates whether this nexus is defined as origin or destination nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. (See Sourcing::* for a list of allowable values) */ - public $pageCount; + public $sourcing; /** - * @var CustomerModel[] A list of customers to which this certificate applies. You can fetch this data by specifying `$include=customers` when calling a certificate fetch API. + * @var boolean True if you are also declaring local nexus within this jurisdiction. Many U.S. states have options for declaring nexus in local jurisdictions as well as within the state. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $customers; + public $hasLocalNexus; /** - * @var PoNumberModel[] A list of purchase order numbers that are valid for use with this certificate. If this certificate is applicable for all purchase order numbers, this field will be empty. You can fetch this data by specifying `$include=po_numbers` when calling a certificate fetch API. + * @var string If you are declaring local nexus within this jurisdiction, this indicates whether you are declaring only a specified list of local jurisdictions, all state-administered local jurisdictions, or all local jurisdictions. This field is user-selectable and should be provided when creating or updating a nexus object. (See LocalNexusTypeId::* for a list of allowable values) */ - public $poNumbers; + public $localNexusTypeId; /** - * @var ExposureZoneModel The exposure zone where this certificate is valid. + * @var boolean Set this value to true if your company has a permanent establishment within this jurisdiction. This field is user-selectable and should be provided when creating or updating a nexus object. */ - public $exposureZone; + public $hasPermanentEstablishment; /** - * @var CertificateAttributeModel[] A list of certificate attributes that apply to this certificate. You can fetch this data by specifying `$include=attributes` when calling a certificate fetch API. + * @var string Optional - the tax identification number under which you declared nexus. This field is user-selectable and should be provided when creating or updating a nexus object. */ - public $attributes; + public $taxId; /** - * @var string This field is available for input only. To retrieve the image after creation, use the `DownloadCertificateImage` API. When creating a certificate, you may optionally provide a PDF image in Base64 URLEncoded format. PDFs are automatically parsed into individual page JPG images and can be retrieved back later as either the original PDF or the individual pages. To create a certificate, you must provide one of the following fields: either a `filename`, a `pdf` file, or an array of JPG `pages`. The API will return an error if you omit these fields or if you attempt to put values in more than one of them. + * @var boolean For the United States, this flag indicates whether this particular nexus falls within a U.S. State that participates in the Streamlined Sales Tax program. For countries other than the US, this flag is null. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. */ - public $pdf; + public $streamlinedSalesTax; /** - * @var string[] This field is available for input only. To retrieve the image after creation, use the `DownloadCertificateImage` API. When creating a certificate, you may optionally provide a list of JPG images, one per page, in Base64 URLEncoded format. These JPG images are automatically combined into a single downloadable PDF and can be retrieved back later as either the original JPG images or the combined PDF. To create a certificate, you must provide one of the following fields: either a `filename`, a `pdf` file, or an array of JPG `pages`. The API will return an error if you omit these fields or if you attempt to put values in more than one of them. + * @var string The date when this record was created. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. */ - public $pages; + public $createdDate; + + /** + * @var int The User ID of the user who created this record. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + */ + public $createdUserId; + + /** + * @var string The date/time when this record was last modified. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + */ + public $modifiedDate; + + /** + * @var int The user ID of the user who last modified this record. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + */ + public $modifiedUserId; + + /** + * @var string The type of nexus that this company is declaring.Replaces NexusTypeId. Use [ListNexusTaxTypeGroups](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListNexusTaxTypeGroups/) API for a list of nexus tax type groups. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + */ + public $nexusTaxTypeGroup; + + /** + * @var int A unique ID number of the tax authority that is associated with this nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + */ + public $taxAuthorityId; + + /** + * @var boolean 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. This field is user-selectable and should be provided when creating or updating a nexus object. + */ + public $isSellerImporterOfRecord; } /** - * A custom field provides extra information about a customer or certificate. + * This object is used to keep track of custom information about a company. * - * Custom fields are provided to permit you to store additional information about an exemption certificate or customer. They are available to - * support additional use cases beyond that supported directly by Avalara's exemption certificate software. + * The company settings system is a metadata system that you can use to store extra information + * about a company. Your integration or connector could use this data storage to keep track of + * preference information, reminders, or any other storage that would need to persist even if + * the customer uninstalls your application. * - * For more information about custom fields, see the [Avalara Help Center article about custom fields](https://help.avalara.com/0021_Avalara_CertCapture/All_About_CertCapture/Edit_or_Remove_Details_about_Customers). + * A setting can refer to any type of data you need to remember about this company object. + * When creating this object, you may define your own `set`, `name`, and `value` parameters. + * To define your own values, please choose a `set` name that begins with `X-` to indicate an extension. */ -class CustomFieldModel +class SettingModel { /** - * @var string The name of the custom field. + * @var int The unique ID number of this setting. + */ + public $id; + + /** + * @var int The unique ID number of the company this setting refers to. + */ + public $companyId; + + /** + * @var string A user-defined "set" containing this setting. Avalara defines some sets that cannot be changed. To create your own set, choose a set name that begins with `X-` to indicate that this is an extension value. We recommend that you choose a set name that clearly identifies your application, and then store data within name/value pairs within that set. For example, if you were creating an application called MyApp, you might choose to create a set named `X-MyCompany-MyApp`. + */ + public $set; + + /** + * @var string A user-defined "name" for this name-value pair. */ public $name; /** - * @var string The value of the custom field. + * @var string The value of this name-value pair. */ public $value; } /** - * Information about a physical area or zone in which a certificate can apply. - * An exposure zone for an exemption certificate will generally be a tax authority such - * as a state, country, or local government entity. + * Represents a tax code that can be applied to items on a transaction. + * A tax code can have specific rules for specific jurisdictions that change the tax calculation behavior. */ -class ExposureZoneModel +class TaxCodeModel { /** - * @var int A unique ID number representing this exposure zone. + * @var int The unique ID number of this tax code. */ public $id; /** - * @var int The unique ID number of the AvaTax company that recorded this customer. + * @var int The unique ID number of the company that owns this tax code. */ public $companyId; /** - * @var string The short name of this exposure zone, suitable for use in a drop-down list. + * @var string A code string that identifies this tax code. */ - public $name; + public $taxCode; /** - * @var string A tag indicating + * @var string The type of this tax code. */ - public $tag; + public $taxCodeTypeId; /** - * @var string A more complete description of this exposure zone, suitable for use as a tooltip or help text. + * @var string A friendly description of this tax code. */ public $description; /** - * @var string The date when this record was created. + * @var string If this tax code is a subset of a different tax code, this identifies the parent code. */ - public $created; + public $parentTaxCode; /** - * @var string The date/time when this record was last modified. + * @var boolean True if this tax code type refers to a physical object. Read only field. */ - public $modified; + public $isPhysical; /** - * @var string Two or three character ISO 3166 region, province, or state name of this exposure zone. + * @var int The Avalara Goods and Service Code represented by this tax code. */ - public $region; + public $goodsServiceCode; /** - * @var string Two character ISO 3166 county code for the country component of this exposure zone. + * @var string The Avalara Entity Use Code represented by this tax code. */ - public $country; - -} - -/** - * An exemption reason defines why a certificate allows a customer to be exempt - * for purposes of tax calculation. For a full list of defined exemption reasons, - * please call the `ListCertificateExemptionReasons` API. - */ -class ExemptionReasonModel -{ + public $entityUseCode; /** - * @var int A unique ID number representing this exemption reason. + * @var boolean True if this tax code is active and can be used in transactions. */ - public $id; + public $isActive; /** - * @var string A friendly name describing this exemption reason. + * @var boolean True if this tax code has been certified by the Streamlined Sales Tax governing board. By default, you should leave this value empty. */ - public $name; + public $isSSTCertified; -} + /** + * @var string The date when this record was created. + */ + public $createdDate; -/** - * Represents a purchase order number for a transaction - */ -class PoNumberModel -{ + /** + * @var int The User ID of the user who created this record. + */ + public $createdUserId; /** - * @var int Unique ID number + * @var string The date/time when this record was last modified. */ - public $id; + public $modifiedDate; /** - * @var string Purchase order number. + * @var int The user ID of the user who last modified this record. */ - public $poNumber; + public $modifiedUserId; } /** - * A certificate attribute can be thought of as a feature or flag that is applied to a certificate. - * A single certificate can be linked to zero, one, or many certificate attributes. The full list of - * attributes can be obtained by calling the `ListCertificateAttributes` API. + * Represents a tax rule that changes the behavior of Avalara's tax engine for certain products and/or entity use codes + * in certain jurisdictions. + * + * Avalara supports a few different types of tax rules. For information about tax rule types, see + * [TaxRuleTypeId](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/TaxRuleTypeId/) + * + * Because different types of tax rules have different behavior, some fields may change their behavior based on + * the type of tax rule selected. Please read the documentation for each field carefully and ensure that + * the value you send is appropriate for the type of tax rule. */ -class CertificateAttributeModel +class TaxRuleModel { /** - * @var int A unique ID number representing this certificate attribute. + * @var int The unique ID number of this tax rule. */ public $id; /** - * @var string A friendly readable name for this certificate attribute. + * @var int The unique ID number of the company that owns this tax rule. */ - public $name; + public $companyId; /** - * @var string A full help text description of the certificate attribute. + * @var int For rules that apply to a specific tax code only, this specifies which tax code is affected by this rule. You can choose to specify a tax code either by passing its unique ID number in the `taxCodeId` field or by passing its alphanumeric code in the `taxCode` field. To search for the appropriate tax code for your custom rule, use the `ListTaxCodes` API. The `RateOverrideRule`, `BaseRule`, and `ExemptEntityRule` rule types can be applied to all tax codes. To make a rule that applies to all tax codes, leave both fields blank. The `ProductTaxabilityRule` rule must be associated with a tax code. If you attempt to create a product taxability rule without a tax code, you will get an error message. */ - public $description; + public $taxCodeId; /** - * @var boolean This value is true if this is a system-defined certificate attribute. System-defined attributes cannot be modified or deleted on the CertCapture website. + * @var string For rules that apply to a specific tax code only, this specifies which tax code is affected by this rule. You can choose to specify a tax code either by passing its unique ID number in the `taxCodeId` field or by passing its alphanumeric code in the `taxCode` field. To search for the appropriate tax code for your custom rule, use the `ListTaxCodes` API. The `RateOverrideRule`, `BaseRule`, and `ExemptEntityRule` rule types can be applied to all tax codes. To make a rule that applies to all tax codes, leave both fields blank. The `ProductTaxabilityRule` rule must be associated with a tax code. If you attempt to create a product taxability rule without a tax code, you will get an error message. */ - public $isSystemCode; - -} + public $taxCode; -/** - * Contains information about a company's exemption certificate status. - * - * This model can be used to determine if your company is able to use the Customers, Certificates, and - * CertExpressInvites APIs within AvaTax. - */ -class ProvisionStatusModel -{ + /** + * @var string For U.S. tax rules, this is the state's Federal Information Processing Standard (FIPS) code. This field is required for rules that apply to specific jurisdictions in the United States. It is not required if you set the `isAllJuris` flag to true. + */ + public $stateFIPS; /** - * @var string The status of exemption certificate setup for this company. If this value is `Finished`, this company will then be able to use the Customers, Certificates, and CertExpressInvites APIs within AvaTax. (See CertCaptureProvisionStatus::* for a list of allowable values) + * @var string The name of the jurisdiction to which this tax rule applies. Custom tax rules can apply to a specific jurisdiction or to all jurisdictions. To select a jurisdiction, use the [ListJurisdictions API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictions/) or the [ListJurisdictionsByAddress API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictionsByAddress/). To set a rule that applies to all jurisdictions of a specific type, see `isAllJuris`. Once you have determined which jurisdiction you wish to assign to the tax rule, you should fill in the `jurisName`, `jurisCode`, and `jurisdictionTypeId` fields using the information you retrieved from the API above. */ - public $status; + public $jurisName; /** - * @var int The accountId of the company represented by this status + * @var string The code of the jurisdiction to which this tax rule applies. Custom tax rules can apply to a specific jurisdiction or to all jurisdictions. To select a jurisdiction, use the [ListJurisdictions API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictions/) or the [ListJurisdictionsByAddress API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictionsByAddress/). Once you have determined which jurisdiction you wish to assign to the tax rule, you should fill in the `jurisName`, `jurisCode`, and `jurisdictionTypeId` fields using the information you retrieved from the API above. */ - public $accountId; + public $jurisCode; /** - * @var int The AvaTax company represented by this status + * @var string (DEPRECATED) Please use `jurisdictionTypeId` instead. (See JurisTypeId::* for a list of allowable values) */ - public $companyId; + public $jurisTypeId; -} + /** + * @var string The type of the jurisdiction to which this tax rule applies. Custom tax rules can apply to a specific jurisdiction or to all jurisdictions. To select a jurisdiction, use the [ListJurisdictions API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictions/) or the [ListJurisdictionsByAddress API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictionsByAddress/). Once you have determined which jurisdiction you wish to assign to the tax rule, you should fill in the `jurisName`, `jurisCode`, and `jurisdictionTypeId` fields using the information you retrieved from the API above. To make a custom tax rule for US or Canada that applies to all jurisdictions of a specific type, see the `isAllJuris` field for more information. (See JurisdictionType::* for a list of allowable values) + */ + public $jurisdictionTypeId; -/** - * Represents a customer to whom you sell products and/or services. - */ -class LinkCustomersModel -{ + /** + * @var string DEPRECATED - Please use `entityUseCode` instead. + */ + public $customerUsageType; /** - * @var string[] An array of customerCodes that are exempted by this certificate + * @var string The entity use code to which this rule applies. You can create custom `entityUseCode` values with specific behavior using this API, or you can change the behavior of Avalara's system-defined entity use codes. For a full list of Avalara-defined entity use codes, see the [ListEntityUseCodes API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListEntityUseCodes/). */ - public $customers; + public $entityUseCode; -} + /** + * @var string Some tax type groups contain multiple different types of tax. To create a rule that affects only one type of tax within a tax type group, set this value to the code matching the specific tax type within that group. The custom tax rule will then only apply to taxes calculated for that specific type. For rules that affect all tax types, use the value `A` to match `All` tax types within that group. (See MatchingTaxType::* for a list of allowable values) + */ + public $taxTypeId; -/** - * A company or business entity. - */ -class CompanyModel -{ + /** + * @var string (DEPRECATED) Please use `rateTypeCode`, `taxTypeGroup` and `subTaxType` instead. (See RateType::* for a list of allowable values) + */ + public $rateTypeId; /** - * @var int The unique ID number of this company. + * @var string Indicates the code of the rate type that applies to this rule. Use [ListRateTypesByCountry](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListRateTypesByCountry/) API for a full list of rate type codes. If you specify a value in the rateTypeCode field, this rule will cause tax lines that are affected by the rule to change to a different rate type code. */ - public $id; + public $rateTypeCode; /** - * @var int The unique ID number of the account this company belongs to. + * @var string This type value determines the behavior of the tax rule. You can specify that this rule controls the product's taxability or exempt / nontaxable status, the product's rate (for example, if you have been granted an official ruling for your product's rate that differs from the official rate), or other types of behavior. (See TaxRuleTypeId::* for a list of allowable values) */ - public $accountId; + public $taxRuleTypeId; /** - * @var int If this company is fully owned by another company, this is the unique identity of the parent company. + * @var boolean Allows you to make tax rules apply to lower jurisdictions. This feature is only available in the United States and Canada. * In the United States, this value can be used for rules written at the `State` jurisdictional level. If set to `true`, this rule will at the state level, county level, city level, and special jurisdiction level. * In Canada, this value can be used for rules written at the `Country` or `State` jurisdictional levels. If set to `true`, this rule will at all lower jurisdictional levels. For any other use case, this value must be `false`. */ - public $parentCompanyId; + public $isAllJuris; /** - * @var string If this company files Streamlined Sales Tax, this is the PID of this company as defined by the Streamlined Sales Tax governing board. + * @var float This field has different behavior based on the type of the tax rule. * For a product taxability rule, this value is either 1 or 0, indicating taxable or non-taxable. * For a rate override rule, this value is the corrected rate stored as a decimal, for example, a rate of 5% would be stored as 0.05 decimal. If you use the special value of 1.0, only the cap and threshold values will be applied and the rate will be left alone. */ - public $sstPid; + public $value; /** - * @var string A unique code that references this company within your account. + * @var float The maximum cap for the price of this item according to this rule. Any amount above this cap will not be subject to this rule. For example, if you must pay 5% of a product's value up to a maximum value of $1000, you would set the `cap` to `1000.00` and the `value` to `0.05`. */ - public $companyCode; + public $cap; /** - * @var string The name of this company, as shown to customers. + * @var float The per-unit threshold that must be met before this rule applies. For example, if your product is nontaxable unless it is above $100 per product, you would set the `threshold` value to `100`. In this case, the rate for the rule would apply to the entire amount above $100. You can also create rules that make the entire product taxable if it exceeds a threshold, but is nontaxable if it is below the threshold. To choose this, set the `options` field to the value `TaxAll`. */ - public $name; + public $threshold; /** - * @var boolean This flag is true if this company is the default company for this account. Only one company may be set as the default. + * @var string Supports custom options for your tax rule. Supported options include: * `TaxAll` - This value indicates that the entire amount of the line becomes taxable when the line amount exceeds the `threshold`. */ - public $isDefault; + public $options; /** - * @var int If set, this is the unique ID number of the default location for this company. + * @var string The first date at which this rule applies. If `null`, this rule will apply to all dates prior to the end date. */ - public $defaultLocationId; + public $effectiveDate; /** - * @var boolean This flag indicates whether tax activity can occur for this company. Set this flag to true to permit the company to process transactions. + * @var string The last date for which this rule applies. If `null`, this rule will apply to all dates after the effective date. */ - public $isActive; + public $endDate; /** - * @var string For United States companies, this field contains your Taxpayer Identification Number. This is a nine digit number that is usually called an EIN for an Employer Identification Number if this company is a corporation, or SSN for a Social Security Number if this company is a person. This value is required if you subscribe to Avalara Managed Returns or the SST Certified Service Provider services, but it is optional if you do not subscribe to either of those services. + * @var string A friendly name for this tax rule. */ - public $taxpayerIdNumber; + public $description; /** - * @var boolean Set this flag to true to give this company its own unique tax profile. If this flag is true, this company will have its own Nexus, TaxRule, TaxCode, and Item definitions. If this flag is false, this company will inherit all profile values from its parent. + * @var string For U.S. tax rules, this is the county's Federal Information Processing Standard (FIPS) code. This field is required for rules that apply to specific jurisdictions in the United States. It is not required if you set the `isAllJuris` flag to true. */ - public $hasProfile; + public $countyFIPS; /** - * @var boolean Set this flag to true if this company must file its own tax returns. For users who have Returns enabled, this flag turns on monthly Worksheet generation for the company. + * @var boolean (DEPRECATED) This field is no longer required. */ - public $isReportingEntity; + public $isSTPro; /** - * @var string If this company participates in Streamlined Sales Tax, this is the date when the company joined the SST program. + * @var string Name or ISO 3166 code identifying the country where this rule will apply. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. */ - public $sstEffectiveDate; + public $country; /** - * @var string The two character ISO-3166 country code of the default country for this company. + * @var string Name or ISO 3166 code identifying the region where this rule will apply. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. NOTE: Region is required for US and not required for non-US countries because the user may be either creating a Country-level or Region-level rule. */ - public $defaultCountry; + public $region; /** - * @var string This is the three character ISO-4217 currency code of the default currency used by this company. + * @var string The sourcing types to which this rule applies. (See Sourcing::* for a list of allowable values) */ - public $baseCurrencyCode; + public $sourcing; /** - * @var string Indicates whether this company prefers to round amounts at the document level or line level. (See RoundingLevelId::* for a list of allowable values) + * @var string This field has different behavior based on the type of rule. * For a product taxability rule, if the rule applies to an item, this value will override the tax type group of the original product. * For other rules, this value determines what tax type groups will be affected by the rule. Refer to `ListTaxTypeGroups` for a list of tax type groups supported by AvaTax. */ - public $roundingLevelId; + public $taxTypeGroup; /** - * @var boolean Set this value to true to receive warnings in API calls via SOAP. + * @var string This field has different behavior based on the type of rule. * For a product taxability rule, if the rule applies to an item, this value will override the tax sub type of the original product. * For other rules, this value determines what tax sub types will be affected by the rule. Refer to `ListTaxSubtypes` for a list of tax sub types supported by AvaTax. */ - public $warningsEnabled; + public $taxSubType; /** - * @var boolean Set this flag to true to indicate that this company is a test company. If you have Returns enabled, Test companies will not file tax returns and can be used for validation purposes. + * @var string Reserved for Avalara internal usage. Leave this field null. */ - public $isTest; + public $nonPassthroughExpression; /** - * @var string Used to apply tax detail dependency at a jurisdiction level. (See TaxDependencyLevelId::* for a list of allowable values) + * @var string The currency code to use for this rule. For a list of currencies supported by AvaTax, use the [ListCurrencies API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListCurrencies/). */ - public $taxDependencyLevelId; + public $currencyCode; /** - * @var boolean Set this value to true to indicate that you are still working to finish configuring this company. While this value is true, no tax reporting will occur and the company will not be usable for transactions. + * @var int Reserved for Avalara internal usage. Leave this field null. */ - public $inProgress; + public $preferredProgramId; /** - * @var string Business Identification No + * @var int 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, use the [ListUnitsOfMeasurement API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListUnitOfMeasurement/). */ - public $businessIdentificationNo; + public $uomId; /** * @var string The date when this record was created. @@ -2243,121 +2284,124 @@ class CompanyModel */ public $modifiedUserId; - /** - * @var ContactModel[] Optional: A list of contacts defined for this company. To fetch this list, add the query string `?$include=Contacts` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. - */ - public $contacts; +} + +/** + * One Universal Product Code object as defined for your company. + */ +class UPCModel +{ /** - * @var ItemModel[] Optional: A list of items defined for this company. To fetch this list, add the query string `?$include=Items` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var int The unique ID number for this UPC. */ - public $items; + public $id; /** - * @var LocationModel[] Optional: A list of locations defined for this company. To fetch this list, add the query string `?$include=Locations` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var int The unique ID number of the company to which this UPC belongs. */ - public $locations; + public $companyId; /** - * @var NexusModel[] Optional: A list of nexus defined for this company. To fetch this list, add the query string `?$include=Nexus` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var string The 12-14 character Universal Product Code, European Article Number, or Global Trade Identification Number. */ - public $nexus; + public $upc; /** - * @var SettingModel[] Optional: A list of settings defined for this company. To fetch this list, add the query string `?$include=Settings` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var string Legacy Tax Code applied to any product sold with this UPC. */ - public $settings; + public $legacyTaxCode; /** - * @var TaxCodeModel[] Optional: A list of tax codes defined for this company. To fetch this list, add the query string `?$include=TaxCodes` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var string Description of the product to which this UPC applies. */ - public $taxCodes; + public $description; /** - * @var TaxRuleModel[] Optional: A list of tax rules defined for this company. To fetch this list, add the query string `?$include=TaxRules` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var string If this UPC became effective on a certain date, this contains the first date on which the UPC was effective. */ - public $taxRules; + public $effectiveDate; /** - * @var UPCModel[] Optional: A list of UPCs defined for this company. To fetch this list, add the query string `?$include=UPCs` to your URL. When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company. The `UpdateCompany` API does not permit updating nested objects. + * @var string If this UPC expired or will expire on a certain date, this contains the last date on which the UPC was effective. */ - public $upcs; + public $endDate; /** - * @var EcmsModel[] DEPRECATED - Please use the `ListCertificates` API. + * @var int A usage identifier for this UPC code. */ - public $exemptCerts; + public $usage; /** - * @var string The unique identifier of the mini-one-stop-shop used for Value Added Tax (VAT) processing. + * @var int A flag indicating whether this UPC code is attached to the AvaTax system or to a company. */ - public $mossId; + public $isSystem; /** - * @var string The country code of the mini-one-stop-shop used for Value Added Tax (VAT) processing. + * @var string The date when this record was created. */ - public $mossCountry; - -} - -/** - * A contact person for a company. - */ -class ContactModel -{ + public $createdDate; /** - * @var int The unique ID number of this contact. + * @var int The User ID of the user who created this record. */ - public $id; + public $createdUserId; /** - * @var int The unique ID number of the company to which this contact belongs. + * @var string The date/time when this record was last modified. */ - public $companyId; + public $modifiedDate; /** - * @var string A unique code for this contact. + * @var int The user ID of the user who last modified this record. */ - public $contactCode; + public $modifiedUserId; + +} + +/** + * Exempt certificate + */ +class EcmsModel +{ /** - * @var string The first or given name of this contact. + * @var int The calc_id associated with a certificate in CertCapture. */ - public $firstName; + public $exemptCertId; /** - * @var string The middle name of this contact. + * @var int Company ID */ - public $middleName; + public $companyId; /** - * @var string The last or family name of this contact. + * @var string Customer code */ - public $lastName; + public $customerCode; /** - * @var string Professional title of this contact. + * @var string Customer name */ - public $title; + public $customerName; /** - * @var string The first line of the postal mailing address of this contact. + * @var string Address line 1 */ - public $line1; + public $address1; /** - * @var string The second line of the postal mailing address of this contact. + * @var string Address line 2 */ - public $line2; + public $address2; /** - * @var string The third line of the postal mailing address of this contact. + * @var string Address line 3 */ - public $line3; + public $address3; /** - * @var string The city of the postal mailing address of this contact. + * @var string City */ public $city; @@ -2367,7 +2411,7 @@ class ContactModel public $region; /** - * @var string The postal code or zip code of the postal mailing address of this contact. + * @var string Postal code / zip code */ public $postalCode; @@ -2377,521 +2421,522 @@ class ContactModel public $country; /** - * @var string The email address of this contact. - */ - public $email; - - /** - * @var string The main phone number for this contact. - */ - public $phone; - - /** - * @var string The mobile phone number for this contact. + * @var string The type of exemption certificate. Permitted values are: Blanket and Single. (See ExemptCertTypeId::* for a list of allowable values) */ - public $mobile; + public $exemptCertTypeId; /** - * @var string The facsimile phone number for this contact. + * @var string Document Reference Number, in the case of single-use exemption certificates, the DocumentCode or PurchaseOrderNo to which the certificate should apply. */ - public $fax; + public $documentRefNo; /** - * @var string The date when this record was created. + * @var int Business type the customer belongs to. */ - public $createdDate; + public $businessTypeId; /** - * @var int The User ID of the user who created this record. + * @var string Other description for this business type */ - public $createdUserId; + public $businessTypeOtherDescription; /** - * @var string The date/time when this record was last modified. + * @var string Exempt reason associated with the certificate, coded by CustomerUsageType. Example: A - Federal Government. */ - public $modifiedDate; + public $exemptReasonId; /** - * @var int The user ID of the user who last modified this record. + * @var string Other description for exempt reason i.e. Populated on if exemptReasonId is 'L' - Other. */ - public $modifiedUserId; - -} - -/** - * Represents an item in your company's product catalog. - */ -class ItemModel -{ + public $exemptReasonOtherDescription; /** - * @var int The unique ID number of this item. + * @var string Effective date for this exempt certificate */ - public $id; + public $effectiveDate; /** - * @var int The unique ID number of the company that owns this item. + * @var string A list of applicable regions for this exempt certificate. To list more than one applicable region, separate the list of region codes with commas. */ - public $companyId; + public $regionsApplicable; /** - * @var string A unique code representing this item. + * @var string Status for this exempt certificate (See ExemptCertStatusId::* for a list of allowable values) */ - public $itemCode; + public $exemptCertStatusId; /** - * @var int DEPRECATED - For identifying an `Item` with `Avalara TaxCode`, please call the [CreateItemClassification API] with your ItemCode and the Avalara TaxCode. The unique ID number of the tax code that is applied when selling this item. When creating or updating an item, you can either specify the Tax Code ID number or the Tax Code string; you do not need to specify both values. + * @var string Date when this exempt certificate was created */ - public $taxCodeId; + public $createdDate; /** - * @var string DEPRECATED - For identifying an `Item` with `Avalara TaxCode`, please call the [CreateItemClassification API] with your ItemCode and the Avalara TaxCode. The unique code string of the Tax Code that is applied when selling this item. When creating or updating an item, you can either specify the Tax Code ID number or the Tax Code string; you do not need to specify both values. + * @var string Date when last transaction with this exempt certificate happened */ - public $taxCode; + public $lastTransactionDate; /** - * @var string A friendly description of this item in your product catalog. + * @var string When this exempt certificate will expire */ - public $description; + public $expiryDate; /** - * @var string A way to group similar items. + * @var int User that creates the certificate */ - public $itemGroup; + public $createdUserId; /** - * @var string The date when this record was created. + * @var string Date when this exempt certificate was modified */ - public $createdDate; + public $modifiedDate; /** - * @var int The User ID of the user who created this record. + * @var int Who modified this exempt certificate */ - public $createdUserId; + public $modifiedUserId; /** - * @var string The date/time when this record was last modified. + * @var string Name or ISO 3166 code identifying the country that issued this ECMS certificate. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. */ - public $modifiedDate; + public $countryIssued; /** - * @var int The user ID of the user who last modified this record. + * @var string If the certificate record was synced from an AvaTax Certs account(as opposed to being entered in ECMS directly), the unique AvaTax Certs identifier for the certificate record. Usually same as the Id of a Certificate. */ - public $modifiedUserId; + public $avaCertId; /** - * @var ClassificationModel[] List of classifications that belong to this item. A single classification consits of a productCode and a systemCode for a particular item. + * @var string Review status for this exempt certificate (See ExemptCertReviewStatusId::* for a list of allowable values) */ - public $classifications; + public $exemptCertReviewStatusId; /** - * @var ItemParameterModel[] List of item parameters. + * @var EcmsDetailModel[] Exempt Cert details */ - public $parameters; + public $details; } /** - * A location where this company does business. - * Some jurisdictions may require you to list all locations where your company does business. + * Represents a classification for a given item. */ -class LocationModel +class ClassificationModel { /** - * @var int The unique ID number of this location. + * @var string The product code of an item in a given system. */ - public $id; + public $productCode; /** - * @var int The unique ID number of the company that operates at this location. + * @var string The system code in which the product belongs. */ - public $companyId; + public $systemCode; - /** - * @var string A code that identifies this location. Must be unique within your company. - */ - public $locationCode; +} + +/** + * Represents a parameter associated with an item. + */ +class ItemParameterModel +{ /** - * @var string A friendly name for this location. + * @var int The id of the parameter. */ - public $description; + public $id; /** - * @var string Indicates whether this location is a physical place of business or a temporary salesperson location. (See AddressTypeId::* for a list of allowable values) + * @var string The parameter's name. */ - public $addressTypeId; + public $name; /** - * @var string Indicates the type of place of business represented by this location. (See AddressCategoryId::* for a list of allowable values) + * @var string The value for the parameter. */ - public $addressCategoryId; + public $value; /** - * @var string The first line of the physical address of this location. + * @var string The unit of measurement code for the parameter. */ - public $line1; + public $unit; /** - * @var string The second line of the physical address of this location. + * @var int The item id */ - public $line2; + public $itemId; - /** - * @var string The third line of the physical address of this location. - */ - public $line3; +} - /** - * @var string The city of the physical address of this location. - */ - public $city; +/** + * Represents the answer to one local jurisdiction question for a location. + */ +class LocationSettingModel +{ /** - * @var string The county name of the physical address of this location. Not required. + * @var int The unique ID number of the location question answered. */ - public $county; + public $questionId; /** - * @var string Name or ISO 3166 code identifying the region within the country of the physical address of this location. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. + * @var string The name of the question */ - public $region; + public $questionName; /** - * @var string The postal code or zip code of the physical address of this location. + * @var string The answer the user provided. */ - public $postalCode; + public $value; + +} + +/** + * Represents an ECMS record, used internally by AvaTax to track information about exemptions. + */ +class EcmsDetailModel +{ /** - * @var string Name or ISO 3166 code identifying the country of the physical address of this location. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + * @var int Unique, system-assigned identifier of a ExemptCertDetail record. */ - public $country; + public $exemptCertDetailId; /** - * @var boolean Set this flag to true to indicate that this is the default location for this company. + * @var int The calc_id associated with a certificate in CertCapture. */ - public $isDefault; + public $exemptCertId; /** - * @var boolean Set this flag to true to indicate that this location has been registered with a tax authority. + * @var string State FIPS */ - public $isRegistered; + public $stateFips; /** - * @var string If this location has a different business name from its legal entity name, specify the "Doing Business As" name for this location. + * @var string Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. */ - public $dbaName; + public $region; /** - * @var string A friendly name for this location. + * @var string The customer Tax Id Number (tax_number) associated with a certificate. This is same as exemptionNo in Transactions. */ - public $outletName; + public $idNo; /** - * @var string The date when this location was opened for business, or null if not known. + * @var string Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. */ - public $effectiveDate; + public $country; /** - * @var string If this place of business has closed, the date when this location closed business. + * @var string End date of this exempt certificate */ public $endDate; /** - * @var string The most recent date when a transaction was processed for this location. Set by AvaTax. + * @var string The type of idNo (tax_number) associated with a certificate. Example: Driver's Licence Number, Permit Number. */ - public $lastTransactionDate; + public $idType; /** - * @var string The date when this location was registered with a tax authority. Not required. + * @var int Is the tax code list an exculsion list? */ - public $registeredDate; + public $isTaxCodeListExclusionList; /** - * @var string The date when this record was created. + * @var EcmsDetailTaxCodeModel[] optional: list of tax code associated with this exempt certificate detail */ - public $createdDate; + public $taxCodes; - /** - * @var int The User ID of the user who created this record. - */ - public $createdUserId; +} + +/** + * + */ +class EcmsDetailTaxCodeModel +{ /** - * @var string The date/time when this record was last modified. + * @var int Id of the exempt certificate detail tax code */ - public $modifiedDate; + public $exemptCertDetailTaxCodeId; /** - * @var int The user ID of the user who last modified this record. + * @var int exempt certificate detail id */ - public $modifiedUserId; + public $exemptCertDetailId; /** - * @var LocationSettingModel[] Extra information required by certain jurisdictions for filing. For a list of settings recognized by Avalara, query the endpoint "/api/v2/definitions/locationquestions". To determine the list of settings required for this location, query the endpoint "/api/v2/companies/(id)/locations/(id)/validate". + * @var int tax code id */ - public $settings; + public $taxCodeId; } /** - * Represents a declaration of nexus within a particular taxing jurisdiction. - * - * To create a nexus declaration for your company, you must first call the Definitions API `ListNexus` to obtain a - * list of Avalara-defined nexus. Once you have determined which nexus you wish to declare, you should customize - * only the user-selectable fields in this object. - * - * The user selectable fields for the nexus object are `companyId`, `effectiveDate`, `endDate`, `localNexusTypeId`, - * `taxId`, `nexusTypeId`, `hasPermanentEstablishment`, and `isSellerImporterOfRecord`. - * - * When calling `CreateNexus` or `UpdateNexus`, all values in your nexus object except for the user-selectable fields - * must match an Avalara-defined system nexus object. You can retrieve a list of Avalara-defined system nexus objects - * by calling `ListNexus`. If any data does not match, AvaTax may not recognize your nexus declaration. + * Model for changing the approved status of an advanced rule */ -class NexusModel +class ApproveAdvancedRuleModel { /** - * @var int The unique ID number of this declaration of nexus. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + * @var boolean Should the rule be approved */ - public $id; + public $isApproved; - /** - * @var int The unique ID number of the company that declared nexus. This field is user-selectable and should be provided when creating or updating a nexus object. - */ - public $companyId; +} - /** - * @var string Name or ISO 3166 code identifying the country in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. - */ - public $country; +/** + * Model representing an execution of an advanced rule for a company + */ +class AdvancedRuleExecutionModel +{ /** - * @var string Name or ISO 3166 code identifying the region within the country. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string Rule execution unique identifier */ - public $region; + public $ruleExecutionId; /** - * @var string (DEPRECATED) The jurisdiction type of the jurisdiction in which this company declared nexus. NOTE: Use jurisdictionTypeId instead. (See JurisTypeId::* for a list of allowable values) + * @var string Name of rule execution */ - public $jurisTypeId; + public $name; /** - * @var string The type of the jurisdiction in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. (See JurisdictionType::* for a list of allowable values) + * @var string Date rule execution starts */ - public $jurisdictionTypeId; + public $startDate; /** - * @var string The code identifying the jurisdiction in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string Date rule execution ends */ - public $jurisCode; + public $endDate; /** - * @var string The common name of the jurisdiction in which this company declared nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var boolean Is rule execution enabled */ - public $jurisName; + public $enabled; /** - * @var string The date when this nexus began. If not known, set to null. This field is user-selectable and should be provided when creating or updating a nexus object. + * @var string Unique identifier of rule to execute */ - public $effectiveDate; + public $ruleId; /** - * @var string If this nexus will end or has ended on a specific date, set this to the date when this nexus ends. This field is user-selectable and should be provided when creating or updating a nexus object. + * @var AdvancedRuleModel Advanced rule to execute */ - public $endDate; + public $rule; /** - * @var string The short name of the jurisdiction. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string Json data used for rule execution */ - public $shortName; + public $customerData; /** - * @var string The signature code of the boundary region as defined by Avalara. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string Unique identifier of customer data used in rule execution */ - public $signatureCode; + public $customerDataId; + +} + +/** + * A generic global advanced rule encapsulating a script + */ +class AdvancedRuleModel +{ /** - * @var string The state assigned number of this jurisdiction. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string Unique identifier for a rule */ - public $stateAssignedNo; + public $ruleId; /** - * @var string The type of nexus that this company is declaring. If you are voluntarily declaring nexus in a jurisdiction, you should select `SalesOrSellersUseTax` for your nexus type option. This option allows you to calculate tax correctly whether you are selling in-state or shipping from an out-of-state location. If you are legally obligated to declare nexus due to physical presence or other sufficient nexus, you should select `SalesTax`. This indicates that, as a legal requirement, your company must always collect and remit full sales tax in this jurisdiction. If you are participating in the Streamlined Sales Tax program, your SST administrator will select nexus settings for you in all SST jurisdictions. Do not select any SST options by yourself. This field is user-selectable and should be provided when creating or updating a nexus object. (See NexusTypeId::* for a list of allowable values) + * @var string Rule name */ - public $nexusTypeId; + public $name; /** - * @var string Indicates whether this nexus is defined as origin or destination nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. (See Sourcing::* for a list of allowable values) + * @var string Description of the rule */ - public $sourcing; + public $description; + +} + +/** + * Model for updating rule execution order + */ +class AdvancedRuleExecutionOrderModel +{ /** - * @var boolean True if you are also declaring local nexus within this jurisdiction. Many U.S. states have options for declaring nexus in local jurisdictions as well as within the state. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string[] The rule execution Ids in the desired order */ - public $hasLocalNexus; + public $ruleExecutionIds; + +} + +/** + * Represents information about a tax form known to Avalara + */ +class AvaFileFormModel +{ /** - * @var string If you are declaring local nexus within this jurisdiction, this indicates whether you are declaring only a specified list of local jurisdictions, all state-administered local jurisdictions, or all local jurisdictions. This field is user-selectable and should be provided when creating or updating a nexus object. (See LocalNexusTypeId::* for a list of allowable values) + * @var int Unique Id of the form */ - public $localNexusTypeId; + public $id; /** - * @var boolean Set this value to true if your company has a permanent establishment within this jurisdiction. This field is user-selectable and should be provided when creating or updating a nexus object. + * @var string Name of the file being returned */ - public $hasPermanentEstablishment; + public $returnName; /** - * @var string Optional - the tax identification number under which you declared nexus. This field is user-selectable and should be provided when creating or updating a nexus object. + * @var string Name of the submitted form */ - public $taxId; + public $formName; /** - * @var boolean For the United States, this flag indicates whether this particular nexus falls within a U.S. State that participates in the Streamlined Sales Tax program. For countries other than the US, this flag is null. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string A description of the submitted form */ - public $streamlinedSalesTax; + public $description; /** - * @var string The date when this record was created. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + * @var string The date this form starts to take effect */ - public $createdDate; + public $effDate; /** - * @var int The User ID of the user who created this record. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + * @var string The date the form finishes to take effect */ - public $createdUserId; + public $endDate; /** - * @var string The date/time when this record was last modified. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + * @var string State/Province/Region where the form is submitted for */ - public $modifiedDate; + public $region; /** - * @var int The user ID of the user who last modified this record. This field is defined automatically when you declare nexus. You do not need to provide a value for this field. + * @var string The country this form is submitted for */ - public $modifiedUserId; + public $country; /** - * @var string The type of nexus that this company is declaring.Replaces NexusTypeId. Use [ListNexusTaxTypeGroups](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListNexusTaxTypeGroups/) API for a list of nexus tax type groups. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string The type of the form being submitted (See FormTypeId::* for a list of allowable values) */ - public $nexusTaxTypeGroup; + public $formTypeId; /** - * @var int A unique ID number of the tax authority that is associated with this nexus. This field is defined by Avalara. All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. + * @var string The type of Filing option (See FilingOptionTypeId::* for a list of allowable values) */ - public $taxAuthorityId; + public $filingOptionTypeId; /** - * @var boolean 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. This field is user-selectable and should be provided when creating or updating a nexus object. + * @var string The type of the due date (See DueDateTypeId::* for a list of allowable values) */ - public $isSellerImporterOfRecord; - -} + public $dueDateTypeId; -/** - * This object is used to keep track of custom information about a company. - * - * The company settings system is a metadata system that you can use to store extra information - * about a company. Your integration or connector could use this data storage to keep track of - * preference information, reminders, or any other storage that would need to persist even if - * the customer uninstalls your application. - * - * A setting can refer to any type of data you need to remember about this company object. - * When creating this object, you may define your own `set`, `name`, and `value` parameters. - * To define your own values, please choose a `set` name that begins with `X-` to indicate an extension. - */ -class SettingModel -{ + /** + * @var int Due date + */ + public $dueDay; /** - * @var int The unique ID number of this setting. + * @var string The type of E-file due date. (See DueDateTypeId::* for a list of allowable values) */ - public $id; + public $efileDueDateTypeId; /** - * @var int The unique ID number of the company this setting refers to. + * @var int The date by when the E-filing should be submitted */ - public $companyId; + public $efileDueDay; /** - * @var string A user-defined "set" containing this setting. Avalara defines some sets that cannot be changed. To create your own set, choose a set name that begins with `X-` to indicate that this is an extension value. We recommend that you choose a set name that clearly identifies your application, and then store data within name/value pairs within that set. For example, if you were creating an application called MyApp, you might choose to create a set named `X-MyCompany-MyApp`. + * @var string The time of day by when the E-filing should be submitted */ - public $set; + public $efileDueTime; /** - * @var string A user-defined "name" for this name-value pair. + * @var boolean Whether the customer has discount */ - public $name; + public $hasVendorDiscount; /** - * @var string The value of this name-value pair. + * @var string The way system does the rounding (See RoundingTypeId::* for a list of allowable values) */ - public $value; + public $roundingTypeId; + + /** + * @var string The outlet type of the form (See OutletTypeId::* for a list of allowable values) + */ + public $outletTypeId; } /** - * Represents a tax code that can be applied to items on a transaction. - * A tax code can have specific rules for specific jurisdictions that change the tax calculation behavior. + * Represents a batch of uploaded documents. */ -class TaxCodeModel +class BatchModel { /** - * @var int The unique ID number of this tax code. + * @var int The unique ID number of this batch. */ public $id; /** - * @var int The unique ID number of the company that owns this tax code. + * @var string The user-friendly readable name for this batch. */ - public $companyId; + public $name; /** - * @var string A code string that identifies this tax code. + * @var int The Account ID number of the account that owns this batch. */ - public $taxCode; + public $accountId; /** - * @var string The type of this tax code. + * @var int The Company ID number of the company that owns this batch. */ - public $taxCodeTypeId; + public $companyId; /** - * @var string A friendly description of this tax code. + * @var string The type of this batch. (See BatchType::* for a list of allowable values) */ - public $description; + public $type; /** - * @var string If this tax code is a subset of a different tax code, this identifies the parent code. + * @var string This batch's current processing status (See BatchStatus::* for a list of allowable values) */ - public $parentTaxCode; + public $status; /** - * @var boolean True if this tax code type refers to a physical object. Read only field. + * @var string Any optional flags provided for this batch */ - public $isPhysical; + public $options; /** - * @var int The Avalara Goods and Service Code represented by this tax code. + * @var string The agent used to create this batch */ - public $goodsServiceCode; + public $batchAgent; /** - * @var string The Avalara Entity Use Code represented by this tax code. + * @var string The date/time when this batch started processing */ - public $entityUseCode; + public $startedDate; /** - * @var boolean True if this tax code is active and can be used in transactions. + * @var int The number of records in this batch; determined by the server */ - public $isActive; + public $recordCount; /** - * @var boolean True if this tax code has been certified by the Streamlined Sales Tax governing board. By default, you should leave this value empty. + * @var int The current record being processed */ - public $isSSTCertified; + public $currentRecord; + + /** + * @var string The date/time when this batch was completely processed + */ + public $completedDate; /** * @var string The date when this record was created. @@ -2913,597 +2958,704 @@ class TaxCodeModel */ public $modifiedUserId; + /** + * @var BatchFileModel[] The list of files contained in this batch. + */ + public $files; + } /** - * Represents a tax rule that changes the behavior of Avalara's tax engine for certain products and/or entity use codes - * in certain jurisdictions. - * - * Avalara supports a few different types of tax rules. For information about tax rule types, see - * [TaxRuleTypeId](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/TaxRuleTypeId/) - * - * Because different types of tax rules have different behavior, some fields may change their behavior based on - * the type of tax rule selected. Please read the documentation for each field carefully and ensure that - * the value you send is appropriate for the type of tax rule. + * Represents one file in a batch upload. */ -class TaxRuleModel +class BatchFileModel { /** - * @var int The unique ID number of this tax rule. + * @var int The unique ID number assigned to this batch file. */ public $id; /** - * @var int The unique ID number of the company that owns this tax rule. + * @var int The unique ID number of the batch that this file belongs to. */ - public $companyId; + public $batchId; /** - * @var int For rules that apply to a specific tax code only, this specifies which tax code is affected by this rule. You can choose to specify a tax code either by passing its unique ID number in the `taxCodeId` field or by passing its alphanumeric code in the `taxCode` field. To search for the appropriate tax code for your custom rule, use the `ListTaxCodes` API. The `RateOverrideRule`, `BaseRule`, and `ExemptEntityRule` rule types can be applied to all tax codes. To make a rule that applies to all tax codes, leave both fields blank. The `ProductTaxabilityRule` rule must be associated with a tax code. If you attempt to create a product taxability rule without a tax code, you will get an error message. + * @var string Logical Name of file (e.g. "Input" or "Error"). */ - public $taxCodeId; + public $name; /** - * @var string For rules that apply to a specific tax code only, this specifies which tax code is affected by this rule. You can choose to specify a tax code either by passing its unique ID number in the `taxCodeId` field or by passing its alphanumeric code in the `taxCode` field. To search for the appropriate tax code for your custom rule, use the `ListTaxCodes` API. The `RateOverrideRule`, `BaseRule`, and `ExemptEntityRule` rule types can be applied to all tax codes. To make a rule that applies to all tax codes, leave both fields blank. The `ProductTaxabilityRule` rule must be associated with a tax code. If you attempt to create a product taxability rule without a tax code, you will get an error message. + * @var string Content of the batch file. (This value is encoded as a Base64 string) */ - public $taxCode; + public $content; /** - * @var string For U.S. tax rules, this is the state's Federal Information Processing Standard (FIPS) code. This field is required for rules that apply to specific jurisdictions in the United States. It is not required if you set the `isAllJuris` flag to true. + * @var int Size of content, in bytes. */ - public $stateFIPS; + public $contentLength; /** - * @var string The name of the jurisdiction to which this tax rule applies. Custom tax rules can apply to a specific jurisdiction or to all jurisdictions. To select a jurisdiction, use the [ListJurisdictions API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictions/) or the [ListJurisdictionsByAddress API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictionsByAddress/). To set a rule that applies to all jurisdictions of a specific type, see `isAllJuris`. Once you have determined which jurisdiction you wish to assign to the tax rule, you should fill in the `jurisName`, `jurisCode`, and `jurisdictionTypeId` fields using the information you retrieved from the API above. + * @var string Content mime type (e.g. text/csv). This is used for HTTP downloading. */ - public $jurisName; + public $contentType; /** - * @var string The code of the jurisdiction to which this tax rule applies. Custom tax rules can apply to a specific jurisdiction or to all jurisdictions. To select a jurisdiction, use the [ListJurisdictions API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictions/) or the [ListJurisdictionsByAddress API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictionsByAddress/). Once you have determined which jurisdiction you wish to assign to the tax rule, you should fill in the `jurisName`, `jurisCode`, and `jurisdictionTypeId` fields using the information you retrieved from the API above. + * @var string File extension (e.g. CSV). */ - public $jurisCode; + public $fileExtension; /** - * @var string (DEPRECATED) Please use `jurisdictionTypeId` instead. (See JurisTypeId::* for a list of allowable values) + * @var string Path to the file - name/S3 key */ - public $jurisTypeId; + public $filePath; /** - * @var string The type of the jurisdiction to which this tax rule applies. Custom tax rules can apply to a specific jurisdiction or to all jurisdictions. To select a jurisdiction, use the [ListJurisdictions API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictions/) or the [ListJurisdictionsByAddress API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListJurisdictionsByAddress/). Once you have determined which jurisdiction you wish to assign to the tax rule, you should fill in the `jurisName`, `jurisCode`, and `jurisdictionTypeId` fields using the information you retrieved from the API above. To make a custom tax rule for US or Canada that applies to all jurisdictions of a specific type, see the `isAllJuris` field for more information. (See JurisdictionType::* for a list of allowable values) + * @var int Number of errors that occurred when processing this file. */ - public $jurisdictionTypeId; + public $errorCount; + +} + +/** + * Represents an invitation for a customer to use CertExpress to self-report their own certificates. + * This invitation is delivered by your choice of method, or you can present a hyperlink to the user + * directly in your connector. Your customer will be redirected to https://app.certexpress.com/ where + * they can follow a step-by-step guide to enter information about their exemption certificates. The + * certificates entered will be recorded and automatically linked to their customer record. + */ +class CreateCertExpressInvitationModel +{ /** - * @var string DEPRECATED - Please use `entityUseCode` instead. + * @var string If the value of `deliveryMethod` is set to `Email`, please specify the email address of the recipient for the request. */ - public $customerUsageType; + public $recipient; /** - * @var string The entity use code to which this rule applies. You can create custom `entityUseCode` values with specific behavior using this API, or you can change the behavior of Avalara's system-defined entity use codes. For a full list of Avalara-defined entity use codes, see the [ListEntityUseCodes API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListEntityUseCodes/). + * @var string If this invitation is sent via email or download, please specify the cover letter to use when building this invitation. For a list of cover letters, please call `ListCoverLetters`. */ - public $entityUseCode; + public $coverLetterTitle; /** - * @var string Some tax type groups contain multiple different types of tax. To create a rule that affects only one type of tax within a tax type group, set this value to the code matching the specific tax type within that group. The custom tax rule will then only apply to taxes calculated for that specific type. For rules that affect all tax types, use the value `A` to match `All` tax types within that group. (See MatchingTaxType::* for a list of allowable values) + * @var int[] You may optionally specify a list of exposure zones to request in this CertExpress invitation. If you list more than one exposure zone, the customer will be prompted to provide an exemption certificate for each one. If you do not provide a list of exposure zones, the customer will be prompted to select an exposure zone. For a list of available exposure zones, please call `ListCertificateExposureZones`. */ - public $taxTypeId; + public $exposureZones; /** - * @var string (DEPRECATED) Please use `rateTypeCode`, `taxTypeGroup` and `subTaxType` instead. (See RateType::* for a list of allowable values) + * @var int[] You may optionally specify a list of exemption reasons to pre-populate in this CertExpress invitation. If you list exemption reasons, the customer will have part of their form already filled in when they visit the CertExpress website. For a list of available exemption reasons, please call `ListCertificateExemptReasons`. */ - public $rateTypeId; + public $exemptReasons; /** - * @var string Indicates the code of the rate type that applies to this rule. Use [ListRateTypesByCountry](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListRateTypesByCountry/) API for a full list of rate type codes. If you specify a value in the rateTypeCode field, this rule will cause tax lines that are affected by the rule to change to a different rate type code. + * @var string Specify the type of invitation. CertExpress invitations can be delivered via email, web link, or facsimile. * If you specify `Email`, the invitation will be delivered via email. Please ask the customer to ensure that * If you specify `Fax`, the invitation will be sent via fax to the customer's fax number on file. * If you specify `Download`, the invitation will be prepared as a web link that you can display to the customer. (See CertificateRequestDeliveryMethod::* for a list of allowable values) */ - public $rateTypeCode; + public $deliveryMethod; + +} + +/** + * Represent what is the current status of certificate request + */ +class CertExpressInvitationStatusModel +{ /** - * @var string This type value determines the behavior of the tax rule. You can specify that this rule controls the product's taxability or exempt / nontaxable status, the product's rate (for example, if you have been granted an official ruling for your product's rate that differs from the official rate), or other types of behavior. (See TaxRuleTypeId::* for a list of allowable values) + * @var string The status of the CertExpress invitation for this customer. If this status says (See CertExpressInvitationStatus::* for a list of allowable values) */ - public $taxRuleTypeId; + public $status; /** - * @var boolean Allows you to make tax rules apply to lower jurisdictions. This feature is only available in the United States and Canada. * In the United States, this value can be used for rules written at the `State` jurisdictional level. If set to `true`, this rule will at the state level, county level, city level, and special jurisdiction level. * In Canada, this value can be used for rules written at the `Country` or `State` jurisdictional levels. If set to `true`, this rule will at all lower jurisdictional levels. For any other use case, this value must be `false`. + * @var CertExpressInvitationModel The CertExpress invitation for the customer. If you specified an email address in the invitation request, this invitation will be sent via email. Otherwise, you are expected to direct the customer using a hyperlink directly in your application. */ - public $isAllJuris; + public $invitation; + +} + +/** + * Represents an invitation for a customer to use CertExpress to self-report their own certificates. + * This invitation is delivered by your choice of method, or you can present a hyperlink to the user + * directly in your connector. Your customer will be redirected to https://app.certexpress.com/ where + * they can follow a step-by-step guide to enter information about their exemption certificates. The + * certificates entered will be recorded and automatically linked to their customer record. + */ +class CertExpressInvitationModel +{ /** - * @var float This field has different behavior based on the type of the tax rule. * For a product taxability rule, this value is either 1 or 0, indicating taxable or non-taxable. * For a rate override rule, this value is the corrected rate stored as a decimal, for example, a rate of 5% would be stored as 0.05 decimal. If you use the special value of 1.0, only the cap and threshold values will be applied and the rate will be left alone. + * @var int A unique ID number representing this CertExpress invitation. */ - public $value; + public $id; /** - * @var float The maximum cap for the price of this item according to this rule. Any amount above this cap will not be subject to this rule. For example, if you must pay 5% of a product's value up to a maximum value of $1000, you would set the `cap` to `1000.00` and the `value` to `0.05`. + * @var int The unique ID number of the AvaTax company that sent this invitation. */ - public $cap; + public $companyId; /** - * @var float The per-unit threshold that must be met before this rule applies. For example, if your product is nontaxable unless it is above $100 per product, you would set the `threshold` value to `100`. In this case, the rate for the rule would apply to the entire amount above $100. You can also create rules that make the entire product taxable if it exceeds a threshold, but is nontaxable if it is below the threshold. To choose this, set the `options` field to the value `TaxAll`. + * @var string The email address to which this invitation was sent. If this invitation was presented as a weblink, this value will be null. */ - public $threshold; + public $recipient; /** - * @var string Supports custom options for your tax rule. Supported options include: * `TaxAll` - This value indicates that the entire amount of the line becomes taxable when the line amount exceeds the `threshold`. + * @var string The unique code of the customer that received this invitation. Note: This field is case sensitive. To have exemption certificates apply, this value should be the same as the one passed to create a customer. */ - public $options; + public $customerCode; /** - * @var string The first date at which this rule applies. If `null`, this rule will apply to all dates prior to the end date. + * @var CustomerModel The customer who received this invitation. */ - public $effectiveDate; + public $customer; /** - * @var string The last date for which this rule applies. If `null`, this rule will apply to all dates after the effective date. + * @var CoverLetterModel The attached cover letter object to this request. */ - public $endDate; + public $coverLetter; /** - * @var string A friendly name for this tax rule. + * @var string The status of the emails associated with this invitation. If this invitation was sent via email, this value will change to `Sent` when the email message has been sent. */ - public $description; + public $emailStatus; /** - * @var string For U.S. tax rules, this is the county's Federal Information Processing Standard (FIPS) code. This field is required for rules that apply to specific jurisdictions in the United States. It is not required if you set the `isAllJuris` flag to true. + * @var boolean True if this invitation contained a cover letter only. */ - public $countyFIPS; + public $coverLettersOnly; /** - * @var boolean (DEPRECATED) This field is no longer required. + * @var int[] When an invitation is sent, it contains a list of exposure zones for which the customer is invited to upload their exemption certificates. This list contains the ID numbers of the exposure zones identified. For a list of exposure zones, please call `ListCertificateExposureZones`. */ - public $isSTPro; + public $exposureZones; + + /** + * @var int[] The list of exemption reasons identified by this CertExpress invitation. For a list of reason codes, please call `ListCertificateExemptReasons`. + */ + public $exemptReasons; + + /** + * @var string Indicates the method that was used to deliver this CertExpress invitation. (See CertificateRequestDeliveryMethod::* for a list of allowable values) + */ + public $deliveryMethod; + + /** + * @var string The custom message delivered with this invitation. + */ + public $message; + + /** + * @var string The date of the invitation. + */ + public $date; + + /** + * @var string The web link (URL) that a customer can click on or visit to begin using this CertExpress invitation. This value is only usable if the status of this invitation is `Ready` and the request was created with type `Download`. NOTE: This link usually takes a few minutes to be available. + */ + public $requestLink; + +} + +/** + * Represents a customer to whom you sell products and/or services. + */ +class CustomerModel +{ /** - * @var string Name or ISO 3166 code identifying the country where this rule will apply. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + * @var int Unique ID number of this customer. */ - public $country; + public $id; /** - * @var string Name or ISO 3166 code identifying the region where this rule will apply. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. NOTE: Region is required for US and not required for non-US countries because the user may be either creating a Country-level or Region-level rule. + * @var int The unique ID number of the AvaTax company that recorded this customer. */ - public $region; + public $companyId; /** - * @var string The sourcing types to which this rule applies. (See Sourcing::* for a list of allowable values) + * @var string The unique code identifying this customer. Must be unique within your company. This code should be used in the `customerCode` field of any call that creates or adjusts a transaction in order to ensure that all exemptions that apply to this customer are correctly considered. Note: This field is case sensitive. */ - public $sourcing; + public $customerCode; /** - * @var string This field has different behavior based on the type of rule. * For a product taxability rule, if the rule applies to an item, this value will override the tax type group of the original product. * For other rules, this value determines what tax type groups will be affected by the rule. Refer to `ListTaxTypeGroups` for a list of tax type groups supported by AvaTax. + * @var string A customer-configurable alternate ID number for this customer. You may set this value to match any other system that would like to reference this customer record. */ - public $taxTypeGroup; + public $alternateId; /** - * @var string This field has different behavior based on the type of rule. * For a product taxability rule, if the rule applies to an item, this value will override the tax sub type of the original product. * For other rules, this value determines what tax sub types will be affected by the rule. Refer to `ListTaxSubtypes` for a list of tax sub types supported by AvaTax. + * @var string A friendly name identifying this customer. */ - public $taxSubType; + public $name; /** - * @var string Reserved for Avalara internal usage. Leave this field null. + * @var string Indicates the "Attn:" component of the address for this customer, if this customer requires mailings to be shipped to the attention of a specific person or department name. */ - public $nonPassthroughExpression; + public $attnName; /** - * @var string The currency code to use for this rule. For a list of currencies supported by AvaTax, use the [ListCurrencies API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListCurrencies/). + * @var string First line of the street address of this customer. */ - public $currencyCode; + public $line1; /** - * @var int Reserved for Avalara internal usage. Leave this field null. + * @var string Second line of the street address of this customer. */ - public $preferredProgramId; + public $line2; /** - * @var int 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, use the [ListUnitsOfMeasurement API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListUnitOfMeasurement/). + * @var string City component of the street address of this customer. */ - public $uomId; + public $city; /** - * @var string The date when this record was created. + * @var string Postal Code / Zip Code component of the address of this customer. */ - public $createdDate; + public $postalCode; /** - * @var int The User ID of the user who created this record. + * @var string The main phone number for this customer. */ - public $createdUserId; + public $phoneNumber; /** - * @var string The date/time when this record was last modified. + * @var string The fax phone number for this customer, if any. */ - public $modifiedDate; + public $faxNumber; /** - * @var int The user ID of the user who last modified this record. + * @var string The main email address for this customer. */ - public $modifiedUserId; - -} - -/** - * One Universal Product Code object as defined for your company. - */ -class UPCModel -{ + public $emailAddress; /** - * @var int The unique ID number for this UPC. + * @var string The name of the main contact person for this customer. */ - public $id; + public $contactName; /** - * @var int The unique ID number of the company to which this UPC belongs. + * @var string Date when this customer last executed a transaction. */ - public $companyId; + public $lastTransaction; /** - * @var string The 12-14 character Universal Product Code, European Article Number, or Global Trade Identification Number. + * @var string The date when this record was created. */ - public $upc; + public $createdDate; /** - * @var string Legacy Tax Code applied to any product sold with this UPC. + * @var string The date/time when this record was last modified. */ - public $legacyTaxCode; + public $modifiedDate; /** - * @var string Description of the product to which this UPC applies. + * @var string Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. */ - public $description; + public $country; /** - * @var string If this UPC became effective on a certain date, this contains the first date on which the UPC was effective. + * @var string Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. */ - public $effectiveDate; + public $region; /** - * @var string If this UPC expired or will expire on a certain date, this contains the last date on which the UPC was effective. + * @var boolean True if this customer record is specifically used for bill-to purposes. */ - public $endDate; + public $isBill; /** - * @var int A usage identifier for this UPC code. + * @var boolean True if this customer record is specifically used for ship-to purposes. */ - public $usage; + public $isShip; /** - * @var int A flag indicating whether this UPC code is attached to the AvaTax system or to a company. + * @var string For customers in the United States, this field is the federal taxpayer ID number. For businesses, this is a Federal Employer Identification Number. For individuals, this will be a Social Security Number. */ - public $isSystem; + public $taxpayerIdNumber; /** - * @var string The date when this record was created. + * @var CertificateModel[] A list of exemption certficates that apply to this customer. You can fetch this data by specifying `$include=certificates` when calling a customer fetch API. */ - public $createdDate; + public $certificates; /** - * @var int The User ID of the user who created this record. + * @var CustomFieldModel[] A list of custom fields defined on this customer. For more information about custom fields, see the [Avalara Help Center article about custom fields](https://help.avalara.com/0021_Avalara_CertCapture/All_About_CertCapture/Edit_or_Remove_Details_about_Customers). */ - public $createdUserId; + public $customFields; /** - * @var string The date/time when this record was last modified. + * @var ExposureZoneModel[] A list of exposure zones where you do business with this customer. To keep track of certificates that are needed for each customer, set this value to a list of all exposure zones where you sell products to this customer. You can find a list of exposure zones by calling `ListExposureZones`. This field is often called "Ship-To States" or "Ship-To Zones", since it generally refers to locations where you ship products when this customer makes a purchase. This field is useful for audit purposes since it helps you ensure you have the necessary certificates for each customer. */ - public $modifiedDate; + public $exposureZones; /** - * @var int The user ID of the user who last modified this record. + * @var CustomerModel[] A list of ship-to customer records that are connected to this bill-to customer. Customer records represent businesses or individuals who can provide exemption certificates. Some customers may have certificates that are linked to their shipping address or their billing address. To group these customer records together, you may link multiple bill-to and ship-to addresses together to represent a single entity that has multiple different addresses of different kinds. */ - public $modifiedUserId; + public $shipTos; } /** - * Exempt certificate + * 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. */ -class EcmsModel +class CoverLetterModel { /** - * @var int The calc_id associated with a certificate in CertCapture. + * @var int A unique ID number representing a cover letter sent with a CertExpress invitation. */ - public $exemptCertId; + public $id; /** - * @var int Company ID + * @var int The unique ID number of the AvaTax company that received this certificate. */ public $companyId; /** - * @var string Customer code + * @var string The title used when sending the cover letter. */ - public $customerCode; + public $title; /** - * @var string Customer name + * @var string The subject message used when sending the cover letter via email. */ - public $customerName; + public $subject; /** - * @var string Address line 1 + * @var string A full description of the cover letter's contents and message. */ - public $address1; + public $description; /** - * @var string Address line 2 + * @var string The date when this record was created. */ - public $address2; + public $createdDate; /** - * @var string Address line 3 + * @var string The date/time when this record was last modified. */ - public $address3; + public $modifiedDate; /** - * @var string City + * @var boolean Is this cover letter active */ - public $city; + public $active; /** - * @var string Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. + * @var int How many pages this cover letter encompasses */ - public $region; + public $pageCount; /** - * @var string Postal code / zip code + * @var string The file name of the cover letter template */ - public $postalCode; + public $templateFilename; /** - * @var string Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + * @var int The version number of the template */ - public $country; + public $version; + +} + +/** + * 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. + */ +class CertificateModel +{ /** - * @var string The type of exemption certificate. Permitted values are: Blanket and Single. (See ExemptCertTypeId::* for a list of allowable values) + * @var int Unique ID number of this certificate. */ - public $exemptCertTypeId; + public $id; /** - * @var string Document Reference Number, in the case of single-use exemption certificates, the DocumentCode or PurchaseOrderNo to which the certificate should apply. + * @var int The unique ID number of the AvaTax company that recorded this certificate. */ - public $documentRefNo; + public $companyId; /** - * @var int Business type the customer belongs to. + * @var string The date when this certificate was signed. */ - public $businessTypeId; + public $signedDate; /** - * @var string Other description for this business type + * @var string Expiration date when this certificate will no longer be valid. */ - public $businessTypeOtherDescription; + public $expirationDate; /** - * @var string Exempt reason associated with the certificate, coded by CustomerUsageType. Example: A - Federal Government. + * @var string File name for the image of this certificate. When creating a certificate, if you do not upload a PDF or JPG image, you must specify the filename of the certificate as it is tracked in your repository. To create a certificate, you must provide one of the following fields: either a `filename`, a `pdf` file, or an array of JPG `pages`. The API will return an error if you omit these fields or if you attempt to put values in more than one of them. */ - public $exemptReasonId; + public $filename; /** - * @var string Other description for exempt reason i.e. Populated on if exemptReasonId is 'L' - Other. + * @var boolean True if this certificate is marked as valid. A valid certificate can be considered for exemption purposes. When a certificate is marked invalid, it will no longer be considered when calculating exemption for a customer. */ - public $exemptReasonOtherDescription; + public $valid; /** - * @var string Effective date for this exempt certificate + * @var boolean This value is true if the certificate has gone through the certificate validation process. For more information on the certificate validation process, please see the Avalara Help Center. */ - public $effectiveDate; + public $verified; /** - * @var string A list of applicable regions for this exempt certificate. To list more than one applicable region, separate the list of region codes with commas. + * @var float If this certificate provides exemption from transactional taxes, what percentage of the transaction is considered exempt? For a fully exempt certificate, this percentage should be 100. */ - public $regionsApplicable; + public $exemptPercentage; /** - * @var string Status for this exempt certificate (See ExemptCertStatusId::* for a list of allowable values) + * @var boolean This value is true if this certificate is a single (or standalone) certificate. This value is set during the audit stage of the certificate validation process. */ - public $exemptCertStatusId; + public $isSingleCertificate; /** - * @var string Date when this exempt certificate was created + * @var ExemptionReasonModel The exemption reason that CertCapture audit/internal logic identifies for created certificate. */ - public $createdDate; + public $validatedExemptionReason; /** - * @var string Date when last transaction with this exempt certificate happened + * @var ExemptionReasonModel The exemption reason associated with this certificate. For example, the reason code for exemption for purposes of resale is `RESALE`. For a list of exemption reasons, call `ListCertificateExemptReasons`. */ - public $lastTransactionDate; + public $exemptionReason; /** - * @var string When this exempt certificate will expire + * @var string The status of the certificate */ - public $expiryDate; + public $status; /** - * @var int User that creates the certificate + * @var string The date/time when this record was created. */ - public $createdUserId; + public $createdDate; /** - * @var string Date when this exempt certificate was modified + * @var string The date/time when this record was last modified. */ public $modifiedDate; /** - * @var int Who modified this exempt certificate + * @var int Number of pages contained within this certificate. */ - public $modifiedUserId; + public $pageCount; /** - * @var string Name or ISO 3166 code identifying the country that issued this ECMS certificate. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + * @var CustomerModel[] A list of customers to which this certificate applies. You can fetch this data by specifying `$include=customers` when calling a certificate fetch API. */ - public $countryIssued; + public $customers; /** - * @var string If the certificate record was synced from an AvaTax Certs account(as opposed to being entered in ECMS directly), the unique AvaTax Certs identifier for the certificate record. Usually same as the Id of a Certificate. + * @var PoNumberModel[] A list of purchase order numbers that are valid for use with this certificate. If this certificate is applicable for all purchase order numbers, this field will be empty. You can fetch this data by specifying `$include=po_numbers` when calling a certificate fetch API. */ - public $avaCertId; + public $poNumbers; /** - * @var string Review status for this exempt certificate (See ExemptCertReviewStatusId::* for a list of allowable values) + * @var ExposureZoneModel The exposure zone where this certificate is valid. */ - public $exemptCertReviewStatusId; + public $exposureZone; /** - * @var EcmsDetailModel[] Exempt Cert details + * @var CertificateAttributeModel[] A list of certificate attributes that apply to this certificate. You can fetch this data by specifying `$include=attributes` when calling a certificate fetch API. + */ + public $attributes; + + /** + * @var string This field is available for input only. To retrieve the image after creation, use the `DownloadCertificateImage` API. When creating a certificate, you may optionally provide a PDF image in Base64 URLEncoded format. PDFs are automatically parsed into individual page JPG images and can be retrieved back later as either the original PDF or the individual pages. To create a certificate, you must provide one of the following fields: either a `filename`, a `pdf` file, or an array of JPG `pages`. The API will return an error if you omit these fields or if you attempt to put values in more than one of them. + */ + public $pdf; + + /** + * @var string[] This field is available for input only. To retrieve the image after creation, use the `DownloadCertificateImage` API. When creating a certificate, you may optionally provide a list of JPG images, one per page, in Base64 URLEncoded format. These JPG images are automatically combined into a single downloadable PDF and can be retrieved back later as either the original JPG images or the combined PDF. To create a certificate, you must provide one of the following fields: either a `filename`, a `pdf` file, or an array of JPG `pages`. The API will return an error if you omit these fields or if you attempt to put values in more than one of them. */ - public $details; + public $pages; } /** - * Represents a classification for a given item. + * A custom field provides extra information about a customer or certificate. + * + * Custom fields are provided to permit you to store additional information about an exemption certificate or customer. They are available to + * support additional use cases beyond that supported directly by Avalara's exemption certificate software. + * + * For more information about custom fields, see the [Avalara Help Center article about custom fields](https://help.avalara.com/0021_Avalara_CertCapture/All_About_CertCapture/Edit_or_Remove_Details_about_Customers). */ -class ClassificationModel +class CustomFieldModel { /** - * @var string The product code of an item in a given system. + * @var string The name of the custom field. */ - public $productCode; + public $name; /** - * @var string The system code in which the product belongs. + * @var string The value of the custom field. */ - public $systemCode; + public $value; } /** - * Represents a parameter associated with an item. + * Information about a physical area or zone in which a certificate can apply. + * An exposure zone for an exemption certificate will generally be a tax authority such + * as a state, country, or local government entity. */ -class ItemParameterModel +class ExposureZoneModel { /** - * @var int The id of the parameter. + * @var int A unique ID number representing this exposure zone. */ public $id; /** - * @var string The parameter's name. + * @var int The unique ID number of the AvaTax company that recorded this customer. */ - public $name; + public $companyId; /** - * @var string The value for the parameter. + * @var string The short name of this exposure zone, suitable for use in a drop-down list. */ - public $value; + public $name; /** - * @var string The unit of measurement code for the parameter. + * @var string A tag indicating */ - public $unit; + public $tag; /** - * @var int The item id + * @var string A more complete description of this exposure zone, suitable for use as a tooltip or help text. */ - public $itemId; - -} + public $description; -/** - * Represents the answer to one local jurisdiction question for a location. - */ -class LocationSettingModel -{ + /** + * @var string The date when this record was created. + */ + public $created; /** - * @var int The unique ID number of the location question answered. + * @var string The date/time when this record was last modified. */ - public $questionId; + public $modified; /** - * @var string The name of the question + * @var string Two or three character ISO 3166 region, province, or state name of this exposure zone. */ - public $questionName; + public $region; /** - * @var string The answer the user provided. + * @var string Two character ISO 3166 county code for the country component of this exposure zone. */ - public $value; + public $country; } /** - * Represents an ECMS record, used internally by AvaTax to track information about exemptions. + * An exemption reason defines why a certificate allows a customer to be exempt + * for purposes of tax calculation. For a full list of defined exemption reasons, + * please call the `ListCertificateExemptionReasons` API. */ -class EcmsDetailModel +class ExemptionReasonModel { /** - * @var int Unique, system-assigned identifier of a ExemptCertDetail record. + * @var int A unique ID number representing this exemption reason. */ - public $exemptCertDetailId; + public $id; /** - * @var int The calc_id associated with a certificate in CertCapture. + * @var string A friendly name describing this exemption reason. */ - public $exemptCertId; + public $name; - /** - * @var string State FIPS - */ - public $stateFips; +} - /** - * @var string Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. - */ - public $region; +/** + * Represents a purchase order number for a transaction + */ +class PoNumberModel +{ /** - * @var string The customer Tax Id Number (tax_number) associated with a certificate. This is same as exemptionNo in Transactions. + * @var int Unique ID number */ - public $idNo; + public $id; /** - * @var string Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + * @var string Purchase order number. */ - public $country; + public $poNumber; + +} + +/** + * A certificate attribute can be thought of as a feature or flag that is applied to a certificate. + * A single certificate can be linked to zero, one, or many certificate attributes. The full list of + * attributes can be obtained by calling the `ListCertificateAttributes` API. + */ +class CertificateAttributeModel +{ /** - * @var string End date of this exempt certificate + * @var int A unique ID number representing this certificate attribute. */ - public $endDate; + public $id; /** - * @var string The type of idNo (tax_number) associated with a certificate. Example: Driver's Licence Number, Permit Number. + * @var string A friendly readable name for this certificate attribute. */ - public $idType; + public $name; /** - * @var int Is the tax code list an exculsion list? + * @var string A full help text description of the certificate attribute. */ - public $isTaxCodeListExclusionList; + public $description; /** - * @var EcmsDetailTaxCodeModel[] optional: list of tax code associated with this exempt certificate detail + * @var boolean This value is true if this is a system-defined certificate attribute. System-defined attributes cannot be modified or deleted on the CertCapture website. */ - public $taxCodes; + public $isSystemCode; } /** + * Contains information about a company's exemption certificate status. * + * This model can be used to determine if your company is able to use the Customers, Certificates, and + * CertExpressInvites APIs within AvaTax. */ -class EcmsDetailTaxCodeModel +class ProvisionStatusModel { /** - * @var int Id of the exempt certificate detail tax code + * @var string The status of exemption certificate setup for this company. If this value is `Finished`, this company will then be able to use the Customers, Certificates, and CertExpressInvites APIs within AvaTax. (See CertCaptureProvisionStatus::* for a list of allowable values) */ - public $exemptCertDetailTaxCodeId; + public $status; /** - * @var int exempt certificate detail id + * @var int The accountId of the company represented by this status */ - public $exemptCertDetailId; + public $accountId; /** - * @var int tax code id + * @var int The AvaTax company represented by this status */ - public $taxCodeId; + public $companyId; + +} + +/** + * Represents a customer to whom you sell products and/or services. + */ +class LinkCustomersModel +{ + + /** + * @var string[] An array of customerCodes that are exempted by this certificate + */ + public $customers; } @@ -7794,6 +7946,39 @@ class CompanyReturnSettingModel } +/** + * Represents a complex query request to parse using query filter guidelines from Microsoft REST standards + */ +class QueryRequestModel +{ + + /** + * @var string A list of conditions to filter objects. + */ + public $filter; + + /** + * @var string A list of included commands for this fetch operation. + */ + public $include; + + /** + * @var int For pagination: This is the maximum number of results to return. + */ + public $maxResults; + + /** + * @var int For pagination: This is the index of the first result. + */ + public $startIndex; + + /** + * @var string Sorts the resulting objects in a specific manner. + */ + public $sortBy; + +} + /** * Model with options for adding a new filing calendar */ @@ -9672,6 +9857,87 @@ class FilingsCheckupAuthorityModel } +/** + * Account Linkage output model + */ +class FirmClientLinkageOutputModel +{ + + /** + * @var int The unique ID number of firm-client linkage. + */ + public $id; + + /** + * @var int Firm Account to be linked with the firm + */ + public $firmAccountId; + + /** + * @var int Client Account to be linked with the firm + */ + public $clientAccountId; + + /** + * @var string Offer requested + */ + public $offer; + + /** + * @var string Created date of the linkage + */ + public $createdDate; + + /** + * @var int User who created the linkage + */ + public $createdUserId; + + /** + * @var string Modified date of the linkage + */ + public $modifiedDate; + + /** + * @var int User who modified the linkage + */ + public $modifiedUserId; + + /** + * @var string The status of the account linkage. The following are the available statuses * Requested - When a linkage is requested * Approved - When the linkage is approved * Rejected - When the linkage is rejected * Revoked - When the linkage is revoked. (See FirmClientLinkageStatus::* for a list of allowable values) + */ + public $status; + + /** + * @var boolean This is set to 1 if the linkage is deleted. + */ + public $isDeleted; + +} + +/** + * Account Linkage Input model + */ +class FirmClientLinkageInputModel +{ + + /** + * @var int Client AccountId that needs to be linked to the firm + */ + public $clientAccountId; + + /** + * @var string Client AccountName that needs to be linked to the firm + */ + public $clientAccountName; + + /** + * @var string Offer to be associated + */ + public $offer; + +} + /** * Product classification input model. */ @@ -11170,6 +11436,29 @@ class ResourceFileUploadRequestModel } +/** + * Encapsulates the result of uploading a file to the resource system + */ +class ResourceFileUploadResultModel +{ + + /** + * @var string If the request failed, this contains a description of the error. + */ + public $message; + + /** + * @var int If the request succeeded, this is the ID number of the file. + */ + public $resourceFileId; + + /** + * @var boolean True if the upload request succeeded. + */ + public $aaa_success; + +} + /** * Represents a single notification. *