Mercado Pago - Create Preference
Description
Section titled “Description”Creates a payment preference for Mercado Pago Checkout Pro. Allows configuring items, return URLs, payer data, and payment options.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credential | Yes | Mercado Pago credentials |
| items | string | Yes | Items in JSON format (array) |
| payer_email | string | No | Payer email |
| payer_name | string | No | Payer name |
| payer_phone | string | No | Payer phone |
| external_reference | string | No | External reference |
| success_url | string | No | Success redirect URL |
| failure_url | string | No | Failure redirect URL |
| pending_url | string | No | Pending redirect URL |
| notification_url | string | No | IPN webhook URL |
| auto_return | select | No | Auto return behavior |
| expires | boolean | No | Whether the preference expires |
| expiration_date_from | string | No | Valid from date |
| expiration_date_to | string | No | Valid until date |
Credentials
Section titled “Credentials”This module requires a mercadopago type credential with the following fields:
- Access Token: Mercado Pago access token (obtained from the developer dashboard)
Items Format
Section titled “Items Format”[ { "title": "Producto 1", "quantity": 2, "unit_price": 100.50, "currency_id": "ARS", "description": "Descripción opcional", "picture_url": "https://..." }]Output
Section titled “Output”{ "success": true, "preference": { ... }, "preference_id": "123456789-abc", "init_point": "https://www.mercadopago.com.ar/checkout/v1/redirect?...", "sandbox_init_point": "https://sandbox.mercadopago.com.ar/checkout/v1/redirect?...", "message": "Preferencia 123456789-abc creada"}Checkout Pro Flow
Section titled “Checkout Pro Flow”- Create the preference with this module
- Redirect the user to
init_point(production) orsandbox_init_point(testing) - The user completes the payment in the Mercado Pago interface
- The user is redirected to your configured URLs
- Receive notifications via webhook at
notification_url
Usage Example
Section titled “Usage Example”{ "items": "[{\"title\": \"Producto 1\", \"quantity\": 2, \"unit_price\": 100.50, \"currency_id\": \"ARS\"}]", "payer_email": "cliente@email.com", "external_reference": "ORDER-123", "success_url": "https://mitienda.com/success", "failure_url": "https://mitienda.com/failure", "notification_url": "https://mitienda.com/webhook"}API Used
Section titled “API Used”- Endpoint:
POST /checkout/preferences - Documentation: Mercado Pago Preferences API
- The
itemsfield must be a JSON array serialized as text - Each item requires at least
title,quantity, andunit_price - Return URLs are optional but recommended for a good user experience
- The returned
init_pointis the URL to redirect the user to checkout
Related Nodes
Section titled “Related Nodes”- MercadopagoGetPayments - Get resulting payments
- MercadopagoCreateRefund - Create refund
- MercadopagoCreateCustomer - Create customer