Home
Documentation
Resources
Certifications
Community

Resources

Check for updates on our solutions and system performance, or request technical support.

Community

Get the latest news, ask others for help and share your knowledge.

Create customer - Customers - Mercado Pago Developers

Intelligent search powered by OpenAI 

Create customer

POST

https://api.mercadopago.com/v1/customers
Create a customer with all its data and save the cards used to simplify the payment process.
Request's parameters
BODY
email
String

REQUIRED

Customer's email.
first_name
String
Customer's name.
last_name
String
Customer's last name.
phone
object
Customer phone's information.
Response parameters
id
string
Customer ID.
email
string
Customer's email.
first_name
string
Customer's name.
last_name
string
Customer's last name.
Errors

400Error

100

the credentials are required.

101

the customer already exist.

102

missing customer id.

103

parameter must be an object

104

parameter length is too large.

105

the customer id is invalid.

106

the email format is invalid.

107

the first_name is invalid.

108

the last_name is invalid.

109

the phone.area_code is invalid.

110

the phone.number is invalid.

111

the identification.type is invalid.

112

the identification.number is invalid.

113

the address.zip_code is invalid.

114

the address.street_name is invalid.

115

the date_registered format is invalid.

116

the description is invalid.

117

the metadata is invalid.

118

the body must be a Json Object.

119

the card is required.

120

card not found.

121

the card is invalid.

122

the card data is invalid.

123

the payment_method_id is required.

124

the issuer_id is required.

125

invalid parameters.

126

invalid parameter. You cannot update the email.

127

invalid parameter. Cannot resolve the payment method of card, check the payment_method_id and issuer_id.

128

the email format is invalid. Use 'test_payer_[0-9]{1,10}@testuser.com'.

129

the customer has reached the maximum allowed number of cards.

140

invalid card owner.

150

invalid users involved.

200

invalid range format (range=:date_parameter:after::date_from,before::date_to).

201

range attribute must belong to date entity.

202

invalid 'after' parameter. It should be date[iso_8601].

203

invalid 'before' parameter. It should be date[iso_8601].

204

invalid filters format.

205

invalid query format.

206

attributes to sort must belong to 'customer' entity.

207

order filter must be 'asc' or 'desc'.

208

invalid 'sort' parameter format.

214

invalid zip code.

401Error

unauthorized

unauthorized.

404Error

not_found

not_found.

Request
curl -X POST \
    'https://api.mercadopago.com/v1/customers'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer TEST-5599*********291-02171*********139a4791e*********f7f5835-1*********' \
    -d '{
  "email": "jhon@doe.com",
  "first_name": "Jhon",
  "last_name": "Doe",
  "phone": {
    "area_code": "55",
    "number": "991234567"
  },
  "identification": {
    "type": "CPF",
    "number": "12345678900"
  },
  "default_address": "Home",
  "address": {
    "id": "123123",
    "zip_code": "01234567",
    "street_name": "Rua Exemplo",
    "street_number": 123,
    "city": {}
  },
  "date_registered": "2021-10-20T11:37:30.000-04:00",
  "description": "Description del user",
  "default_card": "None"
}'
Sample answer
{
  "id": "000000001-sT93QZFAsfxU9P5",
  "email": "jhon@doe.com",
  "first_name": "Bruce",
  "last_name": "Wayne",
  "phone": {
    "area_code": 23,
    "number": 12345678
  },
  "identification": {
    "type": "DNI",
    "number": 12345678
  },
  "address": {
    "id": "1162600094",
    "zip_code": "SG1 2AX",
    "street_name": "Old Knebworth Ln"
  },
  "description": "This is my description",
  "date_created": "2018-02-20T15:36:23.541Z",
  "metadata": {
    "source_sync": "source_ws"
  },
  "default_address": "1162600094",
  "cards": [
    {}
  ],
  "addresses": [
    {}
  ],
  "live_mode": true
}