avadev / AvaTax-REST-V2-PHP-SDK

Sales Tax API SDK for PHP and AvaTax REST
https://developer.avalara.com/sdk/
Apache License 2.0
48 stars 96 forks source link

Address model cannot be set with locationCode #188

Closed gm-lunatix closed 1 year ago

gm-lunatix commented 2 years ago

I am trying to create a transaction with the main address to be:

    "addresses": {
        "singleLocation": {
            "locationCode": "DEFAULT"
        }
    },

In version 22.9.0 the transactionbuilder has a withAddress() method but it does not accept locationCode (https://developer.avalara.com/api-reference/avatax/rest/v2/models/AddressLocationInfo/) only the explicit address parameters (@TransactionBuilder.php line 294):

public function withAddress($type, $line1, $line2, $line3, $city, $region, $postalCode, $country)
    {
        if (empty($this->_model['addresses'])) $this->_model['addresses'] = [];
        $ai = [
            'line1' => $line1,
            'line2' => $line2,
            'line3' => $line3,
            'city' => $city,
            'region' => $region,
            'postalCode' => $postalCode,
            'country' => $country
        ];
        $this->_model['addresses'][$type] = $ai;
        return $this;
    }

Am I missing something here (maybe another withXXXX() method for address location code) or this feature does not exist yet?

svc-developer commented 1 year ago

Should be fixed with release for 23.4.1