Does the Magento 2 REST API support updating a single customer address?
This endpoint is incomplete: customerAddressRepositoryV1
GET /V1/customers/addresses/{addressId}
DELETE /V1/addresses/{addressId}
This endpoint allows adding/updating of addresses: customerCustomerRepositoryV1:
PUT /V1/customers/{id}
To update an existing address specify the address id property (table customer_address_entity column entity_id). For example, to update address id = 16:
{
"customer": {
"email": "[email protected]",
"firstname": "Test",
"lastname": "Test",
"store_id": 1,
"website_id": 1,
"addresses": [{
"id": 16,
"customerId": 1,
"region": {
"region_code": "CA",
"region": "California"
},
"region_id": 12,
"countryId": "US",
"street": [
"123 Test St."
],
"telephone": "555 555 5555",
"postcode": "90210",
"city": "Beverly Hills",
"defaultShipping": false,
"defaultBilling": true
}]
}
}
However, if a customer has more than one address then all other addresses are deleted from the customer. We want to update the address (but NOT delete other addresses). It also seems redundant to have to pass customer information e.g. email. If this feature doesn't exist we'll need to create our own endpoint.