diff --git a/src/FedexRest/Entity/Address.php b/src/FedexRest/Entity/Address.php index 06c05a4..25b4ac1 100644 --- a/src/FedexRest/Entity/Address.php +++ b/src/FedexRest/Entity/Address.php @@ -81,7 +81,8 @@ public function prepare(): array $address['city'] = $this->city; } if (!empty($this->state_or_province)) { - $address['stateOrProvinceCode'] = $this->state_or_province; + // Truncate the state/province code to work around a limitation in FedEx's API. + $address['stateOrProvinceCode'] = substr($this->state_or_province, 0, 2); } if (!empty($this->postal_code)) { $address['postalCode'] = $this->postal_code;