# Update address This endpoint allows you to update the data of an existing address. You must send the customer ID and the address ID in the path, and in the request body the fields you want to update (zip code, street name, city, state, country, and optional fields). In case of success, the request will return a response with status 200 containing the updated address. **PUT** `/v1/customers/{id}/addresses/{address_id}` ## Request parameters ### Path - `id` (string, required) Customer ID. - `address_id` (string, required) Address ID. - `zip_code` (string, optional) Postal code of the address. Max length: 255. Alphanumeric only: A-Z, a-z, 0-9, hyphen, underscore. No spaces or accents. - `street_name` (string, optional) Street name. Max length: 255. ASCII only (no accents, e.g. no ñ, ã, é). - `street_number` (number, optional) Street number. Integer. If provided, must be positive (greater than zero). - `name` (string, optional) Address name/label. Max length: 255. Letters (including accents), spaces, apostrophe, hyphen. No numbers or symbols (@, #, etc.). - `phone` (string, optional) Phone number associated with the address. Max length: 255. Alphanumeric only: A-Z, a-z, 0-9, hyphen, underscore. No spaces or accents. - `floor` (string, optional) Floor number. Max length: 255. Letters (including accents), spaces, apostrophe, hyphen. ASCII also allowed. - `apartment` (string, optional) Apartment identifier. Max length: 255. Letters (including accents), spaces, apostrophe, hyphen. No numbers or symbols (@, #, etc.). - `comments` (string, optional) Additional information about the address. Max length: 255. Letters (including accents), spaces, apostrophe, hyphen. No numbers or symbols (@, #, etc.). - `city` (object, optional) City information. - `city.id` (string, optional) City ID. - `city.name` (string, optional) City name. - `state` (object, optional) State information. - `state.id` (string, optional) State ID. - `state.name` (string, optional) State name. - `neighborhood` (object, optional) Neighborhood information. - `neighborhood.id` (string, optional) Neighborhood ID. - `neighborhood.name` (string, optional) Neighborhood name. - `municipality` (object, optional) Municipality information. - `municipality.id` (string, optional) Municipality ID. - `municipality.name` (string, optional) Municipality name. ## Response parameters - `id` (string, optional) Address ID. - `phone` (string, optional) Phone number associated with the address. - `name` (string, optional) Address name/label. - `floor` (string, optional) Floor number. - `apartment` (string, optional) Apartment identifier. - `street_name` (string, optional) Street name. Max length: 255. ASCII only (no accents, e.g. no ñ, ã, é). - `street_number` (number, optional) Street number. - `zip_code` (string, optional) Postal code of the address. Max length: 255. Alphanumeric only: A-Z, a-z, 0-9, hyphen, underscore. No spaces or accents. - `city` (object, optional) City information. - `city.id` (string, optional) City ID. - `city.name` (string, optional) City name. - `state` (object, optional) State information. - `state.id` (string, optional) State ID. - `state.name` (string, optional) State name. - `country` (object, optional) Country information. - `country.id` (string, optional) Country ID. - `country.name` (string, optional) Country name. - `neighborhood` (object, optional) Neighborhood information. - `neighborhood.id` (string, optional) Neighborhood ID. - `neighborhood.name` (string, optional) Neighborhood name. - `municipality` (object, optional) Municipality information. - `municipality.id` (string, optional) Municipality ID. - `municipality.name` (string, optional) Municipality name. - `comments` (string, optional) Additional information about the address. - `date_created` (string, optional) Address creation date. - `date_last_updated` (string, optional) Last modified date. - `normalized` (boolean, optional) Whether the address is normalized. - `live_mode` (boolean, optional) Whether the address is in sandbox or production mode. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | 100 | The credentials are required. Provide a valid access token in the Authorization header. | | 400 | 214 | The zip code format is invalid. Provide a valid postal code according to the country's format. | | 400 | 217 | The parameter must be a string. Check the data type of the field and ensure it is sent as a string. | | 400 | 222 | The parameter length exceeds the maximum allowed or must be a positive value. Check the field length and value constraints. | | 400 | validation_error | Validation error. One or more fields failed validation. Check the request body and ensure all required fields are correctly formatted. | | 401 | unauthorized | Unauthorized access. The provided access token is invalid or expired. Verify your credentials and try again. | | 404 | not_found | The requested resource was not found. Verify that the customer ID and address ID are correct and that the address exists. | | 500 | internal_error | Internal server error. Please try again later or contact support if the issue persists. | ## Request example ### cURL ```bash curl -X PUT \ 'https://api.mercadopago.com/v1/customers/{id}/addresses/{address_id}' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "zip_code": "01234567", "street_name": "Rua Exemplo", "street_number": 123, "name": "Home", "phone": "11987654321", "floor": "3", "apartment": "A", "comments": "Near the park", "city": { "id": "BR-SP-44", "name": "São Paulo" }, "state": { "id": "BR-SP", "name": "São Paulo" }, "neighborhood": { "id": "string", "name": "Jardim Ipanema" }, "municipality": { "id": "string", "name": "string" } }' ``` ## Response example ```json { "id": "1162600213", "phone": "string", "name": "string", "floor": "string", "apartment": "string", "street_name": "Rua Exemplo", "street_number": 0, "zip_code": "01234567", "city": { "id": "BR-SP-44", "name": "São Paulo" }, "state": { "id": "BR-SP", "name": "São Paulo" }, "country": { "id": "BR", "name": "Brasil" }, "neighborhood": { "id": "string", "name": "Jardim Ipanema" }, "municipality": { "id": "string", "name": "string" }, "comments": "string", "date_created": "2021-03-16T15:45:17.000-04:00", "date_last_updated": "string", "normalized": false, "live_mode": true } ```