# Create customer Create a customer with all its data and save the cards used to simplify the payment process. **POST** `/v1/customers` ## Request parameters - `email` (string, optional) Customer's email. - `first_name` (string, optional) Customer's name. - `last_name` (string, optional) Customer's last name. - `phone` (object, optional) Customer phone's information. - `phone.area_code` (string, optional) Phone's area code. - `phone.number` (string, optional) Phone number. - `identification` (object, optional) Customer identification's information. - `identification.type` (string, optional) Identification type. - `identification.number` (string, optional) Identification number. - `default_address` (string, optional) Customer's default address. - `address` (object, optional) Default address's information. - `address.id` (string, optional) Address ID. - `address.zip_code` (string, optional) Zip code. - `address.street_name` (string, optional) Street name. - `address.street_number` (number, optional) Street number. - `address.city` (object, optional) City. - `address.city.name` (string, optional) City name. For example, Autonomous City of Buenos Aires. - `date_registered` (string, optional) Customer's registration date. - `description` (string, optional) Customer's description. - `default_card` (string, optional) Customer's default card. ## Response parameters - `id` (string, optional) Customer ID. - `email` (string, optional) Customer's email. - `first_name` (string, optional) Customer's name. - `last_name` (string, optional) Customer's last name. - `phone` (object, optional) Customer phone's information. - `phone.area_code` (string, optional) Phone's area code. - `phone.number` (string, optional) Phone number. - `identification` (object, optional) Customer identification's information. - `identification.type` (string, optional) Identification type. - `identification.number` (string, optional) Identification number. - `address` (object, optional) Default address's information. - `address.id` (string, optional) Address ID. - `address.zip_code` (string, optional) Zip code. - `address.street_name` (string, optional) Street name. - `address.street_number` (number, optional) Street number. - `date_registered` (string, optional) Customer's registration date. - `description` (string, optional) Customer's description. - `date_created` (string, optional) Customer's date created. - `date_last_updated` (string, optional) Last modified date. - `metadata` (object, optional) metadata - `metadata.source_sync` (string, optional) - `default_card` (string, optional) Customer's default card. - `default_address` (string, optional) Customer's default address. - `cards` (array, optional) Customer's cards. - `addresses` (array, optional) Customer's addresses. - `live_mode` (boolean, optional) Whether the customers will be in sandbox or in production mode. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | 100 | the credentials are required. | | 400 | 101 | the customer already exist. | | 400 | 102 | missing customer id. | | 400 | 103 | parameter must be an object | | 400 | 104 | parameter length is too large. | | 400 | 105 | the customer id is invalid. | | 400 | 106 | the email format is invalid. | | 400 | 107 | the first_name is invalid. | | 400 | 108 | the last_name is invalid. | | 400 | 109 | the phone.area_code is invalid. | | 400 | 110 | the phone.number is invalid. | | 400 | 111 | the identification.type is invalid. | | 400 | 112 | the identification.number is invalid. | | 400 | 113 | the address.zip_code is invalid. | | 400 | 114 | the address.street_name is invalid. | | 400 | 115 | the date_registered format is invalid. | | 400 | 116 | the description is invalid. | | 400 | 117 | the metadata is invalid. | | 400 | 118 | the body must be a Json Object. | | 400 | 119 | the card is required. | | 400 | 120 | card not found. | | 400 | 121 | the card is invalid. | | 400 | 122 | the card data is invalid. | | 400 | 123 | the payment_method_id is required. | | 400 | 124 | the issuer_id is required. | | 400 | 125 | invalid parameters. | | 400 | 126 | invalid parameter. You cannot update the email. | | 400 | 127 | invalid parameter. Cannot resolve the payment method of card, check the payment_method_id and issuer_id. | | 400 | 128 | the email format is invalid. Use 'test_payer_[0-9]{1,10}@testuser.com'. | | 400 | 129 | the customer has reached the maximum allowed number of cards. | | 400 | 140 | invalid card owner. | | 400 | 150 | invalid users involved. | | 400 | 200 | invalid range format (range=:date_parameter:after::date_from,before::date_to). | | 400 | 201 | range attribute must belong to date entity. | | 400 | 202 | invalid 'after' parameter. It should be date[iso_8601]. | | 400 | 203 | invalid 'before' parameter. It should be date[iso_8601]. | | 400 | 204 | invalid filters format. | | 400 | 205 | invalid query format. | | 400 | 206 | attributes to sort must belong to 'customer' entity. | | 400 | 207 | order filter must be 'asc' or 'desc'. | | 400 | 208 | invalid 'sort' parameter format. | | 400 | 214 | invalid zip code. | | 401 | unauthorized | unauthorized. | | 404 | not_found | not_found. | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v1/customers' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "email": "test@testuser.com", "first_name": "Sofia", "last_name": "Rodríguez", "phone": { "area_code": "1", "number": "300-1234567" }, "identification": { "type": "NIT", "number": "12345678900" }, "default_address": "Home", "address": { "id": "123123", "zip_code": "110221", "street_name": "Rua Exemplo", "street_number": 123, "city": { "name": "string" } }, "date_registered": "2021-10-20T11:37:30.000-04:00", "description": "Description del user", "default_card": "None" }' ``` ## Response example ```json { "id": "000000001-sT93QZFAsfxU9P5", "email": "test@testuser.com", "first_name": "Sofia", "last_name": "Rodríguez", "phone": { "area_code": "1", "number": "300-1234567" }, "identification": { "type": "NIT", "number": 12345678 }, "address": { "id": "1162600094", "zip_code": "110221", "street_name": "Old Knebworth Ln", "street_number": 0 }, "date_registered": "string", "description": "This is my description", "date_created": "2018-02-20T15:36:23.541Z", "date_last_updated": "string", "metadata": { "source_sync": "source_ws" }, "default_card": "string", "default_address": "1162600094", "cards": [ {} ], "addresses": [ {} ], "live_mode": true } ```