Transacciones vĂa Checkout Pro
Al realizar una solicitud de pago (/checkout/preferences
), solo necesitas asignar el ID de tu cuenta de Mercado Pago al campo sponsor_id
en el cuerpo de la solicitud.
Ejemplo:
curl
curl --location --request POST 'https://api.mercadolibre.com/checkout/preferences' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--data-raw '{
"auto_return": "all",
"back_urls": {
"success": "https://httpbin.org/get?status=pago",
"failure": "https://httpbin.org/get?status=recusado",
"pending": "https://httpbin.org/get?status=pendente"
},
"redirect_urls": {
"failure": "https://httpbin.org/get?status=redirectrecusado",
"pending": "https://httpbin.org/get?status=redirectpendente",
"success": "https://httpbin.org/get?status=redirectsuccess"
},
"notification_url": "https://webhook.site/d69d1102-b677-44f6-ae6d-104a7e813b93",
"expires": false,
"external_reference": "Pedido - Teste",
"date_of_expiration": "2022-04-01T22:59:00.000-04:00",
"sponsor_id": "{{ID de su cuenta Mercado Pago referente a su plataforma}}",
"items": [
{
"id": "1234",
"currency_id": "Moneda. Ejemplo: BRL",
"title": "Producto",
"category_id": "entertainment",
"quantity": 1,
"unit_price": 4
},
{
"id": "1234",
"currency_id": "Moneda. Ejemplo: BRL",
"title": "EnvĂo",
"category_id": "entertainment",
"quantity": 1,
"unit_price": 1
}
],
"payment_methods": {
"default_installments": null,
"default_payment_method_id": null,
"excluded_payment_types": []
},
"installments": null,
"shipments": {
"receiver_address": {
"zip_code": "CĂłdigo de ĂĄrea. Ejemplo: 95630000",
"street_name": "Nombre de la calle. Ejemplo: Av. S. Luiz",
"street_number": "NĂșmero. Ejemplo: 15"
}
}
}'
Si envĂas la misma informaciĂłn en ambos campos, la API devolverĂĄ un error: "Invalid users involved".
ÂżTodavĂa tienes dudas sobre las credenciales? Accede al contenido ÂżDĂłnde puedo encontrar las credenciales?.