🛒 Ecommerce
Update address
The API endpoint allows a logged-in user to update their address based on the addressId provided.
This functionality ensures that users can only update their own addresses within the context of an ecommerce application.
By accessing this endpoint and providing the addressId of the address to be updated and necessary fields, the logged-in user can modify the address details such as street, city, state, or postal code etc.
patch/ecommerce/addresses/{addressId}
Request body
Example request
{
"addressLine1": "New lane central, D-203",
"addressLine2": "Opposite to central park (Optional)",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India"
}Response
Update address
Example response
{
"data": {
"_id": "647af1707396af90865b0edd",
"addressLine1": "Updated MG Road, D-203",
"addressLine2": "Andheri",
"city": "Mumbai",
"country": "India2",
"createdAt": "2023-06-03T07:53:20.717Z",
"owner": "6476e34ebe1cfb9cc08bd446",
"pincode": "409300",
"state": "Maharashtra",
"updatedAt": "2023-06-03T08:01:32.767Z"
},
"message": "Address updated successfully",
"statusCode": 200,
"success": true
}