Save a card/v1/customers/{customer_id}/cardsStore the card reference used by the customer in the payment securely on our servers to avoid asking for all the data in future transactions.
POST
Request's parameters
customer_idstring
Localization: pathCustomer's IdREQUIRED
token
Localization: bodyCard Tokenstring
Response parameters
id
Localization: bodyidstring
expiration_month
Localization: bodyexpiration_monthnumber
expiration_year
Localization: bodyexpiration_yearnumber
first_six_digits
Localization: bodyfirst_six_digitsstring
Request
curl
curl -X POST \
'https://api.mercadopago.com/v1/customers/{customer_id}/cards' \
-H 'Authorization: Bearer ACCESS_TOKEN_ENV' \
-d '{
"token": "9b2d63e00d66a8c721607214ceda233a"
}'
Answer
json
{
"id": 1562188766852,
"expiration_month": 6,
"expiration_year": 2023,
"first_six_digits": 423564,
"last_four_digits": 5682,
"payment_method": {
"id": "visa",
"name": "visa",
"payment_type_id": "credit_card",
"thumbnail": "http://img.mlstatic.com/org-img/MP3/API/logos/visa.gif",
"secure_thumbnail": "https://www.mercadopago.com/org-img/MP3/API/logos/visa.gif"
},
"security_code": {
"length": 3,
"card_location": "back"
},
"issuer": {
"id": 25,
"name": "Visa"
},
"cardholder": {
"name": "APRO",
"identification": {
"number": 19119119100,
"type": "CPF"
}
},
"date_created": "2019-07-03T21:15:35.000Z",
"date_last_updated": "2019-07-03T21:19:18.000Z",
"customer_id": "448870796-7ZjwhKGxILixxN",
"user_id": 448870796,
"live_mode": true
}
Errors
400bad_request
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
140
150
200
201
202
203
204
205
206
207
208
401bad_request
unauthorized
404bad_request
not_found
Was this information helpful?