Updating customer via API resets default billing adres
Preconditions
Magento 2.1 A customer with a default billing adres set
Steps to reproduce
- Update firstname and lastname via the API.
PUT /rest/v1/customers/1
{"customer":{"id":1,"email":"[email protected]","firstname":"Paul","lastname":"Boss","middlename":null,"gender":0}}
Expected result
- Customer with id 1 has firstname "Paul" and lastname "Boss". Other data is left intact
Actual result
- Default billing address option is reset. The address is stil available, but the "default billing address" option is now false.
Same goes for Default shipping addresses.
Workaround would be to fetch the customer before updating and setting the default_billing and default_shipping values in the PUT request.
Makes me wonder what other data is lost when using partial PUT requests.
Hi, thank you for your request. Internal ticket MAGETWO-59872 was created
as workaround can advice to modify put data and add:
"default_billing": <address_id> , "default_shipping": <address_id>
This issue was fixed in develop branch. It also was fixed for ver. 2.1 in internal ticket MAGETWO-61907 and for ver. 2.0 in internal ticket MAGETWO-61908. Fixes will be available in one of the nearest releases.
@PaulBoss, thank you for your report. The issue is already fixed in 2.2.0
Still face the same issue on 2.2.1 (enterprise edition)