diff --git a/src/Constants.php b/src/Constants.php index 7a9b8a2..798701f 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -2,7 +2,7 @@ namespace Avalara; use GuzzleHttp\Client; -define('AVATAX_SDK_VERSION', '24.6.3'); +define('AVATAX_SDK_VERSION', '24.8.0'); /***************************************************************************** * * diff --git a/src/Methods.php b/src/Methods.php index bf17ba2..cb0b099 100644 --- a/src/Methods.php +++ b/src/Methods.php @@ -5503,6 +5503,88 @@ public function getDcvById($domainControlVerificationId) { return $this->restCall($path, 'GET', $guzzleParams, AVATAX_SDK_VERSION ); } + /** + * Delete AFC event notifications. + * + * ### Security Policies + * + * * This API depends on the following active services:*Required* (all): ECMPremiumComms, ECMProComms. + * Swagger Name: AvaTaxClient + * + * @param boolean $isDlq Specify `true` to delete event notifications from the dead letter queue; otherwise, specify `false`. + * @param EventDeleteMessageModel $model Details of the event you want to delete. + * @return \stdClass + */ + public function deleteAfcEventNotifications($isDlq, $model) { + $path = "/api/v2/event-notifications/afc"; + $guzzleParams = [ + 'query' => ['isDlq' => null === $isDlq ? null : json_encode($isDlq)], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'DELETE', $guzzleParams, AVATAX_SDK_VERSION ); + } + + /** + * Delete company event notifications + * + * ### Security Policies + * + * * This API depends on the following active services:*Required* (all): ECMPro, ECMPremium. + * Swagger Name: AvaTaxClient + * + * @param int $companyId The unique ID number of the company that recorded these event notifications. + * @param EventDeleteMessageModel $model Details of the event you want to delete. + * @return \stdClass + */ + public function deleteEventNotifications($companyId, $model) { + $path = "/api/v2/event-notifications/companies/{$companyId}"; + $guzzleParams = [ + 'query' => [], + 'body' => json_encode($model) + ]; + return $this->restCall($path, 'DELETE', $guzzleParams, AVATAX_SDK_VERSION ); + } + + /** + * Retrieve company event notifications. + * + * ### Security Policies + * + * * This API depends on the following active services:*Required* (all): ECMPro, ECMPremium. + * Swagger Name: AvaTaxClient + * + * @param int $companyId The unique ID number of the company that recorded these event notifications. + * @return \stdClass + */ + public function getEventNotifications($companyId) { + $path = "/api/v2/event-notifications/companies/{$companyId}"; + $guzzleParams = [ + 'query' => [], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams, AVATAX_SDK_VERSION ); + } + + /** + * Retrieve AFC event notifications + * + * ### Security Policies + * + * * This API depends on the following active services:*Required* (all): ECMPremiumComms, ECMProComms. + * Swagger Name: AvaTaxClient + * + * @param boolean $isDlq Specify `true` to retrieve event notifications from the dead letter queue; otherwise, specify `false`. + * @return \stdClass + */ + public function listAfcEventNotifications($isDlq) { + $path = "/api/v2/event-notifications/afc"; + $guzzleParams = [ + 'query' => ['isDlq' => null === $isDlq ? null : json_encode($isDlq)], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams, AVATAX_SDK_VERSION ); + } + /** * Create a new eCommerce token. * @@ -6696,6 +6778,35 @@ public function listItemsByCompany($companyId, $filter=null, $include=null, $top return $this->restCall($path, 'GET', $guzzleParams, AVATAX_SDK_VERSION ); } + /** + * Retrieve the parameters by companyId and itemId. + * + * Returns the list of parameters based on the company's service types and the item code. + * Ignores nexus if a service type is configured in the 'IgnoreNexusForServiceTypes' configuration section. + * Ignores nexus for the AvaAlcohol service type. + * + * ### Security Policies + * + * * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * Swagger Name: AvaTaxClient + * + * @param int $companyId Company Identifier. + * @param int $itemId Item Identifier. + * @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:* serviceTypes, regularExpression, attributeSubType, values + * @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 \stdClass + */ + public function listRecommendedParameterByCompanyIdAndItemId($companyId, $itemId, $filter=null, $top=null, $skip=null, $orderBy=null) { + $path = "/api/v2/definitions/companies/{$companyId}/items/{$itemId}/parameters"; + $guzzleParams = [ + 'query' => ['$filter' => $filter, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy], + 'body' => null + ]; + return $this->restCall($path, 'GET', $guzzleParams, AVATAX_SDK_VERSION ); + } + /** * Retrieve all items * diff --git a/src/Models.php b/src/Models.php index 1069a8c..1d86a77 100644 --- a/src/Models.php +++ b/src/Models.php @@ -1601,14 +1601,14 @@ class BatchModel * @var string The agent used to create this batch */ public $batchAgent; - /** - * @var string Any optional flags provided for this batch - */ - public $options; /** * @var int The unique ID number of this batch. */ public $id; + /** + * @var string Any optional flags provided for this batch + */ + public $options; /** * @var string The user-friendly readable name for this batch. */ @@ -3790,6 +3790,10 @@ class CreateTransactionBatchRequestModel * @var TransactionBatchItemModel[] The list of transactions contained in this batch. */ public $transactions; + /** + * @var string Any optional flags provided for this batch + */ + public $options; } /** * Represents a create transaction batch response model. @@ -3801,6 +3805,10 @@ class CreateTransactionBatchResponseModel * @var int The unique ID number of this batch. */ public $id; + /** + * @var string Any optional flags provided for this batch + */ + public $options; /** * @var string The user-friendly readable name for this batch. */ @@ -3997,6 +4005,68 @@ class CreateTransactionModel */ public $deliveryTerms; } +/** + * Credit Transaction Detail Lines + * Swagger Name: AvaTaxClient + */ +class CreditTransactionDetailLines +{ + /** + * @var string ReportingDate + */ + public $reportingDate; + /** + * @var string LineNo + */ + public $lineNo; + /** + * @var float LineAmount + */ + public $lineAmount; + /** + * @var float ExemptAmount + */ + public $exemptAmount; + /** + * @var float TaxableAmount + */ + public $taxableAmount; + /** + * @var float TaxAmount + */ + public $taxAmount; +} +/** + * Credit Transaction Details + * Swagger Name: AvaTaxClient + */ +class CreditTransactionDetails +{ + /** + * @var string DocCode + */ + public $docCode; + /** + * @var string DocDate + */ + public $docDate; + /** + * @var float TotalExempt + */ + public $totalExempt; + /** + * @var float TotalTaxable + */ + public $totalTaxable; + /** + * @var float TotalTax + */ + public $totalTax; + /** + * @var CreditTransactionDetailLines[] Lines + */ + public $lines; +} /** * Represents an ISO 4217 currency code used for designating the currency of a transaction. * Swagger Name: AvaTaxClient @@ -5255,6 +5325,51 @@ class ErrorTransactionOutputModel */ public $documentCode; } +/** + * Model to delete message + * Swagger Name: AvaTaxClient + */ +class EventDeleteBatchMessageModel +{ + /** + * @var string The receipt handle associated with the message to delete. + */ + public $receiptHandle; + /** + * @var string A system-assigned message ID + */ + public $messageId; +} +/** + * Encloses the delete message command. + * Swagger Name: AvaTaxClient + */ +class EventDeleteMessageModel +{ + /** + * @var EventDeleteBatchMessageModel[] Command details for the delete message + */ + public $eventDeleteBatchMessageCommands; +} +/** + * Encloses event message details + * Swagger Name: AvaTaxClient + */ +class EventMessageResponse +{ + /** + * @var string Message content + */ + public $body; + /** + * @var string A system-assigned message ID + */ + public $messageId; + /** + * @var string The receipt handle associated with the message to delete. + */ + public $receiptHandle; +} /** * 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, @@ -5860,6 +5975,10 @@ class FilingCalendarModel * @var int Auto Lock Override Day */ public $autoLockOverrideDay; + /** + * @var string The three-character currency code according to country. For example if country is 'US' then currency is 'USD'. Similarly, if country is 'CA' then currency is 'CAD', etc. + */ + public $currency; } /** * FilingFrequency Model @@ -6216,7 +6335,7 @@ class FilingReturnCreditModel */ public $totalTax; /** - * @var WorksheetDocument[] The excluded carry over credit documents + * @var CreditTransactionDetails[] The excluded carry over credit documents */ public $transactionDetails; } @@ -6450,6 +6569,14 @@ class FilingReturnModel * @var FilingReturnCreditModel */ public $appliedCarryOverCredits; + /** + * @var string The three-character liability currency code. + */ + public $liabilityCurrencyCode; + /** + * @var string The three-character filing calendar currency code for this return. For example if country is 'US' then currency is 'USD'. Similarly, if country is 'CA' then currency is 'CAD', etc. + */ + public $filingCalendarCurrencyCode; /** * @var string The date when this record was created. */ @@ -7923,11 +8050,11 @@ class ItemCatalogueInputModel */ public $itemType; /** - * @var string The universal product code of the item. + * @var string The universal product code of the item. Deprecated - As of 6/25/2024, this field is deprecated. Instead of using this field, you can pass this value as a parameter. The parameter name is UPC. */ public $upc; /** - * @var string A summary for selection of the tax code. + * @var string Long Summary for Item Deprecated - As of 6/25/2024, this field is deprecated. Instead of using this field, you can pass this value as a parameter. The parameter name is Summary. */ public $summary; /** @@ -7943,7 +8070,7 @@ class ItemCatalogueInputModel */ public $source; /** - * @var string The Id of this item at the source + * @var string The unique identifier of this item at the source */ public $sourceEntityId; /** @@ -7951,7 +8078,7 @@ class ItemCatalogueInputModel */ public $properties; /** - * @var ClassificationModel[] Classifications Attached to the Product + * @var ClassificationModel[] Classifications Attached to the Product Please note: `taxCode` (ProductCode for SystemCode `AVATAXCODE`) is being removed from `classifications`. You can still find it in the `taxCode` field. */ public $classifications; /** @@ -7989,7 +8116,7 @@ class ItemCatalogueResultModel */ public $itemCode; /** - * @var string The Id of this item at the source + * @var string The unique identifier of this item at the source */ public $sourceEntityId; /** @@ -8106,7 +8233,7 @@ class ItemModel */ public $source; /** - * @var string The Id of this item at the source + * @var string The unique identifier of this item at the source */ public $sourceEntityId; /** @@ -8114,15 +8241,15 @@ class ItemModel */ public $itemType; /** - * @var string Universal unique code for item + * @var string Universal unique code for item Deprecated - As of 6/25/2024, this field is deprecated. Instead of using this field, you can pass this value as a parameter. `The parameter name is UPC`. */ public $upc; /** - * @var string Long Summary for Item + * @var string Long Summary for Item Deprecated - As of 6/25/2024, this field is deprecated. Instead of using this field, you can pass this value as a parameter. `The parameter name is Summary`. */ public $summary; /** - * @var ClassificationModel[] List of classifications that belong to this item. A single classification consists of a productCode and a systemCode for a particular item. + * @var ClassificationModel[] List of classifications that belong to this item. A single classification consists of a productCode and a systemCode for a particular item. Please note: `taxCode` (ProductCode for SystemCode `AVATAXCODE`) is being removed from `classifications`. You can still find it in the `taxCode` field. */ public $classifications; /** @@ -9472,41 +9599,6 @@ class MarketplaceModel */ public $marketplace; } -/** - * - * Swagger Name: AvaTaxClient - */ -class Message -{ - /** - * @var string - */ - public $details; - /** - * @var string - */ - public $helpLink; - /** - * @var string - */ - public $name; - /** - * @var string - */ - public $refersTo; - /** - * @var string - */ - public $severity; - /** - * @var string - */ - public $source; - /** - * @var string - */ - public $summary; -} /** * A company and account * Swagger Name: AvaTaxClient @@ -9869,6 +9961,14 @@ class MultiTaxFilingReturnModel * @var string The FilingTaskType for this return. */ public $type; + /** + * @var string The three-character liability currency code. + */ + public $liabilityCurrencyCode; + /** + * @var string The three-character filing calendar currency code for this return. For example if country is 'US' then currency is 'USD'. Similarly, if country is 'CA' then currency is 'CAD', etc. + */ + public $filingCalendarCurrencyCode; /** * @var FilingsTaxSummaryModel */ @@ -15090,92 +15190,6 @@ class VoidTransactionModel */ public $code; } -/** - * - * Swagger Name: AvaTaxClient - */ -class WorksheetDocument -{ - /** - * @var string - */ - public $docCode; - /** - * @var string - */ - public $docDate; - /** - * @var float - */ - public $totalExempt; - /** - * @var float - */ - public $totalTaxable; - /** - * @var float - */ - public $totalTax; - /** - * @var WorksheetDocumentLine[] - */ - public $lines; - /** - * @var Message[] - */ - public $messages; - /** - * @var string - */ - public $resultCode; - /** - * @var string - */ - public $transactionId; -} -/** - * - * Swagger Name: AvaTaxClient - */ -class WorksheetDocumentLine -{ - /** - * @var string - */ - public $reportingDate; - /** - * @var string - */ - public $lineNo; - /** - * @var float - */ - public $lineAmount; - /** - * @var float - */ - public $exemptAmount; - /** - * @var float - */ - public $taxableAmount; - /** - * @var float - */ - public $taxAmount; - /** - * @var Message[] - */ - public $messages; - /** - * @var string - */ - public $resultCode; - /** - * @var string - */ - public $transactionId; -} /** * Represents a verification request using Skyscraper for a company * Swagger Name: AvaTaxClient