Address-type being sent on the request on Magento 2
Correct address type validation issues in Magento 2 for accurate shipping requests
Table of Contents
Overview
When using address validation, you might notice the address type isn't validated by ShipperHQ's address validation feature. Instead, the address type is sent in the request within the "options" field on the destination details.
```json
"destination": {
"country": "US",
"region": "AR",
"city": "Monticello",
"street": "12802 Tomanet RD",
"street2": null,
"zipcode": "71655",
"accessorials": null,
"selectedOptions": {
"options": [
{
"name": "destination_type",
"value": "RESIDENTIAL"
}
]
}
}
This setup prevents the system from triggering an address validation request to return the correct address type. 😊
Solution
To resolve this, follow these steps:
- Query the Magento
sales_order
table. - Locate and delete the stored address types in the "destination_type" column.
Important Notes
- Once you remove the address type from the specified table/column, trigger a new request.
- The system will then validate the address correctly and communicate it back to Magento without specifying an incorrect address type. 💡
Ensuring the address type is not pre-set allows the address validation feature to function seamlessly, improving accuracy and reliability. 😊