Create address

This endpoint allows you to create a new address for a specific customer. You must send the customer ID in the path and the address data (zip code, street name, city, state, country, and optional fields such as street number, floor, apartment, and comments) in the request body. In case of success, the request will return a response with status 201.

POST

https://api.mercadopago.com/v1/customers/{id}/addresses
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
Path
id
string

REQUIRED

Customer ID.
Body
zip_code
string

REQUIRED

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

REQUIRED

Street name. Max length: 255. ASCII only (no accents, e.g. no ñ, ã, é).
street_number
number
Street number. Integer. If provided, must be positive (greater than zero).
name
string
Address name/label. Max length: 255. Letters (including accents), spaces, apostrophe, hyphen. No numbers or symbols (@, #, etc.).
Response parameters
id
string
Address ID.
phone
string
Phone number associated with the address.
name
string
Address name/label.
floor
string
Floor number.
Errors

400Request error.

100

The credentials are required. Provide a valid access token in the Authorization header.

209

A required parameter cannot be null. Check that all mandatory fields are provided with valid values.

214

The zip code format is invalid. Provide a valid postal code according to the country's format.

217

The parameter must be a string. Check the data type of the field and ensure it is sent as a string.

222

The parameter length exceeds the maximum allowed or must be a positive value. Check the field length and value constraints.

validation_error

Validation error. One or more fields failed validation. Check the request body and ensure all required fields are correctly formatted.

401Error. Access Token not authorized.

unauthorized

Unauthorized access. The provided access token is invalid or expired. Verify your credentials and try again.

404Error. Requested resource not found.

not_found

The requested resource was not found. Verify that the customer ID and address ID are correct and that the address exists.

500Generic error.

internal_error

Internal server error. Please try again later or contact support if the issue persists.

Request
curl -X POST \
    'https://api.mercadopago.com/v1/customers/{id}/addresses'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
    -d '{
  "zip_code": "11300",
  "street_name": "Rua Exemplo",
  "street_number": 1294,
  "name": "Home",
  "phone": "1234-5678",
  "floor": "3",
  "apartment": "A",
  "comments": "Near the park",
  "city": {
    "id": "BR-SP-44",
    "name": "Montevideo"
  },
  "state": {
    "id": "BR-SP",
    "name": "Montevideo"
  },
  "neighborhood": {
    "name": "Pocitos"
  }
}'
Response
{
  "id": "1162600213",
  "phone": "1234-5678",
  "name": "Home",
  "floor": "3",
  "apartment": "A",
  "street_name": "Rua Exemplo",
  "street_number": "1294",
  "zip_code": "11300",
  "city": {
    "id": "BR-SP-44",
    "name": "Montevideo"
  },
  "state": {
    "id": "BR-SP",
    "name": "São Paulo"
  },
  "country": {
    "id": "UY",
    "name": "Uruguay"
  },
  "neighborhood": {
    "name": "Pocitos"
  },
  "municipality": {},
  "comments": "Near the park",
  "date_created": "2021-03-16T15:45:17.000-04:00",
  "normalized": true,
  "live_mode": true,
  "verifications": {}
}