Skip to content

Commit

Permalink
Merge pull request #146 from avadev/21.8.0
Browse files Browse the repository at this point in the history
Update for 21.8.0
  • Loading branch information
svc-developer authored Aug 27, 2021
2 parents e0dd71d + d0d2deb commit 70eeb60
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ protected function restCall($apiUrl, $verb, $guzzleParams)
}
$guzzleParams['headers'] = [
'Accept' => 'application/json',
'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 21.7.1; {$this->machineName}"
'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 21.8.0; {$this->machineName}"
];
} else {
$guzzleParams['headers'] = [
'Accept' => 'application/json',
'Authorization' => 'Bearer '.$this->auth[0],
'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 21.7.1; {$this->machineName}"
'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 21.8.0; {$this->machineName}"
];
}
// timeout for 1200s (20 min)
Expand Down
2 changes: 2 additions & 0 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ class ErrorCodeId
const C_OFFERCODEALREADYAPPLIED = 610;
const C_ACCOUNTALREADYEXISTS = 611;
const C_LICENSEKEYNAMEALREADYEXISTSFORACCOUNT = 612;
const C_USERALREADYEXIST = 613;
const C_USERNOTFOUND = 614;
const C_REFUNDTYPEANDPERCENTAGEMISMATCH = 701;
const C_INVALIDDOCUMENTTYPEFORREFUND = 702;
const C_REFUNDTYPEANDLINEMISMATCH = 703;
Expand Down
19 changes: 11 additions & 8 deletions src/Methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -3710,7 +3710,7 @@ public function listMarketplaceLocations($marketplaceId, $top=null, $skip=null,
* This API is intended to be useful if your user interface needs to display a selectable list of nexus.
*
*
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, parameters, taxableNexus
* @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`.
Expand Down Expand Up @@ -3742,7 +3742,7 @@ public function listNexus($filter=null, $top=null, $skip=null, $orderBy=null)
* @param string $region Name or ISO 3166 code identifying the region portion of the address. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`.
* @param string $postalCode The postal code or zip code portion of this address.
* @param string $country Name or ISO 3166 code identifying the country portion of this address. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, parameters, taxableNexus
* @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`.
Expand All @@ -3766,7 +3766,7 @@ public function listNexusByAddress($line1, $line2, $line3, $city, $region, $post
*
*
* @param string $country The country in which you want to fetch the system nexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, parameters, taxableNexus
* @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`.
Expand All @@ -3791,7 +3791,7 @@ public function listNexusByCountry($country, $filter=null, $top=null, $skip=null
*
* @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 $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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, parameters, taxableNexus
* @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`.
Expand Down Expand Up @@ -5838,6 +5838,8 @@ public function listItemParameters($companyId, $itemId, $filter=null, $top=null,
*
* Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
*
* You may specify Tag Name in the `tagName` query parameter if you want to filter items on the basis of tagName
*
* 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:
*
* * Parameters
Expand All @@ -5855,12 +5857,13 @@ public function listItemParameters($companyId, $itemId, $filter=null, $top=null,
* @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`.
* @param string $tagName Tag Name on the basis of which you want to filter Items
* @return FetchResult
*/
public function listItemsByCompany($companyId, $filter=null, $include=null, $top=null, $skip=null, $orderBy=null) {
public function listItemsByCompany($companyId, $filter=null, $include=null, $top=null, $skip=null, $orderBy=null, $tagName) {
$path = "/api/v2/companies/{$companyId}/items";
$guzzleParams = [
'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy],
'query' => ['$filter' => $filter, '$include' => $include, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy, 'tagName' => $tagName],
'body' => null
];
return $this->restCall($path, 'GET', $guzzleParams);
Expand Down Expand Up @@ -7409,7 +7412,7 @@ public function getNexusParameter($companyId, $nexusId, $id) {
*
*
* @param int $companyId The ID of the company that owns these nexus objects
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, parameters, taxableNexus
* @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.
Expand Down Expand Up @@ -7480,7 +7483,7 @@ public function listNexusParameters($companyId, $nexusId, $filter=null, $top=nul
* * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
*
*
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
* @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/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, parameters, taxableNexus
* @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.
Expand Down
54 changes: 35 additions & 19 deletions src/Models.php
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,10 @@ class ItemTagDetailModel
* @var int The unique ID number of the company that owns this item.
*/
public $companyId;
/**
* @var string The date when this record was created.
*/
public $createdDate;
}
/**
* Represents an item in your company's product catalog.
Expand Down Expand Up @@ -1639,6 +1643,10 @@ class NexusModel
* @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 group of nexus that this company is declaring Use [ListTaxTypeGroups](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListTaxTypeGroups/) 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`. NOTE: This optional field will trigger nexus subtype lookup when populated. When using make sure TaxTypeGroup matches corresponding NexusTaxTypeGroup
*/
public $taxTypeGroup;
/**
* @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`.
*/
Expand Down Expand Up @@ -3228,6 +3236,24 @@ class BatchAdjustTransactionModel
*/
public $newTransaction;
}
/**
* Create or adjust transaction model
*/
class CreateOrAdjustTransactionModel
{
/**
* @var string A reason code indicating why this adjustment was made (See AdjustmentReason::* for a list of allowable values)
*/
public $adjustmentReason;
/**
* @var string If the AdjustmentReason is "Other", specify the reason here. This is required when the AdjustmentReason is 8 (Other).
*/
public $adjustmentDescription;
/**
* @var CreateTransactionModel The create transaction model to be created or updated. If the transaction does not exist, create transaction. If the transaction exists, adjust the existing transaction.
*/
public $createTransactionModel;
}
/**
* A request to void a previously created transaction.
*/
Expand Down Expand Up @@ -3256,6 +3282,10 @@ class BatchVoidTransactionModel
*/
class TransactionBatchItemModel
{
/**
* @var string Represents a transaction memo.
*/
public $memo;
/**
* @var CreateTransactionModel Represents a transaction to be created.
*/
Expand All @@ -3264,6 +3294,10 @@ class TransactionBatchItemModel
* @var BatchAdjustTransactionModel Represents an existing transaction to be adjusted.
*/
public $adjustTransactionModel;
/**
* @var CreateOrAdjustTransactionModel Represents a transaction to be created or to be adjusted if exists.
*/
public $createOrAdjustTransactionModel;
/**
* @var BatchVoidTransactionModel Represents an existing transaction to be voided.
*/
Expand Down Expand Up @@ -11631,24 +11665,6 @@ class BulkLockTransactionResult
*/
public $numberOfRecords;
}
/**
* Create or adjust transaction model
*/
class CreateOrAdjustTransactionModel
{
/**
* @var string A reason code indicating why this adjustment was made (See AdjustmentReason::* for a list of allowable values)
*/
public $adjustmentReason;
/**
* @var string If the AdjustmentReason is "Other", specify the reason here. This is required when the AdjustmentReason is 8 (Other).
*/
public $adjustmentDescription;
/**
* @var CreateTransactionModel The create transaction model to be created or updated. If the transaction does not exist, create transaction. If the transaction exists, adjust the existing transaction.
*/
public $createTransactionModel;
}
/**
* This model contains a reconstructed CreateTransaction request object that could potentially be used
* to recreate this transaction.
Expand Down Expand Up @@ -11737,7 +11753,7 @@ class RemoveTransactionLineModel
*/
public $documentType;
/**
* @var string[] List of lines to be added
* @var string[] List of line numbers to be removed
*/
public $lines;
/**
Expand Down

0 comments on commit 70eeb60

Please sign in to comment.