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
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the 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:

  1. Go to Stores > Attributes > Customer Address in the Admin panel.

  2. Open the attribute with the attribute code firstname.

  3. Under Attribute Properties, set:

    1. Input Validation: Length Only.
    2. Minimum Text Length: 1.
    3. Maximum Text Length: 20.
  4. Go to the storefront and add the test product to the cart.

  5. Send a REST API request to /rest/default/V1/guest-carts/cartId/shipping-information to 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:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
commerce-operations-help-tools