-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Customer data with REST API #21237
Comments
Hi @judaschwartz. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @judaschwartz do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @judaschwartz. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @judaschwartz, here is your Magento instance. |
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
|
✅ Confirmed by @engcom-backlog-nazar Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
I created a PR to fix this |
I have exactly the same issue. Please fix. |
I made a PR to fix this over a year ago, someone put the PR on hold maybe if you comment on that PR #21236 that will get it unstuck and merged |
... unbelievable ... |
please fix it |
Hi @engcom-Charlie. Thank you for working on this issue.
|
Hi @judaschwartz. Thank you for your report.
The fix will be available with the upcoming 2.4.1 release. |
Preconditions (*)
Steps to reproduce (*)
When using the API to update a customer
curl -X PUT "https://example.com/index.php/rest/all/V1/customers/8" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -d "{ "customer": { "middlename": "string" }}"
Expected result (*)
The customer should be updated for those fields just as when using the API to update a product a PUT request like this
curl -X PUT "https://example.com/index.php/rest/all/V1/products/24-MB01" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -d "{ "product": { "visibility": 3 }}"
updates the visibility for the product with that SKU (as one would expect) however when i try to make a similar update to a customer with a PUT request i get:
Actual result (*)
I get a 400 error with
"message": "The customer email is missing. Enter and try again."
the API to update only works if i add all of the required data like this:curl -X PUT "https://example.com/index.php/rest/all/V1/customers/8" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -d "{ "customer": { "id": "8", "firstname": "Jon", "lastname": "Smith", "email": "Jjsmith@gmail.com", "middlename": "jac", "store_id": 1, "website_id": 1 }}"
if I leave any of these values out i get an error with the exception of
id
which if left out creates a new record or throws an error if the email already exists (despite theid
being specified at the end of the URL) also whenid
is passed in with the data that IDs record is updated even if it is not theid
at the end of the URLThis does not seem to be the way the API should operate any help or explanation of whats going on would be appreciated.
The text was updated successfully, but these errors were encountered: