ACSD-50368: Customers group_id is ignored when a customer is created via Async REST API or Async Bulk REST API
The ACSD-50368 patch fixes the issue where customers group_id is ignored when a customer is created via Async REST API or Async Bulk REST API. This patch is available when the Quality Patches Tool (QPT) 1.1.33 is installed. The patch ID is ACSD-50368. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.7.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.4
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.3 - 2.4.4-p4
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
Customers group_id is ignored when a customer is created via Async REST API or Async Bulk REST API.
Prerequisites:
Configure RabbitMQ for processing queues:
bin/magento setup:config:set --amqp-host=services --amqp-port=5672 --amqp-user=guest --amqp-password=guest
bin/magento setup:upgrade --keep-generated
Steps to reproduce
-
Use an Async Rest API request to create a customer:
code language-none curl --location 'https://site.test/rest/default/async/V1/customers' \ --header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjEsInV0eXBpZCI6MiwiaWF0IjoxNjc5NDMzNzcxLCJleHAiOjE2Nzk0MzczNzF9.xau6KyILrkdCY_8K8aMlH4TmqcCXdH4Zcst_CLhdxYY' \ --header 'Content-Type: application/json' \ --header 'Cookie: PHPSESSID=844fltmqq1g15qe4ju3l00tiai' \ --data-raw '{ "customer": { "email": "foo@bar.test", "firstname": "Test", "lastname": "User", "group_id": 2 } }
-
A similar response is returned:
code language-none { "bulk_uuid": "b101ddcb-b7fd-4208-a2a6-2e84c9e61bcd", "request_items": [ { "id": 0, "data_hash": "6e718a93b02a30a98cb994d1c4e8cf1eeedcb962f384e4a463c" , "status": "accepted" } ], "errors": false }
-
Check the status of this asynchronous request:
code language-none curl --location 'https://site.test/rest/default/V1/bulk/b101ddcb-b7fd-4208-a2a6-2e84c9e61bcd/detailed-status' \ --header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjEsInV0eXBpZCI6MiwiaWF0IjoxNjc5NDMzNzcxLCJleHAiOjE2Nzk0MzczNzF9.xau6KyILrkdCY_8K8aMlH4TmqcCXdH4Zcst_CLhdxYY' \ --header 'Cookie: PHPSESSID=844fltmqq1g15qe4ju3l00tiai
Expected results:
The group_id is correctly set to 2 for the new customer.
Actual results:
The group_id is set to default 1 for the new customer.
{
"operations_list": [
{
"id": 0,
"bulk_uuid": "b101ddcb-b7fd-4208-a2a6-2e84c9e61bcd",
"topic_name": "async.magento.customer.api.accountmanagementinterface.createaccount.post",
"serialized_data": null,
"result_serialized_data": "{\"id\":4,\"group_id\":1,\"created_at\":\"2023-03-21 22:01:09\",\"updated_at\":\"2023-03-21 22:01:09\",\"created_in\":\"Default Store View\",\"email\":\"foo@bar.test\",\"firstname\":\"Test\",\"lastname\":\"User\",\"store_id\":1,\"website_id\":1,\"addresses\":[],\"disable_auto_group_change\":0,\"extension_attributes\":{\"is_subscribed\":false}}",
"status": 1,
"result_message": "Service execution success Magento\\Customer\\Model\\AccountManagement\\Interceptor::createAccount",
"error_code": null
}
],
"user_type": 2,
"bulk_id": "b101ddcb-b7fd-4208-a2a6-2e84c9e61bcd",
"description": "Topic async.magento.customer.api.accountmanagementinterface.createaccount.post",
"start_time": "2023-03-21 22:01:09",
"user_id": 1,
"operation_count": 1
}
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 released: a new tool to self-serve quality patches in the support knowledge base.
- Check if patch is available for your Adobe Commerce issue using Quality Patches Tool in the Quality Patches Tool guide.
For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.