Actualizar preferencia
PUT
Productos que lo utilizan:
Parámetros para la solicitud
PATH
id
The preference's IDstring
REQUERIDO
BODY
items
Información sobre el Ãtem.array
payer
Información del comprador, como nombre, apellido, correo electrónico, teléfono, identificación personal, dirección y fecha de registro.object
payment_methods
Toda la configuración relacionada con los métodos de pago, tales como los métodos de pago excluidos, los tipos de pago excluidos, el método de pago predeterminado y las cuotas.object
shipments
Información de envÃo.object
Parámetros de respuesta
additional_info
Información adicionalstring
auto_return
En el caso de estar especificado, el comprador será redirigido automáticamente al sitio del vendedor después de que la compra sea aprobada con tarjeta de crédito.String
approved: El redireccionamiento solo ocurre para pagos aprobados con tarjeta de crédito.
all: El redireccionamiento se realiza únicamente para pagos aprobados con tarjeta de crédito, compatibilidad con versiones posteriores solo si cambiamos el comportamiento predeterminado.
back_urls
URLs de retorno al sitio del vendedor, ya sea automáticamente ("auto_return") o a través del botón 'Volver al sitio', según el estado del pago. Es obligatorio el uso del protocolo ("https") en la URL.object
binary_mode
Cuando está activado, el pago sólo puede resultar aprobado o rechazado. De lo contrario, el pago puede resultar pendiente.boolean
Errores
400Error
invalid_collector_id
collector_id invalid.
invalid_sponsor_id
sponsor_id is not an active user.
invalid_collector_email
collector is not collector_email owner.
invalid_operation_type
operation_type invalid.
invalid_expiration_date_to
expiration_date_to invalid.
invalid_date
invalid date of expiration.
invalid_expiration_date_from
expiration_date_from invalid.
invalid_items
unit_price invalid.
invalid_back_urls
back_urls invalid. Wrong format.
invalid_payment_methods
installments invalid. Should be a number between 1 and 36.
invalid_marketplace_fee
marketplace_fee must not be greater than total amount.
invalid_id
preference_id not found.
invalid_access_token
access denied
invalid_shipments
invalid type (<type>) for field shipments.cost.
Solicitud
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
curl -X PUT \
'https://api.mercadopago.com/checkout/preferences/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"items": [
{
"id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d",
"title": "Dummy Title",
"description": "Dummy Description",
"picture_url": "https://www.myapp.com/myimage.jpg",
"category_id": "cat123",
"quantity": 1,
"currency_id": "U$",
"unit_price": 10
}
],
"payer": {
"phone": {
"number": null
},
"identification": {},
"address": {
"street_number": null
}
},
"payment_methods": {
"excluded_payment_methods": [
{}
],
"excluded_payment_types": [
{}
],
"installments": null,
"default_installments": null
},
"shipments": {
"local_pickup": false,
"default_shipping_method": null,
"free_methods": [
{
"id": null
}
],
"cost": null,
"free_shipping": false,
"receiver_address": {
"street_number": null
}
},
"back_urls": {},
"auto_return": "approved",
"expires": false,
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"marketplace_fee": 0,
"differential_pricing": {
"id": null
},
"metadata": {}
}'
Respuesta de ejemplo
{
"auto_return": "approved",
"back_urls": {},
"binary_mode": false,
"client_id": 6295877106812064,
"collector_id": 202809963,
"coupon_code": {},
"coupon_labels": {},
"date_created": "2018-02-02T19:22:23.535Z",
"date_of_expiration": {},
"expiration_date_from": "2022-11-17T09:37:52.000-04:00",
"expiration_date_to": "2022-11-17T10:37:52.000-05:00",
"expires": false,
"id": "202809963-920c288b-4ebb-40be-966f-700250fa5370",
"init_point": "https://www.mercadopago.com/mla/checkout/start?pref_id=202809963-920c288b-4ebb-40be-966f-700250fa5370",
"internal_metadata": {},
"items": [
{
"title": "Dummy Item",
"description": "Multicolor Item",
"currency_id": "$",
"quantity": 1,
"unit_price": 10
}
],
"marketplace": "MP-MKT-6295877106812064",
"marketplace_fee": 0,
"metadata": {},
"notification_url": "https://url.com.br/notificacao",
"payer": {
"phone": {},
"address": {
"street_name": "Mc Street",
"street_number": "7304"
},
"identification": {},
"last_purchase": {}
},
"payment_methods": {
"default_card_id": {},
"excluded_payment_methods": [
{
"id": ""
}
],
"excluded_payment_types": [
{
"id": ""
}
]
},
"processing_modes": {},
"product_id": {},
"redirect_urls": {},
"sandbox_init_point": "https://sandbox.mercadopago.com/mla/checkout/pay?pref_id=202809963-920c288b-4ebb-40be-966f-700250fa5370",
"site_id": "MLB",
"shipments": {
"default_shipping_method": {},
"receiver_address": {
"city_name": {},
"state_name": {}
}
},
"total_amount": {},
"last_updated": {},
"statement_descriptor": "MERCADOPAGO"
}