Description
Preconditions (*)
- 2.3.0 (have not tested previous versions)
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": "[email protected]", "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 the id
being specified at the end of the URL) also when id
is passed in with the data that IDs record is updated even if it is not the id
at the end of the URL
This does not seem to be the way the API should operate any help or explanation of whats going on would be appreciated.