Salvar um cartão/v1/customers/{customer_id}/cardsArmazena com segurança em nossos servidores a referência a um cartão utilizado pelo cliente no pagamento para evitar pedir todos os dados em transações futuras.
POST
Parâmetros de requisição
customer_idstring
Localização: pathCustomer's IdOBRIGATÓRIO
token
Localização: bodyCard Tokenstring
Parâmetros de resposta
id
Localização: bodyidstring
expiration_month
Localização: bodyexpiration_monthnumber
expiration_year
Localização: bodyexpiration_yearnumber
first_six_digits
Localização: bodyfirst_six_digitsstring
Solicitação
curl
curl -X POST \
'https://api.mercadopago.com/v1/customers/{customer_id}/cards' \
-H 'Authorization: Bearer ACCESS_TOKEN_ENV' \
-d '{
"token": "9b2d63e00d66a8c721607214ceda233a"
}'
Resposta
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
}
Erros
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
Essas informações foram úteis?