/checkout/preferences
BASE URI https://api.mercadopago.com/checkout/preferences
HTTP Request
curl
curl -X POST \
'https://api.mercadopago.com/checkout/preferences?access_token=ACCESS_TOKEN_ENV' \
-H 'content-type:application/json' \
-d '{
"items": [
{
"title": "Dummy Item",
"description": "Multicolor Item",
"quantity": 1,
"currency_id": "[FAKER][CURRENCY][ACRONYM]",
"unit_price": 10.0
}
]
}'
Request Params
ParameterTypeDescription
items
Array(Object)
Informações sobre o item.
id
String(256)
Indentificador do item.
title
String(256)
Título do item, é apresentado o fluxo de pagamento.
description
String(256)
Descrição do artigo.
picture_url
String(600)
URL da imagem do anúncio.
category_id
String(256)
Identificador da categoria do item.
quantity
Integer
Quantidade de itens.
currency_id
String(3)
Identificador de moeda em formato ISO_4217.
unit_price
Float
Preço unitário.
payer
Object
Informações sobre o comprador.
name
String(256)
Nome do comprador.
surname
String(256)
Apelido do comprador.
email
String(256)
Endereço de e-mail do comprador.
phone
Object
Telefone do comprador.
area_code
String(256)
Código de área.
number
String(256)
O Número.
identification
Object
Identificação pessoal.
type
String(256)
Tipo de identificação.
number
String(256)
O Número.
address
Object
Endereço do comprador.
zip_code
String(256)
Código postal.
street_name
String(256)
Nome da rua.
street_number
Integer
Número da rua.
date_created
Date(ISO_8601)
Data de registro.
payment_methods
Object
Métodos de pagamento a ser excluídos do fluxo de pagamento.
excluded_payment_methods
Array(Object)
Métodos de pagamento não são permitidos no fluxo de pagamento (à exceção de account_money).
id
String(256)
Identificador do método de pagamento.
excluded_payment_types
Array(Object)
Tipos de pagamento não são permitidos no fluxo de pagamento.
id
String(256)
Identificador de data_type do meio de pagamento.
default_payment_method_id
String(256)
Meio de pagamento preferido.
installments
Integer
Número Máximo de cotas.
default_installments
Integer
Preferência de cotas.
shipments
Object
Informações de envio.
mode
String
Modo de envio.
custom
Custom shipping.
me2
Mercado Envíos.
not_specified
Shipping mode not specified.
local_pickup
Boolean
Preferência de remoção de pacotes em agência(mode:me2 somente).
dimensions
String
Tamanho do pacote em cm x cm x cm, gr (mode:me2 somente)
default_shipping_method
Integer
Escolha um método de envio padrão no _checkout_(mode:me2 somente).
free_methods
Array(Object)
Oferecer um método de frete grátis (mode:me2 somente).
id
Integer
Identificador do método de envio.
cost
Float
Custo do transporte (mode:custom somente).
free_shipping
Boolean
Preferência de frete grátis para mode:custom.
receiver_address
Object
Endereço de envio.
zip_code
String(256)
Código postal.
street_name
String(256)
Rua.
street_number
Integer
O Número.
floor
String(256)
Apartamento.
apartment
String(256)
Apartamento.
back_urls
Object
Url de retorno ao site do vendedor.
success
String(600)
URL de retorno ante o pagamento aprovado.
pending
String(600)
URL de retorno diante de pagamento pendente.
failure
String(600)
URL de retorno ante o pagamento cancelado.
notification_url
String(500)
URL para a qual você gostaria de receber notificações de pagamentos.
additional_info
String(600)
Informações adicionais.
auto_return
String
No caso de estar especificado o comprador será redirecionado para o seu site imediatamente após a compra.
approved
The redirection takes place only for approved payments.
all
The redirection takes place only for approved payments, forward compatibility only if we change the default behavior
external_reference
String(256)
Referência que pode sincronizar com seu sistema de pagamentos.
expires
Boolean
Preferência que determina se uma preferência expira.
expiration_date_from
Date(ISO_8601)
Data a partir da qual a preferência estará ativa.
expiration_date_to
Date(ISO_8601)
Data em que a preferência expira.
marketplace
String(256)
Origem do pagamento. Valor por defeito: NENHUM
marketplace_fee
Float
Comissão de Mercado cobrada pelo proprietário do aplicativo. Valor por defeito: 0 em moeda local
differential_pricing
Object
Configuração de preço diferencial para esta preferência.
id
Integer
Identificador de preço diferenciado.
HTTP Response
json
{
"collector_id": 202809963,
"operation_type": "regular_payment",
"items": [
{
"id": "",
"picture_url": "",
"title": "Dummy Item",
"description": "Multicolor Item",
"category_id": "",
"currency_id": "[FAKER][CURRENCY][ACRONYM]",
"quantity": 1,
"unit_price": 10
}
],
"payer": {
"name": "",
"surname": "",
"email": "",
"date_created": "",
"phone": {
"area_code": "",
"number": ""
},
"identification": {
"type": "",
"number": ""
},
"address": {
"street_name": "",
"street_number": null,
"zip_code": ""
}
},
"back_urls": {
"success": "",
"pending": "",
"failure": ""
},
"auto_return": "",
"payment_methods": {
"excluded_payment_methods": [
{
"id": ""
}
],
"excluded_payment_types": [
{
"id": ""
}
],
"installments": null,
"default_payment_method_id": null,
"default_installments": null
},
"client_id": "6295877106812064",
"marketplace": "MP-MKT-6295877106812064",
"marketplace_fee": 0,
"shipments": {
"receiver_address": {
"zip_code": "",
"street_number": null,
"street_name": "",
"floor": "",
"apartment": ""
}
},
"notification_url": null,
"external_reference": "",
"additional_info": "",
"expires": false,
"expiration_date_from": null,
"expiration_date_to": null,
"date_created": "2018-02-02T15:22:23.535-04:00",
"id": "202809963-920c288b-4ebb-40be-966f-700250fa5370",
"init_point": "https://www.mercadopago.com/mla/checkout/start?pref_id=202809963-920c288b-4ebb-40be-966f-700250fa5370",
"sandbox_init_point": "https://sandbox.mercadopago.com/mla/checkout/pay?pref_id=202809963-920c288b-4ebb-40be-966f-700250fa5370"
}
Error Codes
CodeDescription
400 bad_request
invalid_collector_id
collector_id must be a number.
invalid_collector_id
collector_id invalid.
invalid_sponsor_id
sponsor_id not found.
invalid_sponsor_id
sponsor_id must be a number
invalid_sponsor_id
sponsor_id should be different than collector_id.
invalid_sponsor_id
sponsor_id site must be the same as collector_id.
invalid_sponsor_id
sponsor_id didn't accept MercadoPago's Terms and Conditions.
invalid_sponsor_id
sponsor_id is not an active user.
invalid_collector_email
collector is not collector_email(secure) owner
invalid_collector_email
collector is not collector_email owner
invalid_operation_type
operation_type invalid.
invalid_expiration_date_to
expiration_date_to invalid.
invalid_expiration_date_from
expiration_date_from invalid.
invalid_items
amount cannot be paid with Mercado Pago.
invalid_items
items needed.
invalid_items
items invalid. Wrong format
invalid_items
currency_id needed.
invalid_items
currency_id invalid.
invalid_items
quantity needed.
invalid_items
quantity must be a number.
invalid_items
unit_price needed.
invalid_items
unit_price must be a number.
invalid_items
unit_price invalid.
invalid_payer
payer invalid. Wrong format
invalid_payer
payer name invalid. Max length 100.
invalid_payer
payer surname invalid. Max length 100.
invalid_payer
payer email invalid. Max length 150.
invalid_back_urls
back_urls invalid. Wrong format
invalid_payment_methods
payment_methods invalid. Wrong format
invalid_payment_methods
the combination of payment methods and payment types cannot exclude all payment methods.
invalid_payment_methods
amount cannot be paid with MercadoPago.
invalid_payment_methods
excluded_payment_methods invalid. Wrong format.
invalid_payment_methods
id needed.
invalid_payment_methods
account_money cannot be excluded.
invalid_payment_methods
cannot exclude all payments methods.
invalid_payment_methods
excluded_payment_types invalid. Wrong format.
invalid_payment_methods
cannot exclude all payments types.
invalid_payment_methods
client_id invalid.
invalid_payment_methods
client_id must be a number.
invalid_installments
installments invalid. Should be only 1, 3, 6, 9, 12, 15, 18, 21 or 24.
invalid_installments
installments must be a number.
invalid_marketplace_fee
marketplace_fee must be a number.
invalid_marketplace_fee
marketplace_fee must be a positive number.
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 shipment mode
invalid_shipments
collector doesn't have me2 active.
invalid_shipments
shipments.dimensions invalid
invalid_shipments
shipments.free_methods invalid
invalid_shipments
shipments.free_methods ID must be a number
invalid_shipments
invalid free_methods
invalid_shipments
shipments.local_pickup invalid
invalid_shipments
shipments.default_shipping_method must be a number
invalid_shipments
invalid shipments.default_shipping_method
invalid_shipments
shipments.free_shipping invalid
invalid_shipments
shipments.cost must be a number
invalid_shipments
shipments.cost invalid
invalid_shipments
Invalid dimensions format
invalid_shipments
Invalid dimension values
invalid_shipments
Invalid total amount, with me2 it cannot be lesser than .
invalid_binary_mode
binary_mode deve ser booleano.