ACP2E-4156: REST API shipping address validation ignores Admin attribute configuration
The ACP2E-4156 patch fixes the issue where shipping address validation in the REST API does not adhere to the attribute configuration defined in Admin. This patch is available when the Quality Patches Tool (QPT) 1.1.80 is installed. The patch ID is ACP2E-4156. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.9.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.8-p4
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.8 - 2.4.8-p5
magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
In the REST API, shipping address validation does not honor the customer address attribute settings configured in Admin.
Steps to reproduce:
-
Go to Stores > Attributes > Customer Address in the Admin panel.
-
Open the attribute with the attribute code firstname.
-
Under Attribute Properties, set:
- Input Validation: Length Only.
- Minimum Text Length: 1.
- Maximum Text Length: 20.
-
Go to the storefront and add the test product to the cart.
-
Send a REST API request to
/rest/default/V1/guest-carts/cartId/shipping-informationto add or update shipping information with a firstname value longer than 20 characters.
Expected results:
An error is returned indicating that the firstname value exceeds the configured length limit.
Actual results:
The shopping cart shipping information is successfully updated with the firstname value sent in the REST API request.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide.